@pega/lists-react 10.0.0-build.1.9 → 10.0.0-build.10.1
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/AggregateMenu.d.ts.map +1 -1
- package/lib/Core/Components/AggregateMenu.js +2 -1
- package/lib/Core/Components/AggregateMenu.js.map +1 -1
- 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 +9 -0
- package/lib/Core/Components/Card/CardHeader.d.ts.map +1 -0
- package/lib/Core/{Views/Gallery/Components/GalleryHeader.js → Components/Card/CardHeader.js} +6 -5
- package/lib/Core/Components/Card/CardHeader.js.map +1 -0
- package/lib/Core/Components/Card/CardSubHeading.d.ts +10 -0
- package/lib/Core/Components/Card/CardSubHeading.d.ts.map +1 -0
- package/lib/Core/Components/Card/CardSubHeading.js +9 -0
- package/lib/Core/Components/Card/CardSubHeading.js.map +1 -0
- package/lib/Core/Components/Card/cardData.d.ts +48 -0
- package/lib/Core/Components/Card/cardData.d.ts.map +1 -0
- package/lib/Core/{Views/Gallery/utils.js → Components/Card/cardData.js} +55 -52
- package/lib/Core/Components/Card/cardData.js.map +1 -0
- package/lib/Core/Components/Card/index.d.ts +4 -0
- package/lib/Core/Components/Card/index.d.ts.map +1 -0
- package/lib/Core/Components/Card/index.js +4 -0
- package/lib/Core/Components/Card/index.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js +6 -53
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.js +12 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowSelectHandle.js +9 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowSelectHandle.js.map +1 -1
- 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/PersonalizationCreateEdit.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js +5 -4
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.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/DynamicFieldConfiguration.d.ts +3 -1
- package/lib/Core/Components/DynamicFieldConfiguration.d.ts.map +1 -1
- package/lib/Core/Components/DynamicFieldConfiguration.js +7 -4
- package/lib/Core/Components/DynamicFieldConfiguration.js.map +1 -1
- package/lib/Core/Components/Filters/AdvanceFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/AdvanceFilter.js +5 -5
- package/lib/Core/Components/Filters/AdvanceFilter.js.map +1 -1
- package/lib/Core/Components/Filters/BooleanFilter.js +2 -2
- package/lib/Core/Components/Filters/BooleanFilter.js.map +1 -1
- package/lib/Core/Components/Filters/CommonFilter.js +1 -1
- package/lib/Core/Components/Filters/CommonFilter.js.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.js +24 -5
- package/lib/Core/Components/Filters/SelectFilter.js.map +1 -1
- package/lib/Core/Components/Filters/SimpleFilter.js +2 -3
- package/lib/Core/Components/Filters/SimpleFilter.js.map +1 -1
- package/lib/Core/Components/GroupRenderer/index.d.ts.map +1 -1
- package/lib/Core/Components/GroupRenderer/index.js +7 -2
- package/lib/Core/Components/GroupRenderer/index.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.js +2 -3
- package/lib/Core/Components/HeaderMenu/index.js.map +1 -1
- package/lib/Core/Components/NotificationManager.js +1 -1
- package/lib/Core/Components/NotificationManager.js.map +1 -1
- package/lib/Core/Components/RFColumnConfigurator.d.ts +1 -1
- package/lib/Core/Components/RFColumnConfigurator.d.ts.map +1 -1
- package/lib/Core/Components/RFColumnConfigurator.js +9 -6
- package/lib/Core/Components/RFColumnConfigurator.js.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/Components/RenderingEngine/ComponentResolverFactory.d.ts +1 -0
- package/lib/Core/Components/RenderingEngine/ComponentResolverFactory.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/ComponentResolverFactory.js +6 -1
- package/lib/Core/Components/RenderingEngine/ComponentResolverFactory.js.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js +13 -4
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.js +13 -3
- package/lib/Core/Components/Toolbar/ColumnSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.js +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/Map/MapToolbar.d.ts +2 -2
- package/lib/Core/Components/Toolbar/Map/MapToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/Map/MapToolbar.js +17 -18
- package/lib/Core/Components/Toolbar/Map/MapToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/RefreshBanner.d.ts +5 -1
- package/lib/Core/Components/Toolbar/RefreshBanner.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/RefreshBanner.js +22 -6
- package/lib/Core/Components/Toolbar/RefreshBanner.js.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +2 -2
- package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.js +1 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.js +23 -5
- package/lib/Core/Components/Toolbar/hooks/useMore.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts +1 -0
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js +4 -2
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.d.ts +3 -3
- package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.js +16 -10
- package/lib/Core/Components/Toolbar/utils/utils.js.map +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js +2 -2
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js.map +1 -1
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +6 -4
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
- package/lib/Core/Components/Virtualise/index.js +7 -5
- package/lib/Core/Components/Virtualise/index.js.map +1 -1
- package/lib/Core/Utils/fetchRowActions.d.ts +16 -0
- package/lib/Core/Utils/fetchRowActions.d.ts.map +1 -0
- package/lib/Core/Utils/fetchRowActions.js +60 -0
- package/lib/Core/Utils/fetchRowActions.js.map +1 -0
- package/lib/Core/Utils/styles.d.ts +9 -0
- package/lib/Core/Utils/styles.d.ts.map +1 -1
- package/lib/Core/Utils/styles.js +8 -3
- package/lib/Core/Utils/styles.js.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.js +13 -9
- 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 +8 -5
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js.map +1 -1
- package/lib/Core/Views/Gallery/Gallery.types.d.ts +1 -0
- package/lib/Core/Views/Gallery/Gallery.types.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Gallery.types.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 +1 -1
- package/lib/Core/Views/Gallery/index.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/index.js +6 -9
- package/lib/Core/Views/Gallery/index.js.map +1 -1
- package/lib/Core/Views/Kanban/Kanban.styles.d.ts +16 -0
- package/lib/Core/Views/Kanban/Kanban.styles.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/Kanban.styles.js +58 -0
- package/lib/Core/Views/Kanban/Kanban.styles.js.map +1 -0
- package/lib/Core/Views/Kanban/Kanban.types.d.ts +10 -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 +7 -0
- package/lib/Core/Views/Kanban/KanbanCard.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanCard.js +23 -0
- package/lib/Core/Views/Kanban/KanbanCard.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLane.d.ts +23 -0
- package/lib/Core/Views/Kanban/KanbanLane.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLane.js +21 -0
- package/lib/Core/Views/Kanban/KanbanLane.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.d.ts +12 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.js +16 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLaneVirtualizer.d.ts +20 -0
- package/lib/Core/Views/Kanban/KanbanLaneVirtualizer.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLaneVirtualizer.js +37 -0
- package/lib/Core/Views/Kanban/KanbanLaneVirtualizer.js.map +1 -0
- package/lib/Core/Views/Kanban/hooks/useKanbanLanesVirtualization.d.ts +19 -0
- package/lib/Core/Views/Kanban/hooks/useKanbanLanesVirtualization.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/hooks/useKanbanLanesVirtualization.js +32 -0
- package/lib/Core/Views/Kanban/hooks/useKanbanLanesVirtualization.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/Views/Table/CellWrapper.d.ts +3 -1
- package/lib/Core/Views/Table/CellWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/CellWrapper.js +4 -3
- package/lib/Core/Views/Table/CellWrapper.js.map +1 -1
- package/lib/Core/Views/Table/Row.d.ts.map +1 -1
- package/lib/Core/Views/Table/Row.js +22 -10
- package/lib/Core/Views/Table/Row.js.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.js +110 -32
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts +3 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.js +6 -5
- package/lib/Core/Views/Table/VirtualizeWrapper.js.map +1 -1
- package/lib/Core/Views/Table/index.d.ts.map +1 -1
- package/lib/Core/Views/Table/index.js +15 -6
- package/lib/Core/Views/Table/index.js.map +1 -1
- package/lib/Core/Views/Table/useMasterDetailCleanup.d.ts +11 -0
- package/lib/Core/Views/Table/useMasterDetailCleanup.d.ts.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailCleanup.js +27 -0
- package/lib/Core/Views/Table/useMasterDetailCleanup.js.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailHost.d.ts +14 -0
- package/lib/Core/Views/Table/useMasterDetailHost.d.ts.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailHost.js +56 -0
- package/lib/Core/Views/Table/useMasterDetailHost.js.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailRenderer.d.ts +13 -0
- package/lib/Core/Views/Table/useMasterDetailRenderer.d.ts.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailRenderer.js +23 -0
- package/lib/Core/Views/Table/useMasterDetailRenderer.js.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailRow.d.ts +9 -0
- package/lib/Core/Views/Table/useMasterDetailRow.d.ts.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailRow.js +55 -0
- package/lib/Core/Views/Table/useMasterDetailRow.js.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailState.d.ts +21 -0
- package/lib/Core/Views/Table/useMasterDetailState.d.ts.map +1 -0
- package/lib/Core/Views/Table/useMasterDetailState.js +33 -0
- package/lib/Core/Views/Table/useMasterDetailState.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.js +2 -2
- package/lib/Core/Views/Timeline/Timeline.js.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts +2 -2
- package/lib/Core/Views/Timeline/Timeline.types.d.ts +9 -10
- package/lib/Core/Views/Timeline/Timeline.types.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.types.js.map +1 -1
- package/lib/Core/Views/Timeline/TimelineGroup.d.ts +4 -10
- package/lib/Core/Views/Timeline/TimelineGroup.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/TimelineGroup.js +5 -6
- package/lib/Core/Views/Timeline/TimelineGroup.js.map +1 -1
- package/lib/Core/Views/Timeline/index.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/index.js +38 -10
- package/lib/Core/Views/Timeline/index.js.map +1 -1
- package/lib/Core/Views/Timeline/utils.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/utils.js +2 -1
- package/lib/Core/Views/Timeline/utils.js.map +1 -1
- package/lib/Core/constants.d.ts +4 -0
- package/lib/Core/constants.d.ts.map +1 -1
- package/lib/Core/constants.js +4 -0
- package/lib/Core/constants.js.map +1 -1
- package/lib/Core/templateFeatureSupport.js +2 -2
- package/lib/Core/templateFeatureSupport.js.map +1 -1
- package/package.json +9 -8
- package/lib/Core/Hooks/a11y/useAnnounceGroup.d.ts +0 -11
- package/lib/Core/Hooks/a11y/useAnnounceGroup.d.ts.map +0 -1
- package/lib/Core/Hooks/a11y/useAnnounceGroup.js +0 -52
- package/lib/Core/Hooks/a11y/useAnnounceGroup.js.map +0 -1
- 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 +0 -9
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/hooks/useRowActions.js +0 -25
- package/lib/Core/Views/Gallery/hooks/useRowActions.js.map +0 -1
- package/lib/Core/Views/Gallery/utils.d.ts +0 -36
- package/lib/Core/Views/Gallery/utils.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/utils.js.map +0 -1
|
@@ -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;AAWlE,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,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAC1C,UAAU,EAAE,SAAS,CAAC;IACtB,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,oBAAoB;IAC5B,UAAU,EAAE,SAAS,CAAC;CACvB;AAED,iBAAS,UAAU,CAAC,EAClB,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,MAAM,EACP,EAAE,eAAe,2CAmCjB;kBA5CQ,UAAU;;;AAgDnB,eAAO,MAAM,eAAe,GAAI,gBAAgB,oBAAoB,4CAoBnE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Count, Flex, Grid } from '@pega/cosmos-react-core';
|
|
3
|
+
import KanbanLaneHeader from './KanbanLaneHeader';
|
|
4
|
+
import KanbanLaneVirtualizer from './KanbanLaneVirtualizer';
|
|
5
|
+
import { StyledEmptyKanbanCards, StyledKanbanCards, StyledKanbanLane, StyledKanbanLaneHeader } from './Kanban.styles';
|
|
6
|
+
function KanbanLane({ lane, laneColumn, meta, visibleColumns, headerColumn, subHeadingsColumns, emptyState, laneId }) {
|
|
7
|
+
const laneRows = lane.getRows?.() ?? [];
|
|
8
|
+
return (_jsxs(Flex, { as: StyledKanbanLane, "data-kanban-lane": true, 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 })] }), lane.count === 0 ? (_jsx(Flex, { as: StyledEmptyKanbanCards, container: { direction: 'column', gap: 1, pad: 1 }, children: emptyState })) : (_jsx(StyledKanbanCards, { children: _jsx(KanbanLaneVirtualizer, { laneId: laneId, rows: laneRows, meta: meta, visibleColumns: visibleColumns, headerColumn: headerColumn, subHeadingsColumns: subHeadingsColumns }) }))] }));
|
|
9
|
+
}
|
|
10
|
+
KanbanLane.displayName = 'KanbanLane';
|
|
11
|
+
export const EmptyKanbanLane = ({ emptyState }) => {
|
|
12
|
+
return (_jsxs(Flex, { as: StyledKanbanLane, role: 'listitem', container: { direction: 'column' }, children: [_jsx(Grid, { as: StyledKanbanLaneHeader, container: {
|
|
13
|
+
cols: 'minmax(0, 1fr) auto',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
gap: 0.5,
|
|
16
|
+
pad: 1,
|
|
17
|
+
justifyItems: 'end'
|
|
18
|
+
}, children: _jsx(Count, { children: 0 }) }), _jsx(Flex, { as: StyledEmptyKanbanCards, container: { direction: 'column', gap: 1, pad: 1 }, children: emptyState })] }));
|
|
19
|
+
};
|
|
20
|
+
export default KanbanLane;
|
|
21
|
+
//# 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,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AAkBzB,SAAS,UAAU,CAAC,EAClB,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,MAAM,EACU;IAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC;IAExC,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAE,gBAAgB,4BAEpB,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAElC,MAAC,IAAI,IACH,EAA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C,IAAI,IAAC,EAAE,EAAE,sBAAsB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,YACjF,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 KanbanLaneHeader from './KanbanLaneHeader';\nimport KanbanLaneVirtualizer from './KanbanLaneVirtualizer';\nimport {\n StyledEmptyKanbanCards,\n StyledKanbanCards,\n StyledKanbanLane,\n StyledKanbanLaneHeader\n} 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 subHeadingsColumns?: RsCoreTypes.Column[];\n emptyState: ReactNode;\n /** Stable identifier for the lane, used to scope the card virtualizer instance. */\n laneId: string;\n}\n\ninterface EmptyKanbanLaneProps {\n emptyState: ReactNode;\n}\n\nfunction KanbanLane({\n lane,\n laneColumn,\n meta,\n visibleColumns,\n headerColumn,\n subHeadingsColumns,\n emptyState,\n laneId\n}: KanbanLaneProps) {\n const laneRows = lane.getRows?.() ?? [];\n\n return (\n <Flex\n as={StyledKanbanLane}\n data-kanban-lane\n role='listitem'\n container={{ direction: 'column' }}\n >\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 {lane.count === 0 ? (\n <Flex as={StyledEmptyKanbanCards} container={{ direction: 'column', gap: 1, pad: 1 }}>\n {emptyState}\n </Flex>\n ) : (\n <StyledKanbanCards>\n <KanbanLaneVirtualizer\n laneId={laneId}\n rows={laneRows}\n meta={meta}\n visibleColumns={visibleColumns}\n headerColumn={headerColumn}\n subHeadingsColumns={subHeadingsColumns}\n />\n </StyledKanbanCards>\n )}\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={StyledEmptyKanbanCards} container={{ direction: 'column', gap: 1, pad: 1 }}>\n {emptyState}\n </Flex>\n </Flex>\n );\n};\n\nexport default KanbanLane;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
declare const _default: import("react").MemoExoticComponent<typeof KanbanLaneHeader>;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=KanbanLaneHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanLaneHeader.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanLaneHeader.tsx"],"names":[],"mappings":"AAEA,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,wBAAsC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import RenderingEngine from '../../Components/RenderingEngine/RenderCell';
|
|
4
|
+
function KanbanLaneHeader({ column, groupHeader }) {
|
|
5
|
+
if (!column || !groupHeader) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
column.setExecutionContext(null);
|
|
9
|
+
return (_jsx(RenderingEngine, { ...column.getRenderingEngineProps(), context: {
|
|
10
|
+
getValue: () => groupHeader.name,
|
|
11
|
+
getExecutionContext: () => ({ getValue: () => groupHeader.data, name: 'groupHeader' })
|
|
12
|
+
} }));
|
|
13
|
+
}
|
|
14
|
+
KanbanLaneHeader.displayName = 'KanbanLaneHeader';
|
|
15
|
+
export default memo(KanbanLaneHeader);
|
|
16
|
+
//# sourceMappingURL=KanbanLaneHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanLaneHeader.js","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanLaneHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAI7B,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,IAAI,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { memo } from 'react';\n\nimport 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 memo(KanbanLaneHeader);\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
interface KanbanLaneVirtualizerProps {
|
|
3
|
+
/** Stable identifier for the lane, used to scope the virtualizer instance. */
|
|
4
|
+
laneId: string;
|
|
5
|
+
/** All rows belonging to this lane (available client-side). */
|
|
6
|
+
rows: RsCoreTypes.Row[];
|
|
7
|
+
meta: RsCoreTypes.Meta;
|
|
8
|
+
visibleColumns: RsCoreTypes.Column[];
|
|
9
|
+
headerColumn?: RsCoreTypes.Column;
|
|
10
|
+
subHeadingsColumns?: RsCoreTypes.Column[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Client-side vertical virtualization for the cards within a single Kanban lane.
|
|
14
|
+
*/
|
|
15
|
+
declare function KanbanLaneVirtualizer({ laneId, rows, meta, visibleColumns, headerColumn, subHeadingsColumns }: KanbanLaneVirtualizerProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare namespace KanbanLaneVirtualizer {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
export default KanbanLaneVirtualizer;
|
|
20
|
+
//# sourceMappingURL=KanbanLaneVirtualizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanLaneVirtualizer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanLaneVirtualizer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAalE,UAAU,0BAA0B;IAClC,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,IAAI,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC;IACxB,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;CAC3C;AAED;;GAEG;AACH,iBAAS,qBAAqB,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,kBAAkB,EACnB,EAAE,0BAA0B,2CAoD5B;kBA3DQ,qBAAqB;;;AA+D9B,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import VariableHeightVirtualizer, {} from '../../Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer';
|
|
4
|
+
import KanbanCard from './KanbanCard';
|
|
5
|
+
/** Estimated card height (px) used before a card is measured by the virtualizer. */
|
|
6
|
+
const KANBAN_DEFAULT_CARD_HEIGHT = 600;
|
|
7
|
+
/** Extra cards rendered above and below the viewport for smooth scrolling. */
|
|
8
|
+
const KANBAN_CARD_BUFFER = 5;
|
|
9
|
+
/**
|
|
10
|
+
* Client-side vertical virtualization for the cards within a single Kanban lane.
|
|
11
|
+
*/
|
|
12
|
+
function KanbanLaneVirtualizer({ laneId, rows, meta, visibleColumns, headerColumn, subHeadingsColumns }) {
|
|
13
|
+
const totalItemCount = rows.length;
|
|
14
|
+
const [requestedRange, setRequestedRange] = useState({});
|
|
15
|
+
const [isFetching, setIsFetching] = useState(false);
|
|
16
|
+
const requestRange = useCallback(({ startIndex, endIndex }) => {
|
|
17
|
+
setRequestedRange({ startIndex, endIndex });
|
|
18
|
+
setIsFetching(true);
|
|
19
|
+
}, []);
|
|
20
|
+
// Hold the fetch gate for a single commit so the virtualizer settles the requested window
|
|
21
|
+
// before it can request the next one.
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (isFetching)
|
|
24
|
+
setIsFetching(false);
|
|
25
|
+
}, [isFetching]);
|
|
26
|
+
const visibleRows = useMemo(() => {
|
|
27
|
+
const { startIndex, endIndex } = requestedRange;
|
|
28
|
+
if (startIndex === undefined || endIndex === undefined)
|
|
29
|
+
return [];
|
|
30
|
+
return rows.slice(startIndex, endIndex + 1);
|
|
31
|
+
}, [rows, requestedRange]);
|
|
32
|
+
const paginationStartIndex = requestedRange.startIndex ?? 0;
|
|
33
|
+
return (_jsx(VariableHeightVirtualizer, { id: `kanbanLane:${laneId}`, totalItemCount: totalItemCount, loadedDataRange: requestedRange, isDataFetching: isFetching, apiCallback: requestRange, defaultItemHeight: KANBAN_DEFAULT_CARD_HEIGHT, buffer: KANBAN_CARD_BUFFER, itemContainerClass: 'kanban-lane-cards', children: visibleRows.map((row, index) => (_jsx(KanbanCard, { dataIndex: paginationStartIndex + index, meta: meta, row: row, visibleColumns: visibleColumns, headerColumn: headerColumn, subHeadingsColumns: subHeadingsColumns }, row.reactKey))) }));
|
|
34
|
+
}
|
|
35
|
+
KanbanLaneVirtualizer.displayName = 'KanbanLaneVirtualizer';
|
|
36
|
+
export default KanbanLaneVirtualizer;
|
|
37
|
+
//# sourceMappingURL=KanbanLaneVirtualizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KanbanLaneVirtualizer.js","sourceRoot":"","sources":["../../../../Core/Views/Kanban/KanbanLaneVirtualizer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIlE,OAAO,yBAAyB,EAAE,EAEjC,MAAM,iFAAiF,CAAC;AAEzF,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,oFAAoF;AACpF,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,8EAA8E;AAC9E,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAa7B;;GAEG;AACH,SAAS,qBAAqB,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,kBAAkB,EACS;IAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;IAEnC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAkB,EAAE,CAAC,CAAC;IAC1E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAwD,EAAE,EAAE;QACjF,iBAAiB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5C,aAAa,CAAC,IAAI,CAAC,CAAC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Ae,qBAAqB,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport VariableHeightVirtualizer, {\n type LoadedDataRange\n} from '../../Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer';\n\nimport KanbanCard from './KanbanCard';\n\n/** Estimated card height (px) used before a card is measured by the virtualizer. */\nconst KANBAN_DEFAULT_CARD_HEIGHT = 600;\n/** Extra cards rendered above and below the viewport for smooth scrolling. */\nconst KANBAN_CARD_BUFFER = 5;\n\ninterface KanbanLaneVirtualizerProps {\n /** Stable identifier for the lane, used to scope the virtualizer instance. */\n laneId: string;\n /** All rows belonging to this lane (available client-side). */\n rows: RsCoreTypes.Row[];\n meta: RsCoreTypes.Meta;\n visibleColumns: RsCoreTypes.Column[];\n headerColumn?: RsCoreTypes.Column;\n subHeadingsColumns?: RsCoreTypes.Column[];\n}\n\n/**\n * Client-side vertical virtualization for the cards within a single Kanban lane.\n */\nfunction KanbanLaneVirtualizer({\n laneId,\n rows,\n meta,\n visibleColumns,\n headerColumn,\n subHeadingsColumns\n}: KanbanLaneVirtualizerProps) {\n const totalItemCount = rows.length;\n\n const [requestedRange, setRequestedRange] = useState<LoadedDataRange>({});\n const [isFetching, setIsFetching] = useState(false);\n\n const requestRange = useCallback(\n ({ startIndex, endIndex }: { startIndex: number; endIndex: number; id: string }) => {\n setRequestedRange({ startIndex, endIndex });\n setIsFetching(true);\n },\n []\n );\n\n // Hold the fetch gate for a single commit so the virtualizer settles the requested window\n // before it can request the next one.\n useEffect(() => {\n if (isFetching) setIsFetching(false);\n }, [isFetching]);\n\n const visibleRows = useMemo(() => {\n const { startIndex, endIndex } = requestedRange;\n if (startIndex === undefined || endIndex === undefined) return [];\n return rows.slice(startIndex, endIndex + 1);\n }, [rows, requestedRange]);\n\n const paginationStartIndex = requestedRange.startIndex ?? 0;\n\n return (\n <VariableHeightVirtualizer\n id={`kanbanLane:${laneId}`}\n totalItemCount={totalItemCount}\n loadedDataRange={requestedRange}\n isDataFetching={isFetching}\n apiCallback={requestRange}\n defaultItemHeight={KANBAN_DEFAULT_CARD_HEIGHT}\n buffer={KANBAN_CARD_BUFFER}\n itemContainerClass='kanban-lane-cards'\n >\n {visibleRows.map((row, index) => (\n <KanbanCard\n key={row.reactKey}\n dataIndex={paginationStartIndex + index}\n meta={meta}\n row={row}\n visibleColumns={visibleColumns}\n headerColumn={headerColumn}\n subHeadingsColumns={subHeadingsColumns}\n />\n ))}\n </VariableHeightVirtualizer>\n );\n}\n\nKanbanLaneVirtualizer.displayName = 'KanbanLaneVirtualizer';\n\nexport default KanbanLaneVirtualizer;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
interface UseKanbanLanesVirtualizationOptions {
|
|
3
|
+
groupKey?: string;
|
|
4
|
+
lanes: RsCoreTypes.GroupGenerator[];
|
|
5
|
+
}
|
|
6
|
+
interface KanbanLanesVirtualization {
|
|
7
|
+
boardRef: React.RefObject<HTMLDivElement>;
|
|
8
|
+
visibleLanes: RsCoreTypes.GroupGenerator[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Progressively mounts right-side Kanban lanes while retaining already mounted lanes and their
|
|
12
|
+
* vertical scroll positions. Resets the lane window for a new grouping or refreshed lane catalog.
|
|
13
|
+
*
|
|
14
|
+
* @param groupKey - Active lane grouping identifier.
|
|
15
|
+
* @param lanes - Lanes available for the active grouping.
|
|
16
|
+
*/
|
|
17
|
+
export default function useKanbanLanesVirtualization({ groupKey, lanes }: UseKanbanLanesVirtualizationOptions): KanbanLanesVirtualization;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=useKanbanLanesVirtualization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKanbanLanesVirtualization.d.ts","sourceRoot":"","sources":["../../../../../Core/Views/Kanban/hooks/useKanbanLanesVirtualization.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AASlE,UAAU,mCAAmC;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC;CACrC;AAED,UAAU,yBAAyB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,YAAY,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,QAAQ,EACR,KAAK,EACN,EAAE,mCAAmC,GAAG,yBAAyB,CA4BjE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useItemIntersection } from '@pega/cosmos-react-core';
|
|
3
|
+
// Lanes mounted when a board or lane grouping is first displayed.
|
|
4
|
+
const INITIAL_LANE_COUNT = 3;
|
|
5
|
+
// Additional right-side lanes mounted when the current final lane enters the scrollport.
|
|
6
|
+
const APPEND_LANE_COUNT = 2;
|
|
7
|
+
// Minimum lanes to display so the intersection observer can always fire to trigger further loading.
|
|
8
|
+
const MINIMUM_OBSERVED_LANE_COUNT = 2;
|
|
9
|
+
/**
|
|
10
|
+
* Progressively mounts right-side Kanban lanes while retaining already mounted lanes and their
|
|
11
|
+
* vertical scroll positions. Resets the lane window for a new grouping or refreshed lane catalog.
|
|
12
|
+
*
|
|
13
|
+
* @param groupKey - Active lane grouping identifier.
|
|
14
|
+
* @param lanes - Lanes available for the active grouping.
|
|
15
|
+
*/
|
|
16
|
+
export default function useKanbanLanesVirtualization({ groupKey, lanes }) {
|
|
17
|
+
const boardRef = useRef(null);
|
|
18
|
+
const totalLaneCount = lanes.length;
|
|
19
|
+
const [mountedLaneCount, setMountedLaneCount] = useState(INITIAL_LANE_COUNT);
|
|
20
|
+
const clampLaneCount = useCallback((count) => Math.max(Math.min(count, totalLaneCount), Math.min(MINIMUM_OBSERVED_LANE_COUNT, totalLaneCount)), [totalLaneCount]);
|
|
21
|
+
// A new grouping or lane catalog starts with the initial lane window.
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
setMountedLaneCount(INITIAL_LANE_COUNT);
|
|
24
|
+
}, [groupKey, totalLaneCount]);
|
|
25
|
+
const appendLanes = useCallback(() => {
|
|
26
|
+
// Keep prior lanes mounted so their independent vertical scroll positions are retained.
|
|
27
|
+
setMountedLaneCount(prev => clampLaneCount(prev + APPEND_LANE_COUNT));
|
|
28
|
+
}, [clampLaneCount]);
|
|
29
|
+
useItemIntersection(boardRef, mountedLaneCount - 1, appendLanes, ':scope > [data-kanban-lane]');
|
|
30
|
+
return { boardRef, visibleLanes: lanes.slice(0, mountedLaneCount) };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=useKanbanLanesVirtualization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKanbanLanesVirtualization.js","sourceRoot":"","sources":["../../../../../Core/Views/Kanban/hooks/useKanbanLanesVirtualization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,kEAAkE;AAClE,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,yFAAyF;AACzF,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,oGAAoG;AACpG,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAYtC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,QAAQ,EACR,KAAK,EAC+B;IACpC,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE9C,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC;IACpC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAE7E,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,KAAa,EAAU,EAAE,CACxB,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,EAC/B,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,cAAc,CAAC,CACtD,EACH,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,sEAAsE;IACtE,SAAS,CAAC,GAAG,EAAE;QACb,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;IAC1C,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;IAE/B,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,wFAAwF;QACxF,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,GAAG,iBAAiB,CAAC,CAAC,CAAC;IACxE,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,CAAC,EAAE,WAAW,EAAE,6BAA6B,CAAC,CAAC;IAEhG,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,EAAE,CAAC;AACtE,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { useItemIntersection } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\n// Lanes mounted when a board or lane grouping is first displayed.\nconst INITIAL_LANE_COUNT = 3;\n// Additional right-side lanes mounted when the current final lane enters the scrollport.\nconst APPEND_LANE_COUNT = 2;\n// Minimum lanes to display so the intersection observer can always fire to trigger further loading.\nconst MINIMUM_OBSERVED_LANE_COUNT = 2;\n\ninterface UseKanbanLanesVirtualizationOptions {\n groupKey?: string;\n lanes: RsCoreTypes.GroupGenerator[];\n}\n\ninterface KanbanLanesVirtualization {\n boardRef: React.RefObject<HTMLDivElement>;\n visibleLanes: RsCoreTypes.GroupGenerator[];\n}\n\n/**\n * Progressively mounts right-side Kanban lanes while retaining already mounted lanes and their\n * vertical scroll positions. Resets the lane window for a new grouping or refreshed lane catalog.\n *\n * @param groupKey - Active lane grouping identifier.\n * @param lanes - Lanes available for the active grouping.\n */\nexport default function useKanbanLanesVirtualization({\n groupKey,\n lanes\n}: UseKanbanLanesVirtualizationOptions): KanbanLanesVirtualization {\n const boardRef = useRef<HTMLDivElement>(null);\n\n const totalLaneCount = lanes.length;\n const [mountedLaneCount, setMountedLaneCount] = useState(INITIAL_LANE_COUNT);\n\n const clampLaneCount = useCallback(\n (count: number): number =>\n Math.max(\n Math.min(count, totalLaneCount),\n Math.min(MINIMUM_OBSERVED_LANE_COUNT, totalLaneCount)\n ),\n [totalLaneCount]\n );\n\n // A new grouping or lane catalog starts with the initial lane window.\n useEffect(() => {\n setMountedLaneCount(INITIAL_LANE_COUNT);\n }, [groupKey, totalLaneCount]);\n\n const appendLanes = useCallback(() => {\n // Keep prior lanes mounted so their independent vertical scroll positions are retained.\n setMountedLaneCount(prev => clampLaneCount(prev + APPEND_LANE_COUNT));\n }, [clampLaneCount]);\n\n useItemIntersection(boardRef, mountedLaneCount - 1, appendLanes, ':scope > [data-kanban-lane]');\n\n return { boardRef, visibleLanes: lanes.slice(0, mountedLaneCount) };\n}\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,EAAe,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAwB/E,iBAAS,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAA;CAAE,2CA8FnD;kBA9FQ,MAAM;;;AAkGf,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 { 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 { getCardColumns } from '../../Components/Card';
|
|
15
|
+
import KanbanLane, { EmptyKanbanLane } from './KanbanLane';
|
|
16
|
+
import { StyledKanbanBoard, StyledKanbanContainer } from './Kanban.styles';
|
|
17
|
+
import useKanbanLanesVirtualization from './hooks/useKanbanLanesVirtualization';
|
|
18
|
+
function getLaneId(laneColumn, value) {
|
|
19
|
+
return `${laneColumn?.field.id ?? ''}:${isInstance(value, Date) ? value.toISOString() : String(value)}`;
|
|
20
|
+
}
|
|
21
|
+
function Kanban({ view }) {
|
|
22
|
+
const { columns = [], groupHeaders = [], meta, rows } = view;
|
|
23
|
+
const { filterExpression, searchText, externalState, groups } = view.state ?? {};
|
|
24
|
+
const isFullscreen = !!useFullscreenContext()?.[0];
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
const [translate] = useTranslate();
|
|
27
|
+
// Lane configuration
|
|
28
|
+
const firstGroupHeader = groupHeaders[0];
|
|
29
|
+
const laneGroup = groups?.[0];
|
|
30
|
+
const laneColumn = useMemo(() => columns.find(column => String(column.field.id) === String(laneGroup?.columnId)), [columns, laneGroup]);
|
|
31
|
+
const hasLaneConfiguration = !!(laneColumn && laneGroup);
|
|
32
|
+
// RsCore returns empty groupHeader with groupBy = '' and count = 0 when there are no records to display.
|
|
33
|
+
const isEmptyLane = groupHeaders.length === 1 && firstGroupHeader?.groupBy === '' && firstGroupHeader.count === 0;
|
|
34
|
+
const shouldRenderEmptyLane = !!laneGroup && isEmptyLane;
|
|
35
|
+
// With instantRender from RSCore, state can contain the new groupBy while groupHeaders still reflect the previous grouping.
|
|
36
|
+
const laneGroupKey = laneGroup ? getGroupKey(laneGroup) : undefined;
|
|
37
|
+
const hasStaleLanes = !!firstGroupHeader?.groupBy && firstGroupHeader.groupBy !== laneGroupKey;
|
|
38
|
+
const lanes = hasLaneConfiguration && !hasStaleLanes ? groupHeaders : [];
|
|
39
|
+
const laneSourceKey = laneGroup ? `${laneGroupKey}:${laneGroup.order}` : undefined;
|
|
40
|
+
// Lanes virtualization
|
|
41
|
+
const { boardRef, visibleLanes } = useKanbanLanesVirtualization({
|
|
42
|
+
groupKey: laneSourceKey,
|
|
43
|
+
lanes
|
|
44
|
+
});
|
|
45
|
+
// Empty state configuration
|
|
46
|
+
const previousTotalItemCount = usePrevious(view.totalItemCount);
|
|
47
|
+
const emptyMessage = isFilterApplied({ filterExpression, searchText, externalState }, meta.externalFilters)
|
|
48
|
+
? translate('No records found')
|
|
49
|
+
: translate('No records');
|
|
50
|
+
const shouldAnnounceEmpty = (previousTotalItemCount ?? 0) > 0 && view.totalItemCount === 0;
|
|
51
|
+
const emptyState = (_jsx(EmptyContainer, { message: emptyMessage, shouldAnnounce: shouldAnnounceEmpty, domContainer: view.getDomContainer(), transparent: true }));
|
|
52
|
+
const { visibleColumns, headerColumn, subHeadingsColumns } = useMemo(() => getCardColumns(columns, meta.cardConfig ?? {}), [columns, meta.cardConfig]);
|
|
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, ref: boardRef, 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
|
+
visibleLanes.map(lane => (_jsx(KanbanLane, { laneId: getLaneId(laneColumn, lane.name), lane: lane, laneColumn: laneColumn, meta: meta, visibleColumns: visibleColumns, headerColumn: headerColumn, subHeadingsColumns: subHeadingsColumns, 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,oB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IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,GAAI,EAClD,MAAC,IAAI,IACH,EAAE,EAAE,iBAAiB,EACrB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,MAAM,gBACC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,EACnC,SAAS,EAAE;wBACT,QAAQ,EAAE,QAAQ;wBAClB,QAAQ,EAAE,cAAc,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,eAAe;wBACrE,GAAG,EAAE,GAAG;wBACR,GAAG,EAAE,GAAG;qBACT,aAEA,CAAC,qBAAqB;4BACrB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACvB,KAAC,UAAU,IAET,MAAM,EAAE,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,EACxC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,UAAU,EAAE,UAAU,IARjB,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CASrC,CACH,CAAC,EACH,qBAAqB,IAAI,KAAC,eAAe,IAAC,UAAU,EAAE,UAAU,GAAI,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 { 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';\nimport { getCardColumns } from '../../Components/Card';\n\nimport KanbanLane, { EmptyKanbanLane } from './KanbanLane';\nimport { StyledKanbanBoard, StyledKanbanContainer } from './Kanban.styles';\nimport useKanbanLanesVirtualization from './hooks/useKanbanLanesVirtualization';\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 const laneSourceKey = laneGroup ? `${laneGroupKey}:${laneGroup.order}` : undefined;\n\n // Lanes virtualization\n const { boardRef, visibleLanes } = useKanbanLanesVirtualization({\n groupKey: laneSourceKey,\n lanes\n });\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, headerColumn, subHeadingsColumns } = useMemo(\n () => getCardColumns(columns, meta.cardConfig ?? {}),\n [columns, meta.cardConfig]\n );\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 ref={boardRef}\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 visibleLanes.map(lane => (\n <KanbanLane\n key={getLaneId(laneColumn, lane.name)}\n laneId={getLaneId(laneColumn, lane.name)}\n lane={lane}\n laneColumn={laneColumn}\n meta={meta}\n visibleColumns={visibleColumns}\n headerColumn={headerColumn}\n subHeadingsColumns={subHeadingsColumns}\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"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export const CellIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@pega/cosmos-react-core").IconProps & import("styled-components/dist/types").BaseObject, import("styled-components/dist/types").BaseObject>> & string & Omit<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, keyof import("react").Component<any, {}, any>>;
|
|
2
2
|
declare const _default: import("react").MemoExoticComponent<typeof CellWrapper>;
|
|
3
3
|
export default _default;
|
|
4
|
-
declare function CellWrapper({ column, level }: {
|
|
4
|
+
declare function CellWrapper({ column, level, onMasterDetailKeyDown }: {
|
|
5
5
|
column: any;
|
|
6
6
|
level?: number | undefined;
|
|
7
|
+
onMasterDetailKeyDown: any;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
declare namespace CellWrapper {
|
|
9
10
|
namespace propTypes {
|
|
@@ -11,6 +12,7 @@ declare namespace CellWrapper {
|
|
|
11
12
|
[x: string]: any;
|
|
12
13
|
}>;
|
|
13
14
|
let level: PropTypes.Requireable<number>;
|
|
15
|
+
let onMasterDetailKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
import PropTypes from 'prop-types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellWrapper.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/CellWrapper.jsx"],"names":[],"mappings":"AAyCA,wbAkBG;;;AAEH
|
|
1
|
+
{"version":3,"file":"CellWrapper.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/CellWrapper.jsx"],"names":[],"mappings":"AAyCA,wbAkBG;;;AAEH;;;;4CA0DC;;;;;;;;;;sBAvHqB,YAAY"}
|
|
@@ -48,7 +48,7 @@ export const CellIcon = styled(Icon)(({ cellAlign }) => {
|
|
|
48
48
|
}
|
|
49
49
|
`;
|
|
50
50
|
});
|
|
51
|
-
function CellWrapper({ column, level = 0 }) {
|
|
51
|
+
function CellWrapper({ column, level = 0, onMasterDetailKeyDown }) {
|
|
52
52
|
const ref = useRef();
|
|
53
53
|
const { field: { cellAlign, type: fieldType }, isCustomColumn, isLastColumn, isFirstVisualColumn, getCellStyleFormat } = column;
|
|
54
54
|
const { classList, style: cellStyle, ...restProps } = column.getUIProps();
|
|
@@ -66,11 +66,12 @@ function CellWrapper({ column, level = 0 }) {
|
|
|
66
66
|
'cell-first': isFirstVisualColumn,
|
|
67
67
|
'cell-last-frozen': column.lastFrozen,
|
|
68
68
|
'column-type-action': fieldType === FieldType.ACTION_FIELD_TYPE
|
|
69
|
-
}, !isCustomColumn && cellAlign && CELL_ALIGN_CLASSES[cellAlign]), style: cellStyles, ref: ref, tabIndex: -1, "data-style-format": styleFormatId, children: [_jsx(RenderingEngine, { style: renderingEngineStyles, highlighter: true, ...column.getRenderingEngineProps(), context: context }), cellIconProps && _jsx(CellIcon, { ...cellIconProps, cellAlign: cellAlign, set: 'budicon' }), styleFormatId && (_jsx(VisuallyHiddenText, { id: styleFormatId, children: `,${translate('state')}: ${styleFormatLabel},` }))] }));
|
|
69
|
+
}, !isCustomColumn && cellAlign && CELL_ALIGN_CLASSES[cellAlign]), style: cellStyles, ref: ref, tabIndex: -1, onKeyDownCapture: onMasterDetailKeyDown, "data-style-format": styleFormatId, children: [_jsx(RenderingEngine, { style: renderingEngineStyles, highlighter: true, ...column.getRenderingEngineProps(), context: context }), cellIconProps && _jsx(CellIcon, { ...cellIconProps, cellAlign: cellAlign, set: 'budicon' }), styleFormatId && (_jsx(VisuallyHiddenText, { id: styleFormatId, children: `,${translate('state')}: ${styleFormatLabel},` }))] }));
|
|
70
70
|
}
|
|
71
71
|
CellWrapper.propTypes = {
|
|
72
72
|
column: PropTypes.objectOf(PropTypes.any),
|
|
73
|
-
level: PropTypes.number
|
|
73
|
+
level: PropTypes.number,
|
|
74
|
+
onMasterDetailKeyDown: PropTypes.func
|
|
74
75
|
};
|
|
75
76
|
export default memo(CellWrapper);
|
|
76
77
|
//# sourceMappingURL=CellWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellWrapper.js","sourceRoot":"","sources":["../../../../Core/Views/Table/CellWrapper.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,eAAe,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,uCAAuC,EAAE,MAAM,4CAA4C,CAAC;AACrG,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE;IACrD,MAAM,EACJ,iBAAiB,EACjB,MAAM,EACN,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAC7B,GAAG,MAAM,CAAC;IACX,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,iBAAiB,CAAC;IAEpF,MAAM,UAAU,GAAG;QACjB,IAAI,EAAE,kBAAkB,MAAM,GAAG;QACjC,KAAK,EAAE,mBAAmB,MAAM,GAAG;QACnC,KAAK,EAAE,mBAAmB,MAAM,GAAG;QACnC,GAAG,CAAC,eAAe,IAAI,EAAE,eAAe,EAAE,CAAC;QAC3C,GAAG,CAAC,iBAAiB,IAAI,MAAM,EAAE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ef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { FieldType } from 'pega-repeating-structures-core';\nimport { Icon, VisuallyHiddenText } from '@pega/cosmos-react-core';\n\nimport { createClassName as cx } from '../../Utils';\nimport RenderingEngine from '../../Components/RenderingEngine/RenderCell';\nimport { CELL_ALIGN_CLASSES } from '../../constants';\nimport { hierarchicalgroupheaderleftdisplacement } from '../../Components/HierarchicalGroupRenderer';\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst getStyles = (column, level, styleFormatConfig) => {\n const {\n isFirstDataColumn,\n parent,\n field: { idHash, cellAlign }\n } = column;\n const { backgroundColor, icon: cellIconProps, foregroundColor } = styleFormatConfig;\n\n const cellStyles = {\n left: `var(--col-left-${idHash})`,\n order: `var(--col-order-${idHash})`,\n width: `var(--col-width-${idHash})`,\n ...(backgroundColor && { backgroundColor }),\n ...(isFirstDataColumn && parent?.hierarchicalGroupEnabled && { paddingLeft: 0 })\n };\n\n const renderingEngineStyles = {\n ...(isFirstDataColumn &&\n parent?.hierarchicalGroupEnabled && {\n paddingLeft: hierarchicalgroupheaderleftdisplacement(level)\n }),\n ...(cellIconProps && { order: cellAlign === 'right' ? 2 : 1 }),\n ...(foregroundColor && { color: foregroundColor })\n };\n\n return { cellStyles, renderingEngineStyles };\n};\n\nexport const CellIcon = styled(Icon)(({ cellAlign }) => {\n // icon size 12px\n return css`\n /*\n * Icon styles sometimes fail to override correctly. Increasing specificity ensures consistent override behavior.\n * https://styled-components.com/docs/faqs#how-can-i-override-styles-with-higher-specificity\n */\n &&& {\n height: 0.75rem;\n width: 0.75rem;\n min-width: 0.75rem;\n min-height: 0.75rem;\n margin-inline-end: ${cellAlign !== 'right' && '0.5rem'};\n margin-inline-start: ${cellAlign === 'right' && '0.5rem'};\n order: ${cellAlign === 'right' ? 1 : 2};\n flex-shrink: 0;\n }\n `;\n});\n\nfunction CellWrapper({ column, level = 0, onMasterDetailKeyDown }) {\n const ref = useRef();\n const {\n field: { cellAlign, type: fieldType },\n isCustomColumn,\n isLastColumn,\n isFirstVisualColumn,\n getCellStyleFormat\n } = column;\n const { classList, style: cellStyle, ...restProps } = column.getUIProps();\n const {\n config: styleFormatConfig = {},\n label: styleFormatLabel,\n id: styleFormatId\n } = getCellStyleFormat() ?? {};\n const { foregroundColor, icon: cellIconProps } = styleFormatConfig;\n const context = {\n getElement: () => ref.current,\n getStyles: useCallback(() => ({ foregroundColor }), [foregroundColor])\n };\n const { cellStyles, renderingEngineStyles } = getStyles(column, level, styleFormatConfig);\n const [translate] = useTranslate();\n\n return (\n <div\n {...restProps}\n className={cx(\n 'cell',\n ...classList,\n {\n 'cell-fixed': column.frozen,\n 'cell-last': isLastColumn,\n 'cell-first': isFirstVisualColumn,\n 'cell-last-frozen': column.lastFrozen,\n 'column-type-action': fieldType === FieldType.ACTION_FIELD_TYPE\n },\n !isCustomColumn && cellAlign && CELL_ALIGN_CLASSES[cellAlign]\n )}\n style={cellStyles}\n ref={ref}\n tabIndex={-1}\n onKeyDownCapture={onMasterDetailKeyDown}\n data-style-format={styleFormatId}\n >\n <RenderingEngine\n style={renderingEngineStyles}\n highlighter\n {...column.getRenderingEngineProps()}\n context={context}\n />\n {cellIconProps && <CellIcon {...cellIconProps} cellAlign={cellAlign} set='budicon' />}\n {styleFormatId && (\n <VisuallyHiddenText\n id={styleFormatId}\n >{`,${translate('state')}: ${styleFormatLabel},`}</VisuallyHiddenText>\n )}\n </div>\n );\n}\n\nCellWrapper.propTypes = {\n column: PropTypes.objectOf(PropTypes.any),\n level: PropTypes.number,\n onMasterDetailKeyDown: PropTypes.func\n};\n\nexport default memo(CellWrapper);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/Row.jsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/Row.jsx"],"names":[],"mappings":";;AAYA;;;;;4CAoCC;;;;;;;;;;;sBAhDqB,YAAY"}
|
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { memo } from 'react';
|
|
4
|
+
import { createClassName as cx } from '../../Utils';
|
|
5
|
+
import { MASTER_DETAIL_INDICATOR_CLASS, MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS } from '../../constants';
|
|
4
6
|
import CellWrapper from './CellWrapper';
|
|
7
|
+
import useMasterDetailRow from './useMasterDetailRow';
|
|
5
8
|
function Row({ row, columns, level = 0, dataIndex }) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
9
|
+
const rowUiProps = row.getUIProps();
|
|
10
|
+
const { isMasterDetailEnabled, onRowClick, onCellKeyDownCapture, rowElementRef } = useMasterDetailRow(row);
|
|
11
|
+
const isPreviewHighlighted = !!row.masterDetailActive;
|
|
12
|
+
const uiProps = {
|
|
13
|
+
...rowUiProps,
|
|
14
|
+
...(dataIndex >= 0 ? { 'data-index': dataIndex } : {}),
|
|
15
|
+
className: cx(rowUiProps.className, {
|
|
16
|
+
[MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS]: isPreviewHighlighted
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
return (_jsxs("div", { ...uiProps, ref: rowElementRef, onClick: isMasterDetailEnabled ? onRowClick : undefined, children: [[...columns]
|
|
20
|
+
.sort((colA, colB) => colA.order - colB.order)
|
|
21
|
+
.map(column => {
|
|
22
|
+
column.setExecutionContext(row);
|
|
23
|
+
if (column.hidden)
|
|
24
|
+
return null;
|
|
25
|
+
return (_jsx(CellWrapper, { row: row, column: column, level: level, onMasterDetailKeyDown: isMasterDetailEnabled ? onCellKeyDownCapture : undefined }, column.field.id));
|
|
26
|
+
}), isPreviewHighlighted && (_jsx("span", { className: MASTER_DETAIL_INDICATOR_CLASS, "aria-hidden": 'true' }))] }));
|
|
15
27
|
}
|
|
16
28
|
Row.propTypes = {
|
|
17
29
|
columns: PropTypes.arrayOf(PropTypes.any),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.js","sourceRoot":"","sources":["../../../../Core/Views/Table/Row.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,WAAW,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Row.js","sourceRoot":"","sources":["../../../../Core/Views/Table/Row.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACtC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,SAAS,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE;IACjD,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,EAAE,qBAAqB,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,GAC9E,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,oBAAoB,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC;IACtD,MAAM,OAAO,GAAG;QACd,GAAG,UAAU;QACb,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAA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es from 'prop-types';\nimport { memo } from 'react';\n\nimport { createClassName as cx } from '../../Utils';\nimport {\n MASTER_DETAIL_INDICATOR_CLASS,\n MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS\n} from '../../constants';\n\nimport CellWrapper from './CellWrapper';\nimport useMasterDetailRow from './useMasterDetailRow';\n\nfunction Row({ row, columns, level = 0, dataIndex }) {\n const rowUiProps = row.getUIProps();\n const { isMasterDetailEnabled, onRowClick, onCellKeyDownCapture, rowElementRef } =\n useMasterDetailRow(row);\n const isPreviewHighlighted = !!row.masterDetailActive;\n const uiProps = {\n ...rowUiProps,\n ...(dataIndex >= 0 ? { 'data-index': dataIndex } : {}),\n className: cx(rowUiProps.className, {\n [MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS]: isPreviewHighlighted\n })\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- TableA11y owns grid navigation while Row owns Master Detail activation.\n <div {...uiProps} ref={rowElementRef} onClick={isMasterDetailEnabled ? onRowClick : undefined}>\n {[...columns]\n .sort((colA, colB) => colA.order - colB.order)\n .map(column => {\n column.setExecutionContext(row);\n if (column.hidden) return null;\n return (\n <CellWrapper\n key={column.field.id}\n row={row}\n column={column}\n level={level}\n onMasterDetailKeyDown={isMasterDetailEnabled ? onCellKeyDownCapture : undefined}\n />\n );\n })}\n {isPreviewHighlighted && (\n <span className={MASTER_DETAIL_INDICATOR_CLASS} aria-hidden='true' />\n )}\n </div>\n );\n}\n\nRow.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.any),\n row: PropTypes.objectOf(PropTypes.any),\n level: PropTypes.number,\n dataIndex: PropTypes.number\n};\n\nexport default memo(Row);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAyCA;;yJAklCG"}
|