@pega/lists-react 10.0.0-build.4.4 → 10.0.0-build.4.6
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 +284 -83
- package/lib/Core/Components/Card/CardFieldValue.d.ts +8 -0
- package/lib/Core/Components/Card/CardFieldValue.d.ts.map +1 -0
- package/lib/Core/Components/Card/CardFieldValue.js +8 -0
- package/lib/Core/Components/Card/CardFieldValue.js.map +1 -0
- package/lib/Core/Components/Card/CardHeader.d.ts +8 -0
- package/lib/Core/Components/Card/CardHeader.d.ts.map +1 -0
- package/lib/Core/{Views/Gallery/Components/GalleryHeader.js → Components/Card/CardHeader.js} +4 -4
- package/lib/Core/Components/Card/CardHeader.js.map +1 -0
- package/lib/Core/{Views/Gallery/utils.d.ts → Components/Card/cardData.d.ts} +16 -14
- package/lib/Core/Components/Card/cardData.d.ts.map +1 -0
- package/lib/Core/{Views/Gallery/utils.js → Components/Card/cardData.js} +31 -49
- package/lib/Core/Components/Card/cardData.js.map +1 -0
- package/lib/Core/Components/Card/hooks/useRowActions.d.ts.map +1 -0
- package/lib/Core/Components/Card/hooks/useRowActions.js.map +1 -0
- package/lib/Core/Components/Card/index.d.ts +5 -0
- package/lib/Core/Components/Card/index.d.ts.map +1 -0
- package/lib/Core/Components/Card/index.js +5 -0
- package/lib/Core/Components/Card/index.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js +3 -3
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -1
- package/lib/Core/Components/RSWrapper/index.d.ts.map +1 -1
- package/lib/Core/Components/RSWrapper/index.js +4 -0
- package/lib/Core/Components/RSWrapper/index.js.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.js +3 -3
- 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 -3
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js.map +1 -1
- package/lib/Core/Views/Gallery/GalleryContainer.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/GalleryContainer.js +1 -1
- package/lib/Core/Views/Gallery/GalleryContainer.js.map +1 -1
- package/lib/Core/Views/Gallery/index.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/index.js +3 -1
- package/lib/Core/Views/Gallery/index.js.map +1 -1
- package/lib/Core/Views/Kanban/Kanban.styles.d.ts +13 -0
- package/lib/Core/Views/Kanban/Kanban.styles.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/Kanban.styles.js +47 -0
- package/lib/Core/Views/Kanban/Kanban.styles.js.map +1 -0
- package/lib/Core/Views/Kanban/Kanban.types.d.ts +8 -0
- package/lib/Core/Views/Kanban/Kanban.types.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/Kanban.types.js +2 -0
- package/lib/Core/Views/Kanban/Kanban.types.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanCard.d.ts +4 -0
- package/lib/Core/Views/Kanban/KanbanCard.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanCard.js +19 -0
- package/lib/Core/Views/Kanban/KanbanCard.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLane.d.ts +20 -0
- package/lib/Core/Views/Kanban/KanbanLane.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLane.js +23 -0
- package/lib/Core/Views/Kanban/KanbanLane.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.d.ts +11 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.js +15 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.js.map +1 -0
- package/lib/Core/Views/Kanban/index.d.ts +9 -0
- package/lib/Core/Views/Kanban/index.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/index.js +63 -0
- package/lib/Core/Views/Kanban/index.js.map +1 -0
- package/lib/Core/templateFeatureSupport.js +2 -2
- package/lib/Core/templateFeatureSupport.js.map +1 -1
- package/package.json +7 -7
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts +0 -8
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js +0 -8
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js.map +0 -1
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts +0 -8
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/Components/GalleryHeader.js.map +0 -1
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/hooks/useRowActions.js.map +0 -1
- package/lib/Core/Views/Gallery/utils.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/utils.js.map +0 -1
- /package/lib/Core/{Views/Gallery → Components/Card}/hooks/useRowActions.d.ts +0 -0
- /package/lib/Core/{Views/Gallery → Components/Card}/hooks/useRowActions.js +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
interface StyledKanbanContainerProps {
|
|
3
|
+
view: RsCoreTypes.View;
|
|
4
|
+
isFullscreen: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const StyledKanbanContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledKanbanContainerProps>> & string;
|
|
7
|
+
export declare const StyledKanbanBoard: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
export declare const StyledKanbanLane: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
9
|
+
export declare const StyledKanbanLaneHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
10
|
+
export declare const StyledKanbanCards: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
+
export declare const StyledKanbanCard: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=Kanban.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kanban.styles.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Kanban/Kanban.styles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,UAAU,0BAA0B;IAClC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,qBAAqB,+PAKjC,CAAC;AAIF,eAAO,MAAM,iBAAiB,6NAM7B,CAAC;AAIF,eAAO,MAAM,gBAAgB,uNAO5B,CAAC;AAIF,eAAO,MAAM,sBAAsB,uNASlC,CAAC;AAIF,eAAO,MAAM,iBAAiB,6NAO7B,CAAC;AAIF,eAAO,MAAM,gBAAgB,6NAM5B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { defaultThemeProp } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StyledSelectionCard } from '@pega/cosmos-react-core/lib/components/SelectionCard/SelectionCard.styles';
|
|
4
|
+
import { generateRSHeightStyles } from '../../Utils/styles';
|
|
5
|
+
export const StyledKanbanContainer = styled.div(({ view, isFullscreen }) => css `
|
|
6
|
+
${generateRSHeightStyles({ view, isFullscreen })}
|
|
7
|
+
min-inline-size: 0;
|
|
8
|
+
`);
|
|
9
|
+
StyledKanbanContainer.defaultProps = defaultThemeProp;
|
|
10
|
+
export const StyledKanbanBoard = styled.div(() => css `
|
|
11
|
+
flex: 1 1 auto;
|
|
12
|
+
min-block-size: 0;
|
|
13
|
+
overflow: auto;
|
|
14
|
+
`);
|
|
15
|
+
StyledKanbanBoard.defaultProps = defaultThemeProp;
|
|
16
|
+
export const StyledKanbanLane = styled.section(({ theme }) => css `
|
|
17
|
+
min-block-size: 0;
|
|
18
|
+
border-radius: ${theme.base['border-radius']};
|
|
19
|
+
background: ${theme.base.palette['secondary-background']};
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
`);
|
|
22
|
+
StyledKanbanLane.defaultProps = defaultThemeProp;
|
|
23
|
+
export const StyledKanbanLaneHeader = styled.header(({ theme }) => css `
|
|
24
|
+
color: ${theme.base.palette['foreground-color']};
|
|
25
|
+
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
26
|
+
|
|
27
|
+
> :first-child {
|
|
28
|
+
min-inline-size: 0;
|
|
29
|
+
}
|
|
30
|
+
`);
|
|
31
|
+
StyledKanbanLaneHeader.defaultProps = defaultThemeProp;
|
|
32
|
+
export const StyledKanbanCards = styled.div(() => css `
|
|
33
|
+
position: relative;
|
|
34
|
+
flex: 1 1 auto;
|
|
35
|
+
min-block-size: 0;
|
|
36
|
+
overflow: auto;
|
|
37
|
+
`);
|
|
38
|
+
StyledKanbanCards.defaultProps = defaultThemeProp;
|
|
39
|
+
export const StyledKanbanCard = styled.div `
|
|
40
|
+
${StyledSelectionCard} {
|
|
41
|
+
inline-size: 100%;
|
|
42
|
+
max-inline-size: 100%;
|
|
43
|
+
min-inline-size: 0;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
StyledKanbanCard.defaultProps = defaultThemeProp;
|
|
47
|
+
//# sourceMappingURL=Kanban.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kanban.styles.js","sourceRoot":"","sources":["../../../../Core/Views/Kanban/Kanban.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAC;AAGhH,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAO5D,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAC7C,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;MAC3B,sBAAsB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;GAEjD,CACF,CAAC;AAEF,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CACzC,GAAG,EAAE,CAAC,GAAG,CAAA;;;;GAIR,CACF,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAC5C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;qBAEC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;kBAC9B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;;GAEzD,CACF,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CACjD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;aACP,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;mBAChC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;;;;GAKtD,CACF,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CACzC,GAAG,EAAE,CAAC,GAAG,CAAA;;;;;GAKR,CACF,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;IACtC,mBAAmB;;;;;CAKtB,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\nimport { StyledSelectionCard } from '@pega/cosmos-react-core/lib/components/SelectionCard/SelectionCard.styles';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport { generateRSHeightStyles } from '../../Utils/styles';\n\ninterface StyledKanbanContainerProps {\n view: RsCoreTypes.View;\n isFullscreen: boolean;\n}\n\nexport const StyledKanbanContainer = styled.div<StyledKanbanContainerProps>(\n ({ view, isFullscreen }) => css`\n ${generateRSHeightStyles({ view, isFullscreen })}\n min-inline-size: 0;\n `\n);\n\nStyledKanbanContainer.defaultProps = defaultThemeProp;\n\nexport const StyledKanbanBoard = styled.div(\n () => css`\n flex: 1 1 auto;\n min-block-size: 0;\n overflow: auto;\n `\n);\n\nStyledKanbanBoard.defaultProps = defaultThemeProp;\n\nexport const StyledKanbanLane = styled.section(\n ({ theme }) => css`\n min-block-size: 0;\n border-radius: ${theme.base['border-radius']};\n background: ${theme.base.palette['secondary-background']};\n overflow: hidden;\n `\n);\n\nStyledKanbanLane.defaultProps = defaultThemeProp;\n\nexport const StyledKanbanLaneHeader = styled.header(\n ({ theme }) => css`\n color: ${theme.base.palette['foreground-color']};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n\n > :first-child {\n min-inline-size: 0;\n }\n `\n);\n\nStyledKanbanLaneHeader.defaultProps = defaultThemeProp;\n\nexport const StyledKanbanCards = styled.div(\n () => css`\n position: relative;\n flex: 1 1 auto;\n min-block-size: 0;\n overflow: auto;\n `\n);\n\nStyledKanbanCards.defaultProps = defaultThemeProp;\n\nexport const StyledKanbanCard = styled.div`\n ${StyledSelectionCard} {\n inline-size: 100%;\n max-inline-size: 100%;\n min-inline-size: 0;\n }\n`;\n\nStyledKanbanCard.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
export interface KanbanCardProps {
|
|
3
|
+
row: RsCoreTypes.Row;
|
|
4
|
+
meta: RsCoreTypes.Meta;
|
|
5
|
+
visibleColumns: RsCoreTypes.Column[];
|
|
6
|
+
headerColumn?: RsCoreTypes.Column;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Kanban.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kanban.types.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Kanban/Kanban.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kanban.types.js","sourceRoot":"","sources":["../../../../Core/Views/Kanban/Kanban.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nexport interface KanbanCardProps {\n row: RsCoreTypes.Row;\n meta: RsCoreTypes.Meta;\n visibleColumns: RsCoreTypes.Column[];\n headerColumn?: RsCoreTypes.Column;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { KanbanCardProps } from './Kanban.types';
|
|
2
|
+
declare const KanbanCard: import("react").MemoExoticComponent<({ headerColumn, row, meta, visibleColumns }: KanbanCardProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export default KanbanCard;
|
|
4
|
+
//# sourceMappingURL=KanbanCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanCard.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanCard.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,QAAA,MAAM,UAAU,oFAAsD,eAAe,6CA8BnF,CAAC;AAIH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { SelectionCardDisplay } from '@pega/cosmos-react-core';
|
|
4
|
+
import { getCardData, getCardUIProps, useRowActions } from '../../Components/Card';
|
|
5
|
+
import { StyledKanbanCard } from './Kanban.styles';
|
|
6
|
+
const KanbanCard = memo(({ headerColumn, row, meta, visibleColumns }) => {
|
|
7
|
+
const { label, image, footer, fields, 'aria-label': ariaLabel } = getCardData({
|
|
8
|
+
row,
|
|
9
|
+
visibleColumns,
|
|
10
|
+
cardConfig: meta.cardConfig,
|
|
11
|
+
headerColumn
|
|
12
|
+
});
|
|
13
|
+
const uiProps = getCardUIProps({ row });
|
|
14
|
+
const fetchActionsCb = useRowActions({ row, meta });
|
|
15
|
+
return (_jsx(StyledKanbanCard, { "data-key": uiProps['data-key'], children: _jsx(SelectionCardDisplay, { "aria-label": ariaLabel, label: label, headingTag: 'h3', image: image, fields: fields, actions: fetchActionsCb, footer: footer, draggable: false }) }));
|
|
16
|
+
});
|
|
17
|
+
KanbanCard.displayName = 'KanbanCard';
|
|
18
|
+
export default KanbanCard;
|
|
19
|
+
//# sourceMappingURL=KanbanCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanCard.js","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAmB,EAAE,EAAE;IACvF,MAAM,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,YAAY,EAAE,SAAS,EACxB,GAAG,WAAW,CAAC;QACd,GAAG;QACH,cAAc;QACd,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,YAAY;KACb,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IACxC,MAAM,cAAc,GAAG,aAAa,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAEpD,OAAO,CACL,KAAC,gBAAgB,gBAAW,OAAO,CAAC,UAAU,CAAC,YAC7C,KAAC,oBAAoB,kBACP,SAAS,EACrB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAC,IAAI,EACf,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,KAAK,GAChB,GACe,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,eAAe,UAAU,CAAC","sourcesContent":["import { memo } from 'react';\n\nimport { SelectionCardDisplay } from '@pega/cosmos-react-core';\n\nimport { getCardData, getCardUIProps, useRowActions } from '../../Components/Card';\n\nimport { StyledKanbanCard } from './Kanban.styles';\nimport type { KanbanCardProps } from './Kanban.types';\n\nconst KanbanCard = memo(({ headerColumn, row, meta, visibleColumns }: KanbanCardProps) => {\n const {\n label,\n image,\n footer,\n fields,\n 'aria-label': ariaLabel\n } = getCardData({\n row,\n visibleColumns,\n cardConfig: meta.cardConfig,\n headerColumn\n });\n const uiProps = getCardUIProps({ row });\n const fetchActionsCb = useRowActions({ row, meta });\n\n return (\n <StyledKanbanCard data-key={uiProps['data-key']}>\n <SelectionCardDisplay\n aria-label={ariaLabel}\n label={label}\n headingTag='h3'\n image={image}\n fields={fields}\n actions={fetchActionsCb}\n footer={footer}\n draggable={false}\n />\n </StyledKanbanCard>\n );\n});\n\nKanbanCard.displayName = 'KanbanCard';\n\nexport default KanbanCard;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
3
|
+
interface KanbanLaneProps {
|
|
4
|
+
lane: RsCoreTypes.GroupGenerator;
|
|
5
|
+
laneColumn?: RsCoreTypes.Column;
|
|
6
|
+
meta: RsCoreTypes.Meta;
|
|
7
|
+
visibleColumns: RsCoreTypes.Column[];
|
|
8
|
+
headerColumn?: RsCoreTypes.Column;
|
|
9
|
+
emptyState: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface EmptyKanbanLaneProps {
|
|
12
|
+
emptyState: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare function KanbanLane({ lane, laneColumn, meta, visibleColumns, headerColumn, emptyState }: KanbanLaneProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare namespace KanbanLane {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const EmptyKanbanLane: ({ emptyState }: EmptyKanbanLaneProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default KanbanLane;
|
|
20
|
+
//# sourceMappingURL=KanbanLane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanLane.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanLane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAMlE,UAAU,eAAe;IACvB,IAAI,EAAE,WAAW,CAAC,cAAc,CAAC;IACjC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAClC,UAAU,EAAE,SAAS,CAAC;CACvB;AAED,UAAU,oBAAoB;IAC5B,UAAU,EAAE,SAAS,CAAC;CACvB;AAED,iBAAS,UAAU,CAAC,EAClB,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,UAAU,EACX,EAAE,eAAe,2CA2BjB;kBAlCQ,UAAU;;;AAsCnB,eAAO,MAAM,eAAe,GAAI,gBAAgB,oBAAoB,4CAoBnE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Count, Flex, Grid } from '@pega/cosmos-react-core';
|
|
3
|
+
import KanbanCard from './KanbanCard';
|
|
4
|
+
import KanbanLaneHeader from './KanbanLaneHeader';
|
|
5
|
+
import { StyledKanbanCards, StyledKanbanLane, StyledKanbanLaneHeader } from './Kanban.styles';
|
|
6
|
+
function KanbanLane({ lane, laneColumn, meta, visibleColumns, headerColumn, emptyState }) {
|
|
7
|
+
const laneRows = lane.getRows?.() ?? [];
|
|
8
|
+
return (_jsxs(Flex, { as: StyledKanbanLane, role: 'listitem', container: { direction: 'column' }, children: [_jsxs(Grid, { as: StyledKanbanLaneHeader, container: { cols: 'minmax(0, 1fr) auto', alignItems: 'center', gap: 0.5, pad: 1 }, children: [_jsx(KanbanLaneHeader, { column: laneColumn, groupHeader: lane }), _jsx(Count, { children: lane.count })] }), _jsx(Flex, { as: StyledKanbanCards, container: { direction: 'column', gap: 1, pad: 1 }, children: lane.count === 0
|
|
9
|
+
? emptyState
|
|
10
|
+
: laneRows.map(row => (_jsx(KanbanCard, { meta: meta, row: row, visibleColumns: visibleColumns, headerColumn: headerColumn }, row.reactKey))) })] }));
|
|
11
|
+
}
|
|
12
|
+
KanbanLane.displayName = 'KanbanLane';
|
|
13
|
+
export const EmptyKanbanLane = ({ emptyState }) => {
|
|
14
|
+
return (_jsxs(Flex, { as: StyledKanbanLane, role: 'listitem', container: { direction: 'column' }, children: [_jsx(Grid, { as: StyledKanbanLaneHeader, container: {
|
|
15
|
+
cols: 'minmax(0, 1fr) auto',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
gap: 0.5,
|
|
18
|
+
pad: 1,
|
|
19
|
+
justifyItems: 'end'
|
|
20
|
+
}, children: _jsx(Count, { children: 0 }) }), _jsx(Flex, { as: StyledKanbanCards, container: { direction: 'column', gap: 1, pad: 1 }, children: emptyState })] }));
|
|
21
|
+
};
|
|
22
|
+
export default KanbanLane;
|
|
23
|
+
//# sourceMappingURL=KanbanLane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanLane.js","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanLane.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAe9F,SAAS,UAAU,CAAC,EAClB,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,UAAU,EACM;IAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC;IAExC,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAC,UAAU,EAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAC5E,MAAC,IAAI,IACH,EAAE,EAAE,sBAAsB,EAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,aAElF,KAAC,gBAAgB,IAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,GAAI,EAC3D,KAAC,KAAK,cAAE,IAAI,CAAC,KAAK,GAAS,IACtB,EACP,KAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,YAC5E,IAAI,CAAC,KAAK,KAAK,CAAC;oBACf,CAAC,CAAC,UAAU;oBACZ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAClB,KAAC,UAAU,IAET,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,IAJrB,GAAG,CAAC,QAAQ,CAKjB,CACH,CAAC,GACD,IACF,CACR,CAAC;AACJ,CAAC;AAED,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,UAAU,EAAwB,EAAE,EAAE;IACtE,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAC,UAAU,EAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAC5E,KAAC,IAAI,IACH,EAAE,EAAE,sBAAsB,EAC1B,SAAS,EAAE;oBACT,IAAI,EAAE,qBAAqB;oBAC3B,UAAU,EAAE,QAAQ;oBACpB,GAAG,EAAE,GAAG;oBACR,GAAG,EAAE,CAAC;oBACN,YAAY,EAAE,KAAK;iBACpB,YAED,KAAC,KAAK,cAAE,CAAC,GAAS,GACb,EACP,KAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,YAC5E,UAAU,GACN,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Count, Flex, Grid } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport KanbanCard from './KanbanCard';\nimport KanbanLaneHeader from './KanbanLaneHeader';\nimport { StyledKanbanCards, StyledKanbanLane, StyledKanbanLaneHeader } from './Kanban.styles';\n\ninterface KanbanLaneProps {\n lane: RsCoreTypes.GroupGenerator;\n laneColumn?: RsCoreTypes.Column;\n meta: RsCoreTypes.Meta;\n visibleColumns: RsCoreTypes.Column[];\n headerColumn?: RsCoreTypes.Column;\n emptyState: ReactNode;\n}\n\ninterface EmptyKanbanLaneProps {\n emptyState: ReactNode;\n}\n\nfunction KanbanLane({\n lane,\n laneColumn,\n meta,\n visibleColumns,\n headerColumn,\n emptyState\n}: KanbanLaneProps) {\n const laneRows = lane.getRows?.() ?? [];\n\n return (\n <Flex as={StyledKanbanLane} role='listitem' container={{ direction: 'column' }}>\n <Grid\n as={StyledKanbanLaneHeader}\n container={{ cols: 'minmax(0, 1fr) auto', alignItems: 'center', gap: 0.5, pad: 1 }}\n >\n <KanbanLaneHeader column={laneColumn} groupHeader={lane} />\n <Count>{lane.count}</Count>\n </Grid>\n <Flex as={StyledKanbanCards} container={{ direction: 'column', gap: 1, pad: 1 }}>\n {lane.count === 0\n ? emptyState\n : laneRows.map(row => (\n <KanbanCard\n key={row.reactKey}\n meta={meta}\n row={row}\n visibleColumns={visibleColumns}\n headerColumn={headerColumn}\n />\n ))}\n </Flex>\n </Flex>\n );\n}\n\nKanbanLane.displayName = 'KanbanLane';\n\nexport const EmptyKanbanLane = ({ emptyState }: EmptyKanbanLaneProps) => {\n return (\n <Flex as={StyledKanbanLane} role='listitem' container={{ direction: 'column' }}>\n <Grid\n as={StyledKanbanLaneHeader}\n container={{\n cols: 'minmax(0, 1fr) auto',\n alignItems: 'center',\n gap: 0.5,\n pad: 1,\n justifyItems: 'end'\n }}\n >\n <Count>{0}</Count>\n </Grid>\n <Flex as={StyledKanbanCards} container={{ direction: 'column', gap: 1, pad: 1 }}>\n {emptyState}\n </Flex>\n </Flex>\n );\n};\n\nexport default KanbanLane;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
interface KanbanLaneHeaderProps {
|
|
3
|
+
column?: RsCoreTypes.Column;
|
|
4
|
+
groupHeader?: RsCoreTypes.GroupGenerator;
|
|
5
|
+
}
|
|
6
|
+
declare function KanbanLaneHeader({ column, groupHeader }: KanbanLaneHeaderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
declare namespace KanbanLaneHeader {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
export default KanbanLaneHeader;
|
|
11
|
+
//# sourceMappingURL=KanbanLaneHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanLaneHeader.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanLaneHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC;CAC1C;AAED,iBAAS,gBAAgB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,qBAAqB,kDAevE;kBAfQ,gBAAgB;;;AAmBzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import RenderingEngine from '../../Components/RenderingEngine/RenderCell';
|
|
3
|
+
function KanbanLaneHeader({ column, groupHeader }) {
|
|
4
|
+
if (!column || !groupHeader) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
column.setExecutionContext(null);
|
|
8
|
+
return (_jsx(RenderingEngine, { ...column.getRenderingEngineProps(), context: {
|
|
9
|
+
getValue: () => groupHeader.name,
|
|
10
|
+
getExecutionContext: () => ({ getValue: () => groupHeader.data, name: 'groupHeader' })
|
|
11
|
+
} }));
|
|
12
|
+
}
|
|
13
|
+
KanbanLaneHeader.displayName = 'KanbanLaneHeader';
|
|
14
|
+
export default KanbanLaneHeader;
|
|
15
|
+
//# sourceMappingURL=KanbanLaneHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanLaneHeader.js","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanLaneHeader.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,MAAM,6CAA6C,CAAC;AAO1E,SAAS,gBAAgB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAyB;IACtE,IAAI,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAEjC,OAAO,CACL,KAAC,eAAe,OACV,MAAM,CAAC,uBAAuB,EAAE,EACpC,OAAO,EAAE;YACP,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI;YAChC,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;SACvF,GACD,CACH,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,eAAe,gBAAgB,CAAC","sourcesContent":["import type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport RenderingEngine from '../../Components/RenderingEngine/RenderCell';\n\ninterface KanbanLaneHeaderProps {\n column?: RsCoreTypes.Column;\n groupHeader?: RsCoreTypes.GroupGenerator;\n}\n\nfunction KanbanLaneHeader({ column, groupHeader }: KanbanLaneHeaderProps) {\n if (!column || !groupHeader) {\n return null;\n }\n column.setExecutionContext(null);\n\n return (\n <RenderingEngine\n {...column.getRenderingEngineProps()}\n context={{\n getValue: () => groupHeader.name,\n getExecutionContext: () => ({ getValue: () => groupHeader.data, name: 'groupHeader' })\n }}\n />\n );\n}\n\nKanbanLaneHeader.displayName = 'KanbanLaneHeader';\n\nexport default KanbanLaneHeader;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
declare function Kanban({ view }: {
|
|
3
|
+
view: RsCoreTypes.View;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare namespace Kanban {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export default Kanban;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Kanban/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAsB1F,iBAAS,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAA;CAAE,2CA0FnD;kBA1FQ,MAAM;;;AA8Ff,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { usePrevious, useFullscreenContext, useTheme, Grid, isInstance } from '@pega/cosmos-react-core';
|
|
4
|
+
import { FieldType, getGroupKey } from 'pega-repeating-structures-core';
|
|
5
|
+
import Toolbar from '../../Components/Toolbar';
|
|
6
|
+
import RenderView from '../../Components/RenderingEngine/RenderView';
|
|
7
|
+
import { EXTERNAL_FILTERS } from '../../constants';
|
|
8
|
+
import EmptyContainer from '../../Components/DefaultComponents/EmptyContainer';
|
|
9
|
+
import RsCardWrapper from '../RsCardWrapper';
|
|
10
|
+
import LoadingIndicator from '../../Components/LoadingIndicator';
|
|
11
|
+
import WarningBanner from '../../Components/WarningBanner';
|
|
12
|
+
import useTranslate from '../../Hooks/useTranslate';
|
|
13
|
+
import { isFilterApplied } from '../../Utils';
|
|
14
|
+
import KanbanLane, { EmptyKanbanLane } from './KanbanLane';
|
|
15
|
+
import { StyledKanbanBoard, StyledKanbanContainer } from './Kanban.styles';
|
|
16
|
+
function getLaneId(laneColumn, value) {
|
|
17
|
+
return `${laneColumn?.field.id ?? ''}:${isInstance(value, Date) ? value.toISOString() : String(value)}`;
|
|
18
|
+
}
|
|
19
|
+
function Kanban({ view }) {
|
|
20
|
+
const { columns = [], groupHeaders = [], meta, rows } = view;
|
|
21
|
+
const { filterExpression, searchText, externalState, groups } = view.state ?? {};
|
|
22
|
+
const isFullscreen = !!useFullscreenContext()?.[0];
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const [translate] = useTranslate();
|
|
25
|
+
// Lane configuration
|
|
26
|
+
const firstGroupHeader = groupHeaders[0];
|
|
27
|
+
const laneGroup = groups?.[0];
|
|
28
|
+
const laneColumn = useMemo(() => columns.find(column => String(column.field.id) === String(laneGroup?.columnId)), [columns, laneGroup]);
|
|
29
|
+
const hasLaneConfiguration = !!(laneColumn && laneGroup);
|
|
30
|
+
// RsCore returns empty groupHeader with groupBy = '' and count = 0 when there are no records to display.
|
|
31
|
+
const isEmptyLane = groupHeaders.length === 1 && firstGroupHeader?.groupBy === '' && firstGroupHeader.count === 0;
|
|
32
|
+
const shouldRenderEmptyLane = !!laneGroup && isEmptyLane;
|
|
33
|
+
// With instantRender from RSCore, state can contain the new groupBy while groupHeaders still reflect the previous grouping.
|
|
34
|
+
const laneGroupKey = laneGroup ? getGroupKey(laneGroup) : undefined;
|
|
35
|
+
const hasStaleLanes = !!firstGroupHeader?.groupBy && firstGroupHeader.groupBy !== laneGroupKey;
|
|
36
|
+
const lanes = hasLaneConfiguration && !hasStaleLanes ? groupHeaders : [];
|
|
37
|
+
// Empty state configuration
|
|
38
|
+
const previousTotalItemCount = usePrevious(view.totalItemCount);
|
|
39
|
+
const emptyMessage = isFilterApplied({ filterExpression, searchText, externalState }, meta.externalFilters)
|
|
40
|
+
? translate('No records found')
|
|
41
|
+
: translate('No records');
|
|
42
|
+
const shouldAnnounceEmpty = (previousTotalItemCount ?? 0) > 0 && view.totalItemCount === 0;
|
|
43
|
+
const emptyState = (_jsx(EmptyContainer, { message: emptyMessage, shouldAnnounce: shouldAnnounceEmpty, domContainer: view.getDomContainer(), transparent: true }));
|
|
44
|
+
const visibleColumns = useMemo(() => {
|
|
45
|
+
return [...columns]
|
|
46
|
+
.filter(col => !col.hidden && col.field.type !== FieldType.ACTION_FIELD_TYPE)
|
|
47
|
+
.sort((colA, colB) => (colA.order ?? 0) - (colB.order ?? 0));
|
|
48
|
+
}, [columns]);
|
|
49
|
+
const headerColumn = useMemo(() => {
|
|
50
|
+
const cardHeaderField = meta.cardConfig?.header?.field;
|
|
51
|
+
return cardHeaderField ? columns.find(col => col.field.id === cardHeaderField) : undefined;
|
|
52
|
+
}, [meta.cardConfig?.header?.field, columns]);
|
|
53
|
+
return (_jsx(RsCardWrapper, { children: _jsxs(StyledKanbanContainer, { "data-testid": 'kanban', view: view, isFullscreen: isFullscreen, children: [_jsx(WarningBanner, { warningMessages: view.warningMessages }), _jsx(Toolbar, { view: view }), _jsx(RenderView, { view: view, type: EXTERNAL_FILTERS }), _jsxs(Grid, { as: StyledKanbanBoard, role: 'list', "aria-label": meta.title ?? meta.name, container: {
|
|
54
|
+
autoFlow: 'column',
|
|
55
|
+
autoCols: `minmax(min(${theme.base['content-width'].sm}, 100%), 1fr)`,
|
|
56
|
+
gap: 1.5,
|
|
57
|
+
pad: 0.5
|
|
58
|
+
}, children: [!shouldRenderEmptyLane &&
|
|
59
|
+
lanes.map(lane => (_jsx(KanbanLane, { lane: lane, laneColumn: laneColumn, meta: meta, visibleColumns: visibleColumns, headerColumn: headerColumn, emptyState: emptyState }, getLaneId(laneColumn, lane.name)))), shouldRenderEmptyLane && _jsx(EmptyKanbanLane, { emptyState: emptyState }), _jsx(LoadingIndicator, { view: view, show: !rows || !!view.isLoading })] })] }) }));
|
|
60
|
+
}
|
|
61
|
+
Kanban.displayName = 'Kanban';
|
|
62
|
+
export default Kanban;
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Views/Kanban/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,QAAQ,EACR,IAAI,EACJ,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAoB,MAAM,gCAAgC,CAAC;AAE1F,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAC/C,OAAO,UAAU,MAAM,6CAA6C,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,mCAAmC,CAAC;AACjE,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,SAAS,SAAS,CAChB,UAA0C,EAC1C,KAAyC;IAEzC,OAAO,GAAG,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1G,CAAC;AAED,SAAS,MAAM,CAAC,EAAE,IAAI,EAA8B;IAClD,MAAM,EAAE,OAAO,GAAG,EAAE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I,EACrE,KAAC,gBAAgB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,GAAI,IAC5D,IACe,GACV,CACjB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;AAE9B,eAAe,MAAM,CAAC","sourcesContent":["import { useMemo } from 'react';\n\nimport {\n usePrevious,\n useFullscreenContext,\n useTheme,\n Grid,\n isInstance\n} from '@pega/cosmos-react-core';\nimport { FieldType, getGroupKey, type RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport Toolbar from '../../Components/Toolbar';\nimport RenderView from '../../Components/RenderingEngine/RenderView';\nimport { EXTERNAL_FILTERS } from '../../constants';\nimport EmptyContainer from '../../Components/DefaultComponents/EmptyContainer';\nimport RsCardWrapper from '../RsCardWrapper';\nimport LoadingIndicator from '../../Components/LoadingIndicator';\nimport WarningBanner from '../../Components/WarningBanner';\nimport useTranslate from '../../Hooks/useTranslate';\nimport { isFilterApplied } from '../../Utils';\n\nimport KanbanLane, { EmptyKanbanLane } from './KanbanLane';\nimport { StyledKanbanBoard, StyledKanbanContainer } from './Kanban.styles';\n\nfunction getLaneId(\n laneColumn: RsCoreTypes.Column | undefined,\n value: RsCoreTypes.GroupGenerator['name']\n): string {\n return `${laneColumn?.field.id ?? ''}:${isInstance(value, Date) ? value.toISOString() : String(value)}`;\n}\n\nfunction Kanban({ view }: { view: RsCoreTypes.View }) {\n const { columns = [], groupHeaders = [], meta, rows } = view;\n const { filterExpression, searchText, externalState, groups } = view.state ?? {};\n const isFullscreen = !!useFullscreenContext()?.[0];\n const theme = useTheme();\n const [translate] = useTranslate();\n\n // Lane configuration\n const firstGroupHeader = groupHeaders[0];\n const laneGroup = groups?.[0];\n const laneColumn = useMemo(\n () => columns.find(column => String(column.field.id) === String(laneGroup?.columnId)),\n [columns, laneGroup]\n );\n const hasLaneConfiguration = !!(laneColumn && laneGroup);\n\n // RsCore returns empty groupHeader with groupBy = '' and count = 0 when there are no records to display.\n const isEmptyLane =\n groupHeaders.length === 1 && firstGroupHeader?.groupBy === '' && firstGroupHeader.count === 0;\n const shouldRenderEmptyLane = !!laneGroup && isEmptyLane;\n\n // With instantRender from RSCore, state can contain the new groupBy while groupHeaders still reflect the previous grouping.\n const laneGroupKey = laneGroup ? getGroupKey(laneGroup) : undefined;\n const hasStaleLanes = !!firstGroupHeader?.groupBy && firstGroupHeader.groupBy !== laneGroupKey;\n const lanes = hasLaneConfiguration && !hasStaleLanes ? groupHeaders : [];\n\n // Empty state configuration\n const previousTotalItemCount = usePrevious(view.totalItemCount);\n const emptyMessage = isFilterApplied(\n { filterExpression, searchText, externalState },\n meta.externalFilters\n )\n ? translate('No records found')\n : translate('No records');\n const shouldAnnounceEmpty = (previousTotalItemCount ?? 0) > 0 && view.totalItemCount === 0;\n const emptyState = (\n <EmptyContainer\n message={emptyMessage}\n shouldAnnounce={shouldAnnounceEmpty}\n domContainer={view.getDomContainer()}\n transparent\n />\n );\n\n const visibleColumns = useMemo(() => {\n return [...columns]\n .filter(col => !col.hidden && col.field.type !== FieldType.ACTION_FIELD_TYPE)\n .sort((colA, colB) => (colA.order ?? 0) - (colB.order ?? 0));\n }, [columns]);\n\n const headerColumn = useMemo(() => {\n const cardHeaderField = meta.cardConfig?.header?.field;\n return cardHeaderField ? columns.find(col => col.field.id === cardHeaderField) : undefined;\n }, [meta.cardConfig?.header?.field, columns]);\n\n return (\n <RsCardWrapper>\n <StyledKanbanContainer data-testid='kanban' view={view} isFullscreen={isFullscreen}>\n <WarningBanner warningMessages={view.warningMessages} />\n <Toolbar view={view} />\n <RenderView view={view} type={EXTERNAL_FILTERS} />\n <Grid\n as={StyledKanbanBoard}\n role='list'\n aria-label={meta.title ?? meta.name}\n container={{\n autoFlow: 'column',\n autoCols: `minmax(min(${theme.base['content-width'].sm}, 100%), 1fr)`,\n gap: 1.5,\n pad: 0.5\n }}\n >\n {!shouldRenderEmptyLane &&\n lanes.map(lane => (\n <KanbanLane\n key={getLaneId(laneColumn, lane.name)}\n lane={lane}\n laneColumn={laneColumn}\n meta={meta}\n visibleColumns={visibleColumns}\n headerColumn={headerColumn}\n emptyState={emptyState}\n />\n ))}\n {shouldRenderEmptyLane && <EmptyKanbanLane emptyState={emptyState} />}\n <LoadingIndicator view={view} show={!rows || !!view.isLoading} />\n </Grid>\n </StyledKanbanContainer>\n </RsCardWrapper>\n );\n}\n\nKanban.displayName = 'Kanban';\n\nexport default Kanban;\n"]}
|
|
@@ -2,9 +2,9 @@ import { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';
|
|
|
2
2
|
// TODO: All such feature map support should be available at View object based via a feature in rs-core based on the template from meta.
|
|
3
3
|
// The consumer can pass along the resolved feature map to their component for decisioning.
|
|
4
4
|
const featureSupport = {
|
|
5
|
-
personalization: ['Table', 'Gallery', 'Timeline'],
|
|
5
|
+
personalization: ['Table', 'Gallery', 'Timeline', 'Kanban'],
|
|
6
6
|
group: ['Table', 'Timeline'],
|
|
7
|
-
showHideColumns: ['Table', 'Gallery'],
|
|
7
|
+
showHideColumns: ['Table', 'Gallery', 'Kanban'],
|
|
8
8
|
galleryLayout: ['Gallery'],
|
|
9
9
|
freezeColumns: ['Table'],
|
|
10
10
|
rowDensity: ['Table'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateFeatureSupport.js","sourceRoot":"","sources":["../../Core/templateFeatureSupport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAK/E,wIAAwI;AACxI,2FAA2F;AAC3F,MAAM,cAAc,GAA2C;IAC7D,eAAe,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"templateFeatureSupport.js","sourceRoot":"","sources":["../../Core/templateFeatureSupport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAK/E,wIAAwI;AACxI,2FAA2F;AAC3F,MAAM,cAAc,GAA2C;IAC7D,eAAe,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC;IAC3D,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;IAC5B,eAAe,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;IAC/C,aAAa,EAAE,CAAC,SAAS,CAAC;IAC1B,aAAa,EAAE,CAAC,OAAO,CAAC;IACxB,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,eAAe,EAAE,CAAC,OAAO,CAAC;IAC1B,eAAe,EAAE,CAAC,OAAO,CAAC;IAC1B,iBAAiB,EAAE,CAAC,OAAO,CAAC;IAC5B,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC;AAIF;;;;;;;GAOG;AACH,MAAM,sBAAsB,GAAG,CAAC,QAAuB,EAAE,OAAmB,EAAW,EAAE;IACvF,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\ntype TemplateValue =\n (typeof REPEATING_STRUCTURE_TEMPLATES)[keyof typeof REPEATING_STRUCTURE_TEMPLATES];\n\n// TODO: All such feature map support should be available at View object based via a feature in rs-core based on the template from meta.\n// The consumer can pass along the resolved feature map to their component for decisioning.\nconst featureSupport: { [feature: string]: TemplateValue[] } = {\n personalization: ['Table', 'Gallery', 'Timeline', 'Kanban'],\n group: ['Table', 'Timeline'],\n showHideColumns: ['Table', 'Gallery', 'Kanban'],\n galleryLayout: ['Gallery'],\n freezeColumns: ['Table'],\n rowDensity: ['Table'],\n showHeaderIcons: ['Table'],\n autoSizeColumns: ['Table'],\n resetColumnWidths: ['Table'],\n wrap: ['Table']\n};\n\ntype FeatureKey = keyof typeof featureSupport | string;\n\n/**\n * Check if a feature should show in toolbar for a given template.\n * Features not in the map are considered supported for all templates.\n *\n * @param template - The template type\n * @param feature - The feature identifier\n * @returns true if the feature should show in toolbar for the template\n */\nconst showFeatureForTemplate = (template: TemplateValue, feature: FeatureKey): boolean => {\n if (!featureSupport[feature]) {\n return true;\n }\n return featureSupport[feature].includes(template);\n};\n\nexport default showFeatureForTemplate;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-react",
|
|
3
|
-
"version": "10.0.0-build.4.
|
|
3
|
+
"version": "10.0.0-build.4.6",
|
|
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,17 +14,17 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "10.0.0-build.4.
|
|
18
|
-
"@pega/cosmos-react-core": "10.0.0-build.4.
|
|
19
|
-
"@pega/cosmos-react-rte": "10.0.0-build.4.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "10.0.0-build.4.6",
|
|
18
|
+
"@pega/cosmos-react-core": "10.0.0-build.4.6",
|
|
19
|
+
"@pega/cosmos-react-rte": "10.0.0-build.4.6",
|
|
20
20
|
"@types/lodash-es": "^4.17.12",
|
|
21
21
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
22
22
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
23
23
|
"dayjs": "^1.11.13",
|
|
24
24
|
"fast-deep-equal": "^3.1.3",
|
|
25
25
|
"lodash-es": "^4.18.1",
|
|
26
|
-
"pega-repeating-structures-core": "npm:@pega/lists-core@10.0.0-build.4.
|
|
27
|
-
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@10.0.0-build.4.
|
|
26
|
+
"pega-repeating-structures-core": "npm:@pega/lists-core@10.0.0-build.4.6",
|
|
27
|
+
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@10.0.0-build.4.6",
|
|
28
28
|
"polished": "^4.1.0",
|
|
29
29
|
"prop-types": "^15.8.1",
|
|
30
30
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@testing-library/react": "^16.0.0",
|
|
43
43
|
"@testing-library/user-event": "^14.6.1",
|
|
44
44
|
"jest-axe": "^8.0.0",
|
|
45
|
-
"srs-utils": "10.0.0-build.4.
|
|
45
|
+
"srs-utils": "10.0.0-build.4.6",
|
|
46
46
|
"typescript": "~6.0.3"
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
-
interface GalleryFieldValueProps {
|
|
3
|
-
column: RsCoreTypes.Column;
|
|
4
|
-
row: RsCoreTypes.Row;
|
|
5
|
-
}
|
|
6
|
-
declare function GalleryFieldValue({ column, row }: GalleryFieldValueProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default GalleryFieldValue;
|
|
8
|
-
//# sourceMappingURL=GalleryFieldValue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryFieldValue.d.ts","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryFieldValue.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,UAAU,sBAAsB;IAC9B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;IAC3B,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;CACtB;AAED,iBAAS,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,sBAAsB,2CAIjE;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import RenderingEngine from '../../../Components/RenderingEngine/RenderCell';
|
|
3
|
-
function GalleryFieldValue({ column, row }) {
|
|
4
|
-
column.setExecutionContext(row);
|
|
5
|
-
return _jsx(RenderingEngine, { ...column.getRenderingEngineProps(), highlighter: true });
|
|
6
|
-
}
|
|
7
|
-
export default GalleryFieldValue;
|
|
8
|
-
//# sourceMappingURL=GalleryFieldValue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryFieldValue.js","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryFieldValue.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,MAAM,gDAAgD,CAAC;AAO7E,SAAS,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,EAA0B;IAChE,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAEhC,OAAO,KAAC,eAAe,OAAK,MAAM,CAAC,uBAAuB,EAAE,EAAE,WAAW,SAAG,CAAC;AAC/E,CAAC;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["import type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport RenderingEngine from '../../../Components/RenderingEngine/RenderCell';\n\ninterface GalleryFieldValueProps {\n column: RsCoreTypes.Column;\n row: RsCoreTypes.Row;\n}\n\nfunction GalleryFieldValue({ column, row }: GalleryFieldValueProps) {\n column.setExecutionContext(row);\n\n return <RenderingEngine {...column.getRenderingEngineProps()} highlighter />;\n}\n\nexport default GalleryFieldValue;\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
-
type GalleryHeaderProps = {
|
|
3
|
-
headerColumn?: RsCoreTypes.Column;
|
|
4
|
-
row: RsCoreTypes.Row;
|
|
5
|
-
};
|
|
6
|
-
declare function GalleryHeader({ headerColumn, row }: GalleryHeaderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
-
export default GalleryHeader;
|
|
8
|
-
//# sourceMappingURL=GalleryHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryHeader.d.ts","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,KAAK,kBAAkB,GAAG;IACxB,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAClC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;CACtB,CAAC;AAMF,iBAAS,aAAa,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE,kBAAkB,kDAY/D;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryHeader.js","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAIvC,OAAO,eAAe,MAAM,gDAAgD,CAAC;AAO7E,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAC;AAEF,SAAS,aAAa,CAAC,EAAE,YAAY,EAAE,GAAG,EAAsB;IAC9D,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAEvC,OAAO,CACL,KAAC,qBAAqB,cACpB,KAAC,eAAe,OAAK,YAAY,CAAC,uBAAuB,EAAE,GAAI,GACzC,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC","sourcesContent":["import styled from 'styled-components';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport RenderingEngine from '../../../Components/RenderingEngine/RenderCell';\n\ntype GalleryHeaderProps = {\n headerColumn?: RsCoreTypes.Column;\n row: RsCoreTypes.Row;\n};\n\nconst StyledHeaderContainer = styled.div`\n word-break: break-word;\n`;\n\nfunction GalleryHeader({ headerColumn, row }: GalleryHeaderProps) {\n if (!headerColumn) {\n return null;\n }\n\n headerColumn?.setExecutionContext(row);\n\n return (\n <StyledHeaderContainer>\n <RenderingEngine {...headerColumn.getRenderingEngineProps()} />\n </StyledHeaderContainer>\n );\n}\n\nexport default GalleryHeader;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRowActions.d.ts","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/hooks/useRowActions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,UAAU,kBAAkB;IAC1B,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;CACxB;AAED,QAAA,MAAM,aAAa,GAAI,eAGpB,kBAAkB,KAAG,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAuBnD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRowActions.js","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/hooks/useRowActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAUpC,MAAM,aAAa,GAAG,CAAC,EACrB,GAAG,EACH,IAAI,EACe,EAAyC,EAAE;IAC9D,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,IAAuB,EAAE;QAC7D,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QACpC,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;QAEvC,IAAI,CAAC;YACH,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC,mBAAmB,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACnF,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;gBAClC,UAAU,GAAG,CAAC,GAAG,cAAc,EAAE,GAAG,UAAU,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,6CAA6C;QAC/C,CAAC;QAED,OAAO,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC/B,GAAG,MAAM;YACT,OAAO,EAAE,GAAG,EAAE;gBACZ,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;YAC/D,CAAC;SACF,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAE3B,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useCallback } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { Action } from '@pega/cosmos-react-core';\n\ninterface UseRowActionsProps {\n row: RsCoreTypes.Row;\n meta: RsCoreTypes.Meta;\n}\n\nconst useRowActions = ({\n row,\n meta\n}: UseRowActionsProps): (() => Promise<Action[]>) | undefined => {\n const fetchActions = useCallback(async (): Promise<Action[]> => {\n const rowContext = row.getContext();\n let allActions = meta.rowActions ?? [];\n\n try {\n const dynamicActions = await rowContext.getRowActionDetails(rowContext.getValue());\n if (Array.isArray(dynamicActions)) {\n allActions = [...dynamicActions, ...allActions];\n }\n } catch (error) {\n // On error, fall back to static actions only\n }\n\n return allActions.map(action => ({\n ...action,\n onClick: () => {\n action.onClick(rowContext.getValue(), rowContext.refreshRow);\n }\n }));\n }, [row, meta.rowActions]);\n\n return meta.editing || meta.deleting ? fetchActions : undefined;\n};\n\nexport default useRowActions;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Gallery/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAkB,SAAS,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,eAAO,MAAM,2BAA2B;;;;CAImC,CAAC;AAG5E,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,kBAA2B,CAAC;AAC9E,eAAO,MAAM,kBAAkB,EAAE,SAAsB,CAAC;AAExD,eAAO,MAAM,iBAAiB,GAC5B,WAAW,WAAW,CAAC,kBAAkB,KACxC,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAEvE,CAAC;AAuCF;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,cAAc,EACd,IAAI,EACJ,YAAY,EACb,EAAE,gBAAgB,GAAG,IAAI,CACxB,yBAAyB,EACzB,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,CACvD,CAgEA;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAA;CAAE;;EAK/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../Core/Views/Gall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AAC","sourcesContent":["import { isEmpty, type RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { ImagePlacement, ImageSize, SelectionCardDisplayProps } from '@pega/cosmos-react-core';\n\nimport type { GalleryCardProps } from './Gallery.types';\nimport GalleryFieldValue from './Components/GalleryFieldValue';\nimport GalleryHeader from './Components/GalleryHeader';\n\nexport const GALLERY_IMAGE_PLACEMENT_MAP = {\n left: 'inline-start',\n right: 'inline-end',\n top: 'block-start'\n} as const satisfies Record<RsCoreTypes.HeroImagePlacement, ImagePlacement>;\n\nconst INLINE_PLACEMENTS: RsCoreTypes.HeroImagePlacement[] = ['left', 'right'] as const;\nexport const DEFAULT_IMAGE_PLACEMENT: RsCoreTypes.HeroImagePlacement = 'left';\nexport const DEFAULT_IMAGE_SIZE: ImageSize = 'flexible';\n\nexport const isInlinePlacement = (\n placement: RsCoreTypes.HeroImagePlacement\n): placement is Extract<RsCoreTypes.HeroImagePlacement, 'left' | 'right'> => {\n return INLINE_PLACEMENTS.includes(placement);\n};\n\n/**\n * Extracts image data from the provided metadata and row context.\n *\n * @param meta - The metadata object containing gallery configuration.\n * @param row - The row object providing context and data values.\n * @returns An object containing:\n * - `src`: The image source URL.\n * - `alt`: The alternative text for the image.\n * - `placement`: The placement of the image within the gallery.\n * - `size`: The size of the image.\n */\nfunction getImageData(\n meta: RsCoreTypes.Meta,\n row: RsCoreTypes.Row\n): {\n src: string;\n alt: string;\n placement: ImagePlacement;\n size: ImageSize;\n} {\n const { galleryConfig: { heroImage: { source, altText, placement, size } = {} } = {} } = meta;\n const rowData = row.getContext().getValue();\n\n let altTextValue = '';\n if (altText && 'field' in altText) {\n altTextValue = altText.field in rowData ? String(rowData[altText.field]) : '';\n } else if (altText && 'value' in altText) {\n altTextValue = altText.value;\n }\n\n const imageUrl = source?.field && source?.field in rowData ? String(rowData[source.field]) : '';\n const imagePlacement = GALLERY_IMAGE_PLACEMENT_MAP[placement ?? DEFAULT_IMAGE_PLACEMENT];\n const imageSize = size || DEFAULT_IMAGE_SIZE;\n\n return { src: imageUrl, alt: altTextValue, placement: imagePlacement, size: imageSize };\n}\n\n/**\n * Generates the data required to display a card in the gallery view.\n *\n * @param props - The properties required to generate the card data.\n * @param props.row - The data for the current row.\n * @param props.visibleColumns - The columns that are visible in the gallery.\n * @param props.meta - Metadata including gallery configuration.\n * @param props.headerColumn - The column used for the card header.\n * @param props.actionColumn - The column used for card actions.\n * @returns An object containing the card's label, image, footer, and fields to be displayed.\n */\nexport function getCardData({\n row,\n visibleColumns,\n meta,\n headerColumn\n}: GalleryCardProps): Pick<\n SelectionCardDisplayProps,\n 'label' | 'image' | 'fields' | 'aria-label' | 'footer'\n> {\n const { galleryConfig: { heroImage, tile: tileConfig, showFieldLabels = true } = {} } = meta;\n\n // Must set execution context for each column to ensure correct value retrieval\n visibleColumns.forEach(col => col.setExecutionContext(row));\n\n const rowData = row.getContext().getValue();\n\n const fields = visibleColumns.map(col => ({\n id: col.field.id,\n ...(showFieldLabels && { name: col.getContext()?.getLabel() }),\n ...(col.field.layoutMode && { variant: col.field.layoutMode }),\n // TODO: Add truncation for non-tile cards once `truncate` is typed at\n // the field-level API.\n ...(!heroImage && tileConfig\n ? { value: String(rowData[col.field.id] ?? ''), truncate: true }\n : { value: <GalleryFieldValue column={col} row={row} /> })\n }));\n\n const heroImageData = heroImage ? getImageData(meta, row) : undefined;\n\n let image: SelectionCardDisplayProps['image'] = heroImageData;\n\n if (!heroImage && tileConfig) {\n const foregroundColor =\n tileConfig.foregroundColor.field in rowData\n ? String(rowData[tileConfig.foregroundColor.field])\n : undefined;\n const backgroundColor =\n tileConfig.backgroundColor.field in rowData\n ? String(rowData[tileConfig.backgroundColor.field])\n : undefined;\n\n if (foregroundColor && backgroundColor) {\n const tileName =\n tileConfig.iconName && tileConfig.iconName.field in rowData\n ? String(rowData[tileConfig.iconName.field]) || undefined\n : undefined;\n const tileText =\n tileConfig.text && tileConfig.text.field in rowData\n ? String(rowData[tileConfig.text.field]) || undefined\n : undefined;\n\n const tileBase = {\n foregroundColor,\n backgroundColor\n };\n\n if (tileName) {\n image = { ...tileBase, icon: tileName };\n } else if (tileText) {\n image = { ...tileBase, text: tileText };\n }\n }\n }\n\n const footer = meta.galleryConfig?.renderCardFooter?.(rowData) ?? null;\n\n const label = <GalleryHeader headerColumn={headerColumn} row={row} />;\n\n const headerValue = row.getContext()?.getRowHeader()?.getValue();\n const ariaLabel = !isEmpty(headerValue) ? String(headerValue) : undefined;\n\n return { fields, image, footer, label, 'aria-label': ariaLabel };\n}\n\n/**\n * Extracts UI-related props from a row for card components.\n *\n * @param props - The properties containing the row.\n * @param props.row - The data row.\n * @returns An object containing card-safe row metadata.\n */\nexport function getCardUIProps({ row }: { row: RsCoreTypes.Row }) {\n const uiProps = row.getUIProps();\n return {\n 'data-key': uiProps['data-key']\n };\n}\n"]}
|
|
File without changes
|
|
File without changes
|