@pega/lists-react 10.0.0-build.1.8 → 10.0.0-build.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregateMenu.js","sourceRoot":"","sources":["../../../Core/Components/AggregateMenu.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAEjD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;WAChC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;;;;;CAK/D,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;eACd,gBAAgB;;;;;;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AI,EAAE,eAAe;iBACtB,EACD,OAAO,EAAE;oBACP,MAAM,EAAE,IAAI;iBACb,EACD,IAAI,EAAC,kBAAkB,EACvB,QAAQ,QACR,OAAO,EAAC,QAAQ,EAChB,OAAO,QACP,IAAI,EAAE,UAAU,qBACC,GAAG,GAAG,QAAQ,GAC/B,CACH,EACD,KAAC,IAAI,IACH,SAAS,QACT,EAAE,EAAE,sBAAsB,EAC1B,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,iBACN,eAAe,CAAC,qBAAqB,YAEjD,gBAAgB,GACZ,EACP,KAAC,kBAAkB,IAAC,EAAE,EAAE,GAAG,GAAG,QAAQ,iCACnC,GAAG,SAAS,CAAC,eAAe,CAAC,IAAI,OAAO,CAAC,QAAQ,EAAE,IAAI,UAAU,EAAE,GACjD,IACV,CACd,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,SAAS,GAAG;IACxB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IACzC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;CAC3C,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG;IAC3B,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;CACZ,CAAC","sourcesContent":["import styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport {\n Flex,\n MenuButton,\n VisuallyHiddenText,\n createUID,\n formatNumber\n} from '@pega/cosmos-react-core';\n\nimport useTranslate from '../Hooks/useTranslate';\n\nimport TestIdConstants from './TestIdConstants';\n\nconst StyledMenuButton = styled(MenuButton)`\n color: ${props => props.theme.base.palette['foreground-color']};\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n`;\n\nconst StyledCell = styled.div`\n &:not(:has(${StyledMenuButton})) {\n gap: 0.25rem;\n }\n display: flex;\n text-align: right;\n justify-content: flex-end;\n align-items: center;\n margin-inline-end: var(--cell-padding);\n\n &:hover {\n background-clip: padding-box;\n }\n`;\n\nconst StyledAggregationValue = styled.div`\n font-weight: ${props => props.theme.base['font-weight']['semi-bold']};\n`;\n\n/**\n * Formats the aggregation value based on the aggregation type and column context.\n *\n * @param {number|string} rawAggregationValue - The raw aggregation value to format.\n * @param {string} aggregationType - The type of aggregation (e.g., 'Avg').\n * @param {import('pega-repeating-structures-core').RsCoreTypes.Column} column - The column object.\n * @returns {string|number} The formatted aggregation value or the raw value if no formatter is available.\n */\nexport const getFormattedAggregationValue = (rawAggregationValue, aggregationType, column) => {\n const formatter = column.getContext().getFormatter();\n const fieldDef = column.getContext().getField();\n const formatterConfig = column.getContext().getFormatterValue();\n const { fieldType } = fieldDef;\n const { locale, timezone } = column.parent.meta;\n\n if (!formatter) return rawAggregationValue;\n\n if (aggregationType === 'Avg' && fieldType === 'Integer') {\n return formatNumber(Number(rawAggregationValue), {\n locale,\n useGrouping: true,\n maximumFractionDigits: 2\n });\n }\n\n return formatter(rawAggregationValue, { locale, timezone, fieldDef, formatterConfig });\n};\n\nexport default function AggregateMenu({ column, context }) {\n const { aggregateOptions } = column.parent.meta;\n const { aggregationType } = column;\n const uid = createUID();\n const [translate] = useTranslate();\n const isFooterAggregate = context.getExecutionContext?.()?.name === 'footer';\n\n const actions = aggregateOptions[column.field.type]?.map(label => ({\n primary: translate(label),\n id: label,\n onClick: () => column.applyAggregation(label),\n selected: aggregationType === label\n }));\n if (!actions) return null;\n\n const rawAggregationValue = context.getValue();\n\n const aggregationValue = getFormattedAggregationValue(\n rawAggregationValue,\n aggregationType,\n column\n );\n\n const buttonText = translate('Aggregate options');\n\n return (\n <StyledCell>\n <span>{translate(aggregationType)}</span>\n {isFooterAggregate && (\n <StyledMenuButton\n className='aggregate-button'\n menu={{\n items: actions,\n mode: 'single-select'\n }}\n popover={{\n portal: true\n }}\n icon='arrow-micro-down'\n iconOnly\n variant='simple'\n compact\n text={buttonText} // Text property to display tooltip on hover\n aria-labelledby={`${uid}_label`}\n />\n )}\n <Flex\n container\n as={StyledAggregationValue}\n item={{ shrink: 0 }}\n data-testid={TestIdConstants.aggregateDisplayValue}\n >\n {aggregationValue}\n </Flex>\n <VisuallyHiddenText id={`${uid}_label`} aria-hidden>\n {`${translate(aggregationType)} ${context.getValue()} ${buttonText}`}\n </VisuallyHiddenText>\n </StyledCell>\n );\n}\n\nAggregateMenu.propTypes = {\n column: PropTypes.objectOf(PropTypes.any),\n context: PropTypes.objectOf(PropTypes.any)\n};\n\nAggregateMenu.defaultProps = {\n column: {},\n context: {}\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
interface CardFieldValueProps {
|
|
3
|
+
column: RsCoreTypes.Column;
|
|
4
|
+
row: RsCoreTypes.Row;
|
|
5
|
+
}
|
|
6
|
+
declare function CardFieldValue({ column, row }: CardFieldValueProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default CardFieldValue;
|
|
8
|
+
//# sourceMappingURL=CardFieldValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardFieldValue.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Card/CardFieldValue.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,UAAU,mBAAmB;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;IAC3B,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;CACtB;AAED,iBAAS,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,mBAAmB,2CAI3D;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import RenderingEngine from '../RenderingEngine/RenderCell';
|
|
3
|
+
function CardFieldValue({ column, row }) {
|
|
4
|
+
column.setExecutionContext(row);
|
|
5
|
+
return _jsx(RenderingEngine, { ...column.getRenderingEngineProps(), highlighter: true });
|
|
6
|
+
}
|
|
7
|
+
export default CardFieldValue;
|
|
8
|
+
//# sourceMappingURL=CardFieldValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardFieldValue.js","sourceRoot":"","sources":["../../../../Core/Components/Card/CardFieldValue.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAO5D,SAAS,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,EAAuB;IAC1D,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,cAAc,CAAC","sourcesContent":["import type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport RenderingEngine from '../RenderingEngine/RenderCell';\n\ninterface CardFieldValueProps {\n column: RsCoreTypes.Column;\n row: RsCoreTypes.Row;\n}\n\nfunction CardFieldValue({ column, row }: CardFieldValueProps) {\n column.setExecutionContext(row);\n\n return <RenderingEngine {...column.getRenderingEngineProps()} highlighter />;\n}\n\nexport default CardFieldValue;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
type CardHeaderProps = {
|
|
3
|
+
headerColumn?: RsCoreTypes.Column;
|
|
4
|
+
row: RsCoreTypes.Row;
|
|
5
|
+
};
|
|
6
|
+
declare function CardHeader({ headerColumn, row }: CardHeaderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
declare const _default: import("react").MemoExoticComponent<typeof CardHeader>;
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=CardHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Card/CardHeader.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,KAAK,eAAe,GAAG;IACrB,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAClC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;CACtB,CAAC;AAMF,iBAAS,UAAU,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE,eAAe,kDAYzD;;AAED,wBAAgC"}
|
package/lib/Core/{Views/Gallery/Components/GalleryHeader.js → Components/Card/CardHeader.js}
RENAMED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
|
-
import RenderingEngine from '
|
|
4
|
+
import RenderingEngine from '../RenderingEngine/RenderCell';
|
|
4
5
|
const StyledHeaderContainer = styled.div `
|
|
5
6
|
word-break: break-word;
|
|
6
7
|
`;
|
|
7
|
-
function
|
|
8
|
+
function CardHeader({ headerColumn, row }) {
|
|
8
9
|
if (!headerColumn) {
|
|
9
10
|
return null;
|
|
10
11
|
}
|
|
11
12
|
headerColumn?.setExecutionContext(row);
|
|
12
|
-
return (_jsx(StyledHeaderContainer, { children: _jsx(RenderingEngine, { ...headerColumn.getRenderingEngineProps() }) }));
|
|
13
|
+
return (_jsx(StyledHeaderContainer, { children: _jsx(RenderingEngine, { ...headerColumn.getRenderingEngineProps(), highlighter: true }) }));
|
|
13
14
|
}
|
|
14
|
-
export default
|
|
15
|
-
//# sourceMappingURL=
|
|
15
|
+
export default memo(CardHeader);
|
|
16
|
+
//# sourceMappingURL=CardHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../Core/Components/Card/CardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAIvC,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAO5D,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAC;AAEF,SAAS,UAAU,CAAC,EAAE,YAAY,EAAE,GAAG,EAAmB;IACxD,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,EAAE,WAAW,SAAG,GACrD,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { memo } from 'react';\nimport styled from 'styled-components';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport RenderingEngine from '../RenderingEngine/RenderCell';\n\ntype CardHeaderProps = {\n headerColumn?: RsCoreTypes.Column;\n row: RsCoreTypes.Row;\n};\n\nconst StyledHeaderContainer = styled.div`\n word-break: break-word;\n`;\n\nfunction CardHeader({ headerColumn, row }: CardHeaderProps) {\n if (!headerColumn) {\n return null;\n }\n\n headerColumn?.setExecutionContext(row);\n\n return (\n <StyledHeaderContainer>\n <RenderingEngine {...headerColumn.getRenderingEngineProps()} highlighter />\n </StyledHeaderContainer>\n );\n}\n\nexport default memo(CardHeader);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
3
|
+
interface CardSubHeadingProps {
|
|
4
|
+
subHeadingColumn: RsCoreTypes.Column;
|
|
5
|
+
row: RsCoreTypes.Row;
|
|
6
|
+
}
|
|
7
|
+
declare function CardSubHeading({ subHeadingColumn, row }: CardSubHeadingProps): ReactElement;
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<typeof CardSubHeading>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=CardSubHeading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardSubHeading.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Card/CardSubHeading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,UAAU,mBAAmB;IAC3B,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC;IACrC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;CACtB;AAED,iBAAS,cAAc,CAAC,EAAE,gBAAgB,EAAE,GAAG,EAAE,EAAE,mBAAmB,GAAG,YAAY,CAIpF;;AAED,wBAAoC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import RenderingEngine from '../RenderingEngine/RenderCell';
|
|
4
|
+
function CardSubHeading({ subHeadingColumn, row }) {
|
|
5
|
+
subHeadingColumn.setExecutionContext(row);
|
|
6
|
+
return _jsx(RenderingEngine, { ...subHeadingColumn.getRenderingEngineProps() });
|
|
7
|
+
}
|
|
8
|
+
export default memo(CardSubHeading);
|
|
9
|
+
//# sourceMappingURL=CardSubHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardSubHeading.js","sourceRoot":"","sources":["../../../../Core/Components/Card/CardSubHeading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAK7B,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAO5D,SAAS,cAAc,CAAC,EAAE,gBAAgB,EAAE,GAAG,EAAuB;IACpE,gBAAgB,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO,KAAC,eAAe,OAAK,gBAAgB,CAAC,uBAAuB,EAAE,GAAI,CAAC;AAC7E,CAAC;AAED,eAAe,IAAI,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { memo } from 'react';\nimport type { ReactElement } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport RenderingEngine from '../RenderingEngine/RenderCell';\n\ninterface CardSubHeadingProps {\n subHeadingColumn: RsCoreTypes.Column;\n row: RsCoreTypes.Row;\n}\n\nfunction CardSubHeading({ subHeadingColumn, row }: CardSubHeadingProps): ReactElement {\n subHeadingColumn.setExecutionContext(row);\n\n return <RenderingEngine {...subHeadingColumn.getRenderingEngineProps()} />;\n}\n\nexport default memo(CardSubHeading);\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
import type { CardConfig } from 'pega-repeating-structures-core/types/Meta.types';
|
|
3
|
+
import type { ImageSize, SelectionCardDisplayProps } from '@pega/cosmos-react-core';
|
|
4
|
+
export declare const GALLERY_IMAGE_PLACEMENT_MAP: {
|
|
5
|
+
readonly left: "inline-start";
|
|
6
|
+
readonly right: "inline-end";
|
|
7
|
+
readonly top: "block-start";
|
|
8
|
+
};
|
|
9
|
+
export declare const DEFAULT_IMAGE_PLACEMENT: RsCoreTypes.HeroImagePlacement;
|
|
10
|
+
export declare const DEFAULT_IMAGE_SIZE: ImageSize;
|
|
11
|
+
export declare const isInlinePlacement: (placement: RsCoreTypes.HeroImagePlacement) => placement is Extract<RsCoreTypes.HeroImagePlacement, "left" | "right">;
|
|
12
|
+
/**
|
|
13
|
+
* Extracts UI-related props from a row for card components.
|
|
14
|
+
*
|
|
15
|
+
* @param props - The properties containing the row.
|
|
16
|
+
* @param props.row - The data row.
|
|
17
|
+
* @returns An object containing card-safe row metadata.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCardUIProps({ row }: {
|
|
20
|
+
row: RsCoreTypes.Row;
|
|
21
|
+
}): {
|
|
22
|
+
'data-key': string;
|
|
23
|
+
};
|
|
24
|
+
interface CardDataProps {
|
|
25
|
+
row: RsCoreTypes.Row;
|
|
26
|
+
visibleColumns: RsCoreTypes.Column[];
|
|
27
|
+
cardConfig?: Pick<CardConfig, 'heroImage' | 'tile' | 'showFieldLabels' | 'renderCardFooter'>;
|
|
28
|
+
headerColumn?: RsCoreTypes.Column;
|
|
29
|
+
subHeadingsColumns?: RsCoreTypes.Column[];
|
|
30
|
+
}
|
|
31
|
+
interface CardColumns {
|
|
32
|
+
visibleColumns: RsCoreTypes.Column[];
|
|
33
|
+
headerColumn?: RsCoreTypes.Column;
|
|
34
|
+
subHeadingsColumns?: RsCoreTypes.Column[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the columns used to render a configured card.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getCardColumns(columns: RsCoreTypes.Column[], { header, subHeadings }: Pick<CardConfig, 'header' | 'subHeadings'>): CardColumns;
|
|
40
|
+
/**
|
|
41
|
+
* Generates SelectionCardDisplay data from card content configuration.
|
|
42
|
+
*
|
|
43
|
+
* @param props - Card data dependencies.
|
|
44
|
+
* @returns Data used to render a selection card.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getCardData({ row, visibleColumns, cardConfig, headerColumn, subHeadingsColumns }: CardDataProps): Pick<SelectionCardDisplayProps, 'label' | 'subheading' | 'image' | 'fields' | 'aria-label' | 'footer'>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=cardData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardData.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Card/cardData.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,KAAK,EAAkB,SAAS,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAMpG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AAI,CACrB,yBAAyB,EACzB,OAAO,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,CACtE,CAmEA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isEmpty } from 'pega-repeating-structures-core';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { FieldType, isEmpty } from 'pega-repeating-structures-core';
|
|
3
|
+
import CardFieldValue from './CardFieldValue';
|
|
4
|
+
import CardHeader from './CardHeader';
|
|
5
|
+
import CardSubHeading from './CardSubHeading';
|
|
5
6
|
export const GALLERY_IMAGE_PLACEMENT_MAP = {
|
|
6
7
|
left: 'inline-start',
|
|
7
8
|
right: 'inline-end',
|
|
@@ -14,18 +15,10 @@ export const isInlinePlacement = (placement) => {
|
|
|
14
15
|
return INLINE_PLACEMENTS.includes(placement);
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
|
-
* Extracts image data from
|
|
18
|
-
*
|
|
19
|
-
* @param meta - The metadata object containing gallery configuration.
|
|
20
|
-
* @param row - The row object providing context and data values.
|
|
21
|
-
* @returns An object containing:
|
|
22
|
-
* - `src`: The image source URL.
|
|
23
|
-
* - `alt`: The alternative text for the image.
|
|
24
|
-
* - `placement`: The placement of the image within the gallery.
|
|
25
|
-
* - `size`: The size of the image.
|
|
18
|
+
* Extracts image data from a HeroImage config and row context.
|
|
26
19
|
*/
|
|
27
|
-
function
|
|
28
|
-
const {
|
|
20
|
+
function getHeroImageData(heroImage, row) {
|
|
21
|
+
const { source, altText, placement, size } = heroImage;
|
|
29
22
|
const rowData = row.getContext().getValue();
|
|
30
23
|
let altTextValue = '';
|
|
31
24
|
if (altText && 'field' in altText) {
|
|
@@ -40,33 +33,55 @@ function getImageData(meta, row) {
|
|
|
40
33
|
return { src: imageUrl, alt: altTextValue, placement: imagePlacement, size: imageSize };
|
|
41
34
|
}
|
|
42
35
|
/**
|
|
43
|
-
*
|
|
36
|
+
* Extracts UI-related props from a row for card components.
|
|
44
37
|
*
|
|
45
|
-
* @param props - The properties
|
|
46
|
-
* @param props.row - The data
|
|
47
|
-
* @
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
* @param props - The properties containing the row.
|
|
39
|
+
* @param props.row - The data row.
|
|
40
|
+
* @returns An object containing card-safe row metadata.
|
|
41
|
+
*/
|
|
42
|
+
export function getCardUIProps({ row }) {
|
|
43
|
+
const uiProps = row.getUIProps();
|
|
44
|
+
return {
|
|
45
|
+
'data-key': uiProps['data-key']
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Resolves the columns used to render a configured card.
|
|
52
50
|
*/
|
|
53
|
-
export function
|
|
54
|
-
const
|
|
55
|
-
|
|
51
|
+
export function getCardColumns(columns, { header, subHeadings }) {
|
|
52
|
+
const visibleColumns = [...columns]
|
|
53
|
+
.filter(column => !column.hidden && column.field.type !== FieldType.ACTION_FIELD_TYPE)
|
|
54
|
+
.sort((first, second) => (first.order ?? 0) - (second.order ?? 0));
|
|
55
|
+
const headerColumn = header?.field
|
|
56
|
+
? columns.find(column => column.field.id === header.field)
|
|
57
|
+
: undefined;
|
|
58
|
+
const subHeadingsColumns = subHeadings?.flatMap(({ field }) => {
|
|
59
|
+
const column = columns.find(candidate => candidate.field.id === field);
|
|
60
|
+
return column ? [column] : [];
|
|
61
|
+
});
|
|
62
|
+
return { visibleColumns, headerColumn, subHeadingsColumns };
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Generates SelectionCardDisplay data from card content configuration.
|
|
66
|
+
*
|
|
67
|
+
* @param props - Card data dependencies.
|
|
68
|
+
* @returns Data used to render a selection card.
|
|
69
|
+
*/
|
|
70
|
+
export function getCardData({ row, visibleColumns, cardConfig, headerColumn, subHeadingsColumns }) {
|
|
71
|
+
const { heroImage, tile: tileConfig, showFieldLabels = true, renderCardFooter } = cardConfig ?? {};
|
|
56
72
|
visibleColumns.forEach(col => col.setExecutionContext(row));
|
|
57
73
|
const rowData = row.getContext().getValue();
|
|
58
74
|
const fields = visibleColumns.map(col => ({
|
|
59
75
|
id: col.field.id,
|
|
60
76
|
...(showFieldLabels && { name: col.getContext()?.getLabel() }),
|
|
61
77
|
...(col.field.layoutMode && { variant: col.field.layoutMode }),
|
|
62
|
-
// TODO: Add truncation for non-tile cards once `truncate` is typed at
|
|
63
|
-
// the field-level API.
|
|
64
78
|
...(!heroImage && tileConfig
|
|
65
79
|
? { value: String(rowData[col.field.id] ?? ''), truncate: true }
|
|
66
|
-
: { value: _jsx(
|
|
80
|
+
: { value: _jsx(CardFieldValue, { column: col, row: row }) })
|
|
67
81
|
}));
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
let image = heroImage
|
|
83
|
+
? getHeroImageData(heroImage, row)
|
|
84
|
+
: undefined;
|
|
70
85
|
if (!heroImage && tileConfig) {
|
|
71
86
|
const foregroundColor = tileConfig.foregroundColor.field in rowData
|
|
72
87
|
? String(rowData[tileConfig.foregroundColor.field])
|
|
@@ -81,10 +96,7 @@ export function getCardData({ row, visibleColumns, meta, headerColumn }) {
|
|
|
81
96
|
const tileText = tileConfig.text && tileConfig.text.field in rowData
|
|
82
97
|
? String(rowData[tileConfig.text.field]) || undefined
|
|
83
98
|
: undefined;
|
|
84
|
-
const tileBase = {
|
|
85
|
-
foregroundColor,
|
|
86
|
-
backgroundColor
|
|
87
|
-
};
|
|
99
|
+
const tileBase = { foregroundColor, backgroundColor };
|
|
88
100
|
if (tileName) {
|
|
89
101
|
image = { ...tileBase, icon: tileName };
|
|
90
102
|
}
|
|
@@ -93,23 +105,14 @@ export function getCardData({ row, visibleColumns, meta, headerColumn }) {
|
|
|
93
105
|
}
|
|
94
106
|
}
|
|
95
107
|
}
|
|
96
|
-
const footer =
|
|
97
|
-
const label = _jsx(
|
|
108
|
+
const footer = renderCardFooter?.(rowData) ?? null;
|
|
109
|
+
const label = _jsx(CardHeader, { headerColumn: headerColumn, row: row });
|
|
110
|
+
const subheading = subHeadingsColumns?.map(column => (_jsx(CardSubHeading, { subHeadingColumn: column, row: row }, column.field.id)));
|
|
98
111
|
const headerValue = row.getContext()?.getRowHeader()?.getValue();
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
*
|
|
105
|
-
* @param props - The properties containing the row.
|
|
106
|
-
* @param props.row - The data row.
|
|
107
|
-
* @returns An object containing card-safe row metadata.
|
|
108
|
-
*/
|
|
109
|
-
export function getCardUIProps({ row }) {
|
|
110
|
-
const uiProps = row.getUIProps();
|
|
111
|
-
return {
|
|
112
|
-
'data-key': uiProps['data-key']
|
|
113
|
-
};
|
|
112
|
+
let ariaLabel;
|
|
113
|
+
if (!headerColumn && !isEmpty(headerValue)) {
|
|
114
|
+
ariaLabel = String(headerValue);
|
|
115
|
+
}
|
|
116
|
+
return { fields, image, footer, label, subheading, 'aria-label': ariaLabel };
|
|
114
117
|
}
|
|
115
|
-
//# sourceMappingURL=
|
|
118
|
+
//# sourceMappingURL=cardData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardData.js","sourceRoot":"","sources":["../../../../Core/Components/Card/cardData.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAoB,MAAM,gCAAgC,CAAC;AAItF,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,aAAa;CACuD,CAAC;AAE5E,MAAM,iBAAiB,GAAqC,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAmC,MAAM,CAAC;AAC9E,MAAM,CAA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AC;IACnD,MAAM,KAAK,GAAG,KAAC,UAAU,IAAC,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;IACnE,MAAM,UAAU,GAAG,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACnD,KAAC,cAAc,IAAuB,gBAAgB,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAnD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAwC,CAC7E,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,GAAG,CAAC,UAAU,EAAE,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,CAAC;IACjE,IAAI,SAA6B,CAAC;IAClC,IAAI,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC3C,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AAC/E,CAAC","sourcesContent":["import { FieldType, isEmpty, type RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { CardConfig } from 'pega-repeating-structures-core/types/Meta.types';\nimport type { ImagePlacement, ImageSize, SelectionCardDisplayProps } from '@pega/cosmos-react-core';\n\nimport CardFieldValue from './CardFieldValue';\nimport CardHeader from './CardHeader';\nimport CardSubHeading from './CardSubHeading';\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 a HeroImage config and row context.\n */\nfunction getHeroImageData(\n heroImage: RsCoreTypes.HeroImage,\n row: RsCoreTypes.Row\n): {\n src: string;\n alt: string;\n placement: ImagePlacement;\n size: ImageSize;\n} {\n const { source, altText, placement, size } = heroImage;\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 * 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\ninterface CardDataProps {\n row: RsCoreTypes.Row;\n visibleColumns: RsCoreTypes.Column[];\n cardConfig?: Pick<CardConfig, 'heroImage' | 'tile' | 'showFieldLabels' | 'renderCardFooter'>;\n headerColumn?: RsCoreTypes.Column;\n subHeadingsColumns?: RsCoreTypes.Column[];\n}\n\ninterface CardColumns {\n visibleColumns: RsCoreTypes.Column[];\n headerColumn?: RsCoreTypes.Column;\n subHeadingsColumns?: RsCoreTypes.Column[];\n}\n\n/**\n * Resolves the columns used to render a configured card.\n */\nexport function getCardColumns(\n columns: RsCoreTypes.Column[],\n { header, subHeadings }: Pick<CardConfig, 'header' | 'subHeadings'>\n): CardColumns {\n const visibleColumns = [...columns]\n .filter(column => !column.hidden && column.field.type !== FieldType.ACTION_FIELD_TYPE)\n .sort((first, second) => (first.order ?? 0) - (second.order ?? 0));\n const headerColumn = header?.field\n ? columns.find(column => column.field.id === header.field)\n : undefined;\n const subHeadingsColumns = subHeadings?.flatMap(({ field }) => {\n const column = columns.find(candidate => candidate.field.id === field);\n return column ? [column] : [];\n });\n\n return { visibleColumns, headerColumn, subHeadingsColumns };\n}\n\n/**\n * Generates SelectionCardDisplay data from card content configuration.\n *\n * @param props - Card data dependencies.\n * @returns Data used to render a selection card.\n */\nexport function getCardData({\n row,\n visibleColumns,\n cardConfig,\n headerColumn,\n subHeadingsColumns\n}: CardDataProps): Pick<\n SelectionCardDisplayProps,\n 'label' | 'subheading' | 'image' | 'fields' | 'aria-label' | 'footer'\n> {\n const {\n heroImage,\n tile: tileConfig,\n showFieldLabels = true,\n renderCardFooter\n } = cardConfig ?? {};\n\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 ...(!heroImage && tileConfig\n ? { value: String(rowData[col.field.id] ?? ''), truncate: true }\n : { value: <CardFieldValue column={col} row={row} /> })\n }));\n\n let image: SelectionCardDisplayProps['image'] = heroImage\n ? getHeroImageData(heroImage, row)\n : undefined;\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 = { foregroundColor, backgroundColor };\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 = renderCardFooter?.(rowData) ?? null;\n const label = <CardHeader headerColumn={headerColumn} row={row} />;\n const subheading = subHeadingsColumns?.map(column => (\n <CardSubHeading key={column.field.id} subHeadingColumn={column} row={row} />\n ));\n const headerValue = row.getContext()?.getRowHeader()?.getValue();\n let ariaLabel: string | undefined;\n if (!headerColumn && !isEmpty(headerValue)) {\n ariaLabel = String(headerValue);\n }\n\n return { fields, image, footer, label, subheading, 'aria-label': ariaLabel };\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as CardHeader } from './CardHeader';
|
|
2
|
+
export { default as CardFieldValue } from './CardFieldValue';
|
|
3
|
+
export { getCardUIProps, getCardData, getCardColumns, GALLERY_IMAGE_PLACEMENT_MAP, DEFAULT_IMAGE_PLACEMENT, DEFAULT_IMAGE_SIZE, isInlinePlacement } from './cardData';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,WAAW,EACX,cAAc,EACd,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as CardHeader } from './CardHeader';
|
|
2
|
+
export { default as CardFieldValue } from './CardFieldValue';
|
|
3
|
+
export { getCardUIProps, getCardData, getCardColumns, GALLERY_IMAGE_PLACEMENT_MAP, DEFAULT_IMAGE_PLACEMENT, DEFAULT_IMAGE_SIZE, isInlinePlacement } from './cardData';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,WAAW,EACX,cAAc,EACd,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAC","sourcesContent":["export { default as CardHeader } from './CardHeader';\nexport { default as CardFieldValue } from './CardFieldValue';\nexport {\n getCardUIProps,\n getCardData,\n getCardColumns,\n GALLERY_IMAGE_PLACEMENT_MAP,\n DEFAULT_IMAGE_PLACEMENT,\n DEFAULT_IMAGE_SIZE,\n isInlinePlacement\n} from './cardData';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowActionMenu.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowActionMenu.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RowActionMenu.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowActionMenu.jsx"],"names":[],"mappings":";AASA;;;;4CAwCC;;;;;;;sBAhDqB,YAAY"}
|
|
@@ -1,67 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { MenuButton } from '@pega/cosmos-react-core';
|
|
5
5
|
import { ROW_DENSITY } from 'pega-repeating-structures-core';
|
|
6
6
|
import useTranslate from '../../../Hooks/useTranslate';
|
|
7
|
-
|
|
8
|
-
return actions.map(action => ({
|
|
9
|
-
...action,
|
|
10
|
-
primary: action.text,
|
|
11
|
-
onClick: () => {
|
|
12
|
-
action.onClick(rowContext, refreshRow);
|
|
13
|
-
}
|
|
14
|
-
}));
|
|
15
|
-
};
|
|
16
|
-
const isActionConfig = actionConfig => {
|
|
17
|
-
return !!actionConfig && typeof actionConfig === 'object';
|
|
18
|
-
};
|
|
19
|
-
const isVisibleInMenu = (actionConfig, rowContext) => {
|
|
20
|
-
return (isActionConfig(actionConfig) &&
|
|
21
|
-
actionConfig.placement === 'menu' &&
|
|
22
|
-
actionConfig.isVisible?.(rowContext));
|
|
23
|
-
};
|
|
24
|
-
const getConfigActions = ({ editing, deleting }, rowContext, refreshRow, translate) => {
|
|
25
|
-
const actions = [];
|
|
26
|
-
if (isVisibleInMenu(editing, rowContext) && typeof editing.onClick === 'function') {
|
|
27
|
-
actions.push({
|
|
28
|
-
text: translate('Edit'),
|
|
29
|
-
id: 'edit',
|
|
30
|
-
onClick: editing.onClick
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
if (isVisibleInMenu(deleting, rowContext) && typeof deleting.onClick === 'function') {
|
|
34
|
-
actions.push({
|
|
35
|
-
text: translate('Delete'),
|
|
36
|
-
id: 'delete',
|
|
37
|
-
onClick: deleting.onClick
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return hydrateActions(actions, rowContext, refreshRow.bind(null, rowContext));
|
|
41
|
-
};
|
|
7
|
+
import fetchRowActions from '../../../Utils/fetchRowActions';
|
|
42
8
|
function RowActionMenu({ getRsMeta, getExecutionContext, getParentContext }) {
|
|
43
9
|
const [translate] = useTranslate();
|
|
44
|
-
const { getValue, getRowActionDetails, refreshRow } = getExecutionContext();
|
|
45
10
|
const [rowActions, setRowActions] = useState([]);
|
|
46
11
|
const [actionsFetched, setActionsFetched] = useState(false);
|
|
47
|
-
const rowContext = getValue();
|
|
48
12
|
const rsMeta = getRsMeta();
|
|
49
|
-
const
|
|
50
|
-
const staticActions = useMemo(() => hydrateActions(tableMetaRowActions ?? [], rowContext, refreshRow.bind(null, rowContext)), [rowContext, tableMetaRowActions]);
|
|
51
|
-
const fetchCaseDeatils = () => {
|
|
13
|
+
const fetchCaseDetails = () => {
|
|
52
14
|
setActionsFetched(false);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const configActions = getConfigActions(rsMeta, rowContext, refreshRow, translate);
|
|
56
|
-
getRowActionDetails(currentRowContext)
|
|
57
|
-
.then(response => {
|
|
58
|
-
if (Array.isArray(response)) {
|
|
59
|
-
const latestRowContext = getExecutionContext()?.getValue();
|
|
60
|
-
actions = hydrateActions(response, latestRowContext, refreshRow.bind(null, latestRowContext));
|
|
61
|
-
}
|
|
62
|
-
})
|
|
15
|
+
fetchRowActions({ getExecutionContext, meta: rsMeta, translate })
|
|
16
|
+
.then(setRowActions)
|
|
63
17
|
.finally(() => {
|
|
64
|
-
setRowActions([...configActions, ...actions, ...staticActions]);
|
|
65
18
|
setActionsFetched(true);
|
|
66
19
|
});
|
|
67
20
|
};
|
|
@@ -71,7 +24,7 @@ function RowActionMenu({ getRsMeta, getExecutionContext, getParentContext }) {
|
|
|
71
24
|
items: actionsFetched ? rowActions : [],
|
|
72
25
|
emptyText: translate('No actions available'),
|
|
73
26
|
loading: !actionsFetched
|
|
74
|
-
}, "aria-label": rowHeaderValue ? `${translatedActionsText} - ${rowHeaderValue}` : `${translatedActionsText}`, onClick:
|
|
27
|
+
}, "aria-label": rowHeaderValue ? `${translatedActionsText} - ${rowHeaderValue}` : `${translatedActionsText}`, onClick: fetchCaseDetails, placement: 'bottom-end', popover: {
|
|
75
28
|
portal: true
|
|
76
29
|
}, icon: 'more' }));
|
|
77
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowActionMenu.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowActionMenu.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
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EAChB,OAAO,EAAE,gBAAgB,EAAE,CAAC,aAAa,EAAE,KAAK,WAAW,CAAC,KAAK,EACjE,QAAQ,EAAE,CAAC,CAAC,EACZ,IAAI,EAAE;YACJ,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;YACvC,SAAS,EAAE,SAAS,CAAC,sBAAsB,CAAC;YAC5C,OAAO,EAAE,CAAC,cAAc;SACzB,gBAEC,cAAc,CAAC,CAAC,CAAC,GAAG,qBAAqB,MAAM,cAAc,EAAE,CAAC,CAAC,CAAC,GAAG,qBAAqB,EAAE,EAE9F,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE;YACP,MAAM,EAAE,IAAI;SACb,EACD,IAAI,EAAC,MAAM,GACX,CACH,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,SAAS,GAAG;IACxB,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACpC,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CAC/C,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { MenuButton } from '@pega/cosmos-react-core';\nimport { ROW_DENSITY } from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../../Hooks/useTranslate';\nimport fetchRowActions from '../../../Utils/fetchRowActions';\n\nfunction RowActionMenu({ getRsMeta, getExecutionContext, getParentContext }) {\n const [translate] = useTranslate();\n const [rowActions, setRowActions] = useState([]);\n const [actionsFetched, setActionsFetched] = useState(false);\n const rsMeta = getRsMeta();\n\n const fetchCaseDetails = () => {\n setActionsFetched(false);\n fetchRowActions({ getExecutionContext, meta: rsMeta, translate })\n .then(setRowActions)\n .finally(() => {\n setActionsFetched(true);\n });\n };\n const rowHeaderValue = getExecutionContext().getRowHeader()?.getValue();\n const translatedActionsText = translate('Actions');\n\n return (\n <MenuButton\n text={translatedActionsText}\n iconOnly\n variant='simple'\n compact={getParentContext().getRowDensity() === ROW_DENSITY.SHORT}\n tabIndex={-1}\n menu={{\n items: actionsFetched ? rowActions : [],\n emptyText: translate('No actions available'),\n loading: !actionsFetched\n }}\n aria-label={\n rowHeaderValue ? `${translatedActionsText} - ${rowHeaderValue}` : `${translatedActionsText}`\n }\n onClick={fetchCaseDetails}\n placement='bottom-end'\n popover={{\n portal: true\n }}\n icon='more'\n />\n );\n}\n\nRowActionMenu.propTypes = {\n getRsMeta: PropTypes.func.isRequired,\n getExecutionContext: PropTypes.func.isRequired\n};\n\nexport default RowActionMenu;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowDeleteAction.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,UAAU,cAAc;IACtB,mBAAmB,EAAE,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACtE,SAAS,EAAE,MAAM,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,GAAG;QACpE,QAAQ,EAAE,WAAW,CAAC,YAAY,CAAC;KACpC,CAAC;CACH;
|
|
1
|
+
{"version":3,"file":"RowDeleteAction.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,UAAU,cAAc;IACtB,mBAAmB,EAAE,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACtE,SAAS,EAAE,MAAM,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,GAAG;QACpE,QAAQ,EAAE,WAAW,CAAC,YAAY,CAAC;KACpC,CAAC;CACH;AAuBD,iBAAS,eAAe,CAAC,EAAE,mBAAmB,EAAE,SAAS,EAAE,EAAE,cAAc,2CAuC1E;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -5,6 +5,14 @@ import useTranslate from '../../../Hooks/useTranslate';
|
|
|
5
5
|
const StyledButton = styled(Button)(({ $isVisible }) => css `
|
|
6
6
|
visibility: ${$isVisible ? 'visible' : 'hidden'};
|
|
7
7
|
`);
|
|
8
|
+
// Row header cells share one mutable Column instance whose execution context is rebound to
|
|
9
|
+
// whichever row is currently rendering, so its value must be read now - not later inside onClick.
|
|
10
|
+
const resolveRowMeta = (executionContext) => {
|
|
11
|
+
return {
|
|
12
|
+
rowHeader: executionContext?.getRowHeader?.()?.getValue(),
|
|
13
|
+
rowIndex: executionContext?.getRowIndex?.() ?? -1
|
|
14
|
+
};
|
|
15
|
+
};
|
|
8
16
|
function RowDeleteAction({ getExecutionContext, getRsMeta }) {
|
|
9
17
|
const [translate] = useTranslate();
|
|
10
18
|
const executionContext = getExecutionContext();
|
|
@@ -15,11 +23,13 @@ function RowDeleteAction({ getExecutionContext, getRsMeta }) {
|
|
|
15
23
|
// RowDelete renderer only mounts for delete-column configuration.
|
|
16
24
|
const isVisibleFromMeta = rowContext ? deletingConfig.isVisible(rowContext) : false;
|
|
17
25
|
const handleDelete = () => {
|
|
18
|
-
|
|
26
|
+
const latestExecutionContext = getExecutionContext();
|
|
27
|
+
const latestRowContext = latestExecutionContext?.getValue();
|
|
28
|
+
if (!latestRowContext) {
|
|
19
29
|
return;
|
|
20
30
|
}
|
|
21
31
|
// RowDelete uses action-config callback for delete behavior.
|
|
22
|
-
deletingConfig.onClick(
|
|
32
|
+
deletingConfig.onClick(latestRowContext, latestExecutionContext?.refreshRow, resolveRowMeta(latestExecutionContext));
|
|
23
33
|
};
|
|
24
34
|
return (_jsx(StyledButton, { variant: 'simple', icon: true, "$isVisible": isVisibleFromMeta, ...(!isVisibleFromMeta && { tabIndex: -1 }), label: deleteText, "aria-label": rowHeaderValue ? `${deleteText} - ${rowHeaderValue}` : deleteText, onClick: isVisibleFromMeta ? handleDelete : undefined, children: _jsx(Icon, { name: 'trash' }) }));
|
|
25
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowDeleteAction.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAavD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CACjC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;kBACP,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;GAChD,CACF,CAAC;AAEF,SAAS,eAAe,CAAC,EAAE,mBAAmB,EAAE,SAAS,EAAkB;IACzE,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,UAAU,GAAG,gBAAgB,EAAE,QAAQ,EAAE,CAAC;IAChD,MAAM,cAAc,GAAG,gBAAgB,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;IACtE,MAAM,UAAU,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,SAAS,EAAE,CAAC,QAAQ,CAAC;IAE5C,kEAAkE;IAClE,MAAM,iBAAiB,GAAG,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAEpF,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"RowDeleteAction.js","sourceRoot":"","sources":["../../../../../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AAG,GAAG,EAAE;QACxB,MAAM,sBAAsB,GAAG,mBAAmB,EAAE,CAAC;QACrD,MAAM,gBAAgB,GAAG,sBAAsB,EAAE,QAAQ,EAAE,CAAC;QAC5D,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,OAAO;QACT,CAAC;QAED,6DAA6D;QAC7D,cAAc,CAAC,OAAO,CACpB,gBAAgB,EAChB,sBAAsB,EAAE,UAAU,EAClC,cAAc,CAAC,sBAAsB,CAAC,CACvC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,YAAY,IACX,OAAO,EAAC,QAAQ,EAChB,IAAI,sBACQ,iBAAiB,KACzB,CAAC,CAAC,iBAAiB,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAC5C,KAAK,EAAE,UAAU,gBACL,cAAc,CAAC,CAAC,CAAC,GAAG,UAAU,MAAM,cAAc,EAAE,CAAC,CAAC,CAAC,UAAU,EAC7E,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,YAErD,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACR,CAChB,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { Button, Icon } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../../Hooks/useTranslate';\n\ninterface RowDeleteProps {\n getExecutionContext: RsCoreTypes.ColumnContext['getExecutionContext'];\n getRsMeta: () => ReturnType<RsCoreTypes.ColumnContext['getRsMeta']> & {\n deleting: RsCoreTypes.ActionConfig;\n };\n}\n\ninterface StyledButtonProps {\n $isVisible: boolean;\n}\n\nconst StyledButton = styled(Button)<StyledButtonProps>(\n ({ $isVisible }) => css`\n visibility: ${$isVisible ? 'visible' : 'hidden'};\n `\n);\n\n// Row header cells share one mutable Column instance whose execution context is rebound to\n// whichever row is currently rendering, so its value must be read now - not later inside onClick.\nconst resolveRowMeta = (\n executionContext: ReturnType<RsCoreTypes.ColumnContext['getExecutionContext']>\n) => {\n return {\n rowHeader: executionContext?.getRowHeader?.()?.getValue(),\n rowIndex: executionContext?.getRowIndex?.() ?? -1\n };\n};\n\nfunction RowDeleteAction({ getExecutionContext, getRsMeta }: RowDeleteProps) {\n const [translate] = useTranslate();\n const executionContext = getExecutionContext();\n const rowContext = executionContext?.getValue();\n const rowHeaderValue = executionContext?.getRowHeader?.()?.getValue();\n const deleteText = translate('Delete this row');\n const deletingConfig = getRsMeta().deleting;\n\n // RowDelete renderer only mounts for delete-column configuration.\n const isVisibleFromMeta = rowContext ? deletingConfig.isVisible(rowContext) : false;\n\n const handleDelete = () => {\n const latestExecutionContext = getExecutionContext();\n const latestRowContext = latestExecutionContext?.getValue();\n if (!latestRowContext) {\n return;\n }\n\n // RowDelete uses action-config callback for delete behavior.\n deletingConfig.onClick(\n latestRowContext,\n latestExecutionContext?.refreshRow,\n resolveRowMeta(latestExecutionContext)\n );\n };\n\n return (\n <StyledButton\n variant='simple'\n icon\n $isVisible={isVisibleFromMeta}\n {...(!isVisibleFromMeta && { tabIndex: -1 })}\n label={deleteText}\n aria-label={rowHeaderValue ? `${deleteText} - ${rowHeaderValue}` : deleteText}\n onClick={isVisibleFromMeta ? handleDelete : undefined}\n >\n <Icon name='trash' />\n </StyledButton>\n );\n}\n\nexport default RowDeleteAction;\n"]}
|