@pega/lists-react 8.8.0 → 9.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/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts +10 -5
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts.map +1 -1
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js +27 -2
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js.map +1 -1
- package/lib/Core/Components/AggregateMenu.d.ts +1 -0
- package/lib/Core/Components/AggregateMenu.d.ts.map +1 -1
- package/lib/Core/Components/AggregateMenu.js +26 -16
- package/lib/Core/Components/AggregateMenu.js.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js +4 -2
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js.map +1 -1
- package/lib/Core/Components/ContextMenu/QuickFilter.js +6 -6
- package/lib/Core/Components/ContextMenu/QuickFilter.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js +3 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js +3 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js +7 -6
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js +9 -21
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.js +4 -3
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.js +4 -3
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +3 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js +2 -4
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts +3 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -1
- package/lib/Core/Components/Filters/CommonFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/CommonFilter.js +2 -2
- package/lib/Core/Components/Filters/CommonFilter.js.map +1 -1
- package/lib/Core/Components/Filters/FilterType.js +5 -5
- package/lib/Core/Components/Filters/FilterType.js.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.js +2 -2
- package/lib/Core/Components/Filters/SelectFilter.js.map +1 -1
- package/lib/Core/Components/GroupRenderer.d.ts +16 -0
- package/lib/Core/Components/GroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/GroupRenderer.js +120 -5
- package/lib/Core/Components/GroupRenderer.js.map +1 -1
- package/lib/Core/Components/Grouping/GroupingMenu.js +3 -3
- package/lib/Core/Components/Grouping/GroupingMenu.js.map +1 -1
- package/lib/Core/Components/HeaderCell.d.ts.map +1 -1
- package/lib/Core/Components/HeaderCell.js +5 -2
- package/lib/Core/Components/HeaderCell.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.js +4 -3
- package/lib/Core/Components/HeaderMenu/actions.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.js +2 -2
- package/lib/Core/Components/HeaderMenu/index.js.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js +4 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js +4 -17
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.d.ts +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.js +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.js.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts +20 -9
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.js +89 -65
- package/lib/Core/Components/Toolbar/ColumnSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +4 -2
- package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts +2 -3
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js +92 -44
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js +3 -3
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js +3 -2
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts +2 -2
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js +3 -2
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.js +2 -2
- package/lib/Core/Components/Toolbar/hooks/useMore.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSearch.js +4 -4
- package/lib/Core/Components/Toolbar/hooks/useSearch.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts +6 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js +17 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js.map +1 -0
- package/lib/Core/Components/Toolbar/utils/utils.d.ts +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.js +2 -1
- package/lib/Core/Components/Toolbar/utils/utils.js.map +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.d.ts +97 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js +251 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.d.ts +22 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.js +38 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.d.ts +22 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.js +45 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.d.ts +49 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.js +55 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.d.ts +21 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.js +39 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts +38 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js +62 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts +112 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js +214 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js.map +1 -0
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +8 -5
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
- package/lib/Core/Components/Virtualise/index.js +9 -16
- package/lib/Core/Components/Virtualise/index.js.map +1 -1
- package/lib/Core/Components/Virtualise/utility.d.ts +1 -1
- package/lib/Core/Components/Virtualise/utility.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/utility.js +3 -2
- package/lib/Core/Components/Virtualise/utility.js.map +1 -1
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts +19 -0
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts.map +1 -0
- package/lib/Core/Hooks/a11y/useAnnounce.js +49 -0
- package/lib/Core/Hooks/a11y/useAnnounce.js.map +1 -0
- package/lib/Core/Hooks/useDragDrop.d.ts.map +1 -1
- package/lib/Core/Hooks/useDragDrop.js +2 -0
- package/lib/Core/Hooks/useDragDrop.js.map +1 -1
- package/lib/Core/Hooks/useRepeat.d.ts.map +1 -1
- package/lib/Core/Hooks/useRepeat.js +7 -0
- package/lib/Core/Hooks/useRepeat.js.map +1 -1
- package/lib/Core/Localization/defaultTranslations.d.ts +7 -49
- package/lib/Core/Localization/defaultTranslations.d.ts.map +1 -1
- package/lib/Core/Localization/defaultTranslations.js +8 -50
- package/lib/Core/Localization/defaultTranslations.js.map +1 -1
- package/lib/Core/Test/JUnitMocks.d.ts +6 -617
- package/lib/Core/Test/JUnitMocks.d.ts.map +1 -1
- package/lib/Core/Test/JUnitMocks.js +5 -4
- package/lib/Core/Test/JUnitMocks.js.map +1 -1
- package/lib/Core/Utils/index.d.ts +11 -0
- package/lib/Core/Utils/index.d.ts.map +1 -1
- package/lib/Core/Utils/index.js +20 -8
- package/lib/Core/Utils/index.js.map +1 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js +1 -0
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js.map +1 -1
- package/lib/Core/Views/Gallery/index.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/index.js +7 -4
- package/lib/Core/Views/Gallery/index.js.map +1 -1
- package/lib/Core/Views/Map/index.d.ts.map +1 -1
- package/lib/Core/Views/Map/index.js +9 -3
- package/lib/Core/Views/Map/index.js.map +1 -1
- package/lib/Core/Views/Table/Row.d.ts +3 -1
- package/lib/Core/Views/Table/Row.d.ts.map +1 -1
- package/lib/Core/Views/Table/Row.js +5 -3
- 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 +7 -11
- 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 +27 -4
- 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 +2 -2
- package/lib/Core/Views/Table/index.js.map +1 -1
- package/lib/Core/Views/Table/useCountChange.d.ts +10 -0
- package/lib/Core/Views/Table/useCountChange.d.ts.map +1 -0
- package/lib/Core/Views/Table/useCountChange.js +39 -0
- package/lib/Core/Views/Table/useCountChange.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.d.ts +5 -0
- package/lib/Core/Views/Timeline/Timeline.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.js +28 -0
- package/lib/Core/Views/Timeline/Timeline.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts +24 -0
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.styles.js +182 -0
- package/lib/Core/Views/Timeline/Timeline.styles.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.types.d.ts +50 -0
- package/lib/Core/Views/Timeline/Timeline.types.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.types.js +2 -0
- package/lib/Core/Views/Timeline/Timeline.types.js.map +1 -0
- package/lib/Core/Views/Timeline/TimelineItem.d.ts +12 -0
- package/lib/Core/Views/Timeline/TimelineItem.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/TimelineItem.js +43 -0
- package/lib/Core/Views/Timeline/TimelineItem.js.map +1 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts +4 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js +141 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js.map +1 -0
- package/lib/Core/Views/Timeline/index.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/index.js +12 -6
- package/lib/Core/Views/Timeline/index.js.map +1 -1
- package/lib/Core/Views/Timeline/utility.d.ts +1 -1
- package/lib/Core/Views/Timeline/utility.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/utility.js.map +1 -1
- package/lib/Core/Views/Timeline/utils.d.ts +12 -0
- package/lib/Core/Views/Timeline/utils.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/utils.js +66 -0
- package/lib/Core/Views/Timeline/utils.js.map +1 -0
- package/package.json +7 -8
- package/lib/Core/Components/EmptyContainer.d.ts +0 -5
- package/lib/Core/Components/EmptyContainer.d.ts.map +0 -1
- package/lib/Core/Components/EmptyContainer.js +0 -12
- package/lib/Core/Components/EmptyContainer.js.map +0 -1
- package/lib/Core/Hooks/useSelect.d.ts +0 -9
- package/lib/Core/Hooks/useSelect.d.ts.map +0 -1
- package/lib/Core/Hooks/useSelect.js +0 -24
- package/lib/Core/Hooks/useSelect.js.map +0 -1
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useMemo } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { MenuButton } from '@pega/cosmos-react-core';
|
|
5
|
+
import { ROW_DENSITY } from 'pega-repeating-structures-core';
|
|
6
6
|
import useTranslate from '../../../Hooks/useTranslate';
|
|
7
|
-
const StyledActionMenu = styled.div `
|
|
8
|
-
button {
|
|
9
|
-
/* stylelint-disable unit-allowed-list */
|
|
10
|
-
height: 25px;
|
|
11
|
-
min-height: 25px;
|
|
12
|
-
> svg {
|
|
13
|
-
height: 70%;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
17
7
|
const hydrateActions = (actions, rowContext, refreshRow) => {
|
|
18
8
|
return actions.map(action => ({
|
|
19
9
|
...action,
|
|
@@ -23,7 +13,7 @@ const hydrateActions = (actions, rowContext, refreshRow) => {
|
|
|
23
13
|
}
|
|
24
14
|
}));
|
|
25
15
|
};
|
|
26
|
-
function RowActionMenu({ getRsMeta, getExecutionContext }) {
|
|
16
|
+
function RowActionMenu({ getRsMeta, getExecutionContext, getParentContext }) {
|
|
27
17
|
const [translate] = useTranslate();
|
|
28
18
|
const { getValue, getRowActionDetails, refreshRow } = getExecutionContext();
|
|
29
19
|
const [rowActions, setRowActions] = useState([]);
|
|
@@ -49,15 +39,13 @@ function RowActionMenu({ getRsMeta, getExecutionContext }) {
|
|
|
49
39
|
};
|
|
50
40
|
const rowHeaderValue = getExecutionContext().getRowHeader()?.getValue();
|
|
51
41
|
const translatedActionsText = translate('Actions');
|
|
52
|
-
return (_jsx(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
portal: true
|
|
60
|
-
}, icon: 'more' }) }));
|
|
42
|
+
return (_jsx(MenuButton, { text: translatedActionsText, iconOnly: true, variant: 'simple', compact: getParentContext().getRowDensity() === ROW_DENSITY.SHORT, tabIndex: -1, menu: {
|
|
43
|
+
items: actionsFetched ? rowActions : [],
|
|
44
|
+
emptyText: translate('No actions available'),
|
|
45
|
+
loading: !actionsFetched
|
|
46
|
+
}, "aria-label": rowHeaderValue ? `${translatedActionsText} - ${rowHeaderValue}` : `${translatedActionsText}`, onClick: fetchCaseDeatils, placement: 'bottom-end', popover: {
|
|
47
|
+
portal: true
|
|
48
|
+
}, icon: 'more' }));
|
|
61
49
|
}
|
|
62
50
|
RowActionMenu.propTypes = {
|
|
63
51
|
getRsMeta: PropTypes.func.isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowActionMenu.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowActionMenu.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"RowActionMenu.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowActionMenu.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,U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AqB,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, useMemo } 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';\n\nconst hydrateActions = (actions, rowContext, refreshRow) => {\n return actions.map(action => ({\n ...action,\n primary: action.text,\n onClick: () => {\n action.onClick(rowContext, refreshRow);\n }\n }));\n};\n\nfunction RowActionMenu({ getRsMeta, getExecutionContext, getParentContext }) {\n const [translate] = useTranslate();\n const { getValue, getRowActionDetails, refreshRow } = getExecutionContext();\n const [rowActions, setRowActions] = useState([]);\n const [actionsFetched, setActionsFetched] = useState(false);\n const rowContext = getValue();\n const { rowActions: tableMetaRowActions } = getRsMeta();\n const staticActions = useMemo(\n () => hydrateActions(tableMetaRowActions ?? [], rowContext, refreshRow.bind(null, rowContext)),\n [rowContext]\n );\n\n const fetchCaseDeatils = () => {\n setActionsFetched(false);\n const currentRowContext = getExecutionContext()?.getValue();\n getRowActionDetails(currentRowContext)\n .then(response => {\n if (Array.isArray(response)) {\n const latestRowContext = getExecutionContext()?.getValue();\n const actions = hydrateActions(\n response,\n latestRowContext,\n refreshRow.bind(null, latestRowContext)\n );\n const arr = [...actions, ...staticActions];\n setRowActions(arr);\n }\n })\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={fetchCaseDeatils}\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,6 +1,7 @@
|
|
|
1
1
|
export default RowDragDropHandle;
|
|
2
|
-
declare function RowDragDropHandle({ getExecutionContext }: {
|
|
2
|
+
declare function RowDragDropHandle({ getExecutionContext, getParentContext }: {
|
|
3
3
|
getExecutionContext: any;
|
|
4
|
+
getParentContext: any;
|
|
4
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
declare namespace RowDragDropHandle {
|
|
6
7
|
namespace propTypes {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowDragDropHandle.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RowDragDropHandle.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.jsx"],"names":[],"mappings":";AAKA;;;4CAWC;;;;;;sBAhBqB,YAAY"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Icon,
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { Icon, Button } from '@pega/cosmos-react-core';
|
|
4
|
+
import { ROW_DENSITY } from 'pega-repeating-structures-core';
|
|
5
|
+
function RowDragDropHandle({ getExecutionContext, getParentContext }) {
|
|
6
|
+
return (_jsx(Button, { variant: 'simple', compact: getParentContext().getRowDensity() === ROW_DENSITY.SHORT, icon: true, ...getExecutionContext?.().getDragProps?.(), children: _jsx(Icon, { name: 'drag' }) }));
|
|
6
7
|
}
|
|
7
8
|
RowDragDropHandle.propTypes = {
|
|
8
9
|
getExecutionContext: PropTypes.func.isRequired
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowDragDropHandle.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"RowDragDropHandle.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,SAAS,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,gBAAgB,EAAE;IAClE,OAAO,CACL,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,gBAAgB,EAAE,CAAC,aAAa,EAAE,KAAK,WAAW,CAAC,KAAK,EACjE,IAAI,WACA,mBAAmB,EAAE,EAAE,CAAC,YAAY,EAAE,EAAE,YAE5C,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,CACV,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,SAAS,GAAG;IAC5B,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CAC/C,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { Icon, Button } from '@pega/cosmos-react-core';\nimport { ROW_DENSITY } from 'pega-repeating-structures-core';\n\nfunction RowDragDropHandle({ getExecutionContext, getParentContext }) {\n return (\n <Button\n variant='simple'\n compact={getParentContext().getRowDensity() === ROW_DENSITY.SHORT}\n icon\n {...getExecutionContext?.().getDragProps?.()}\n >\n <Icon name='drag' />\n </Button>\n );\n}\n\nRowDragDropHandle.propTypes = {\n getExecutionContext: PropTypes.func.isRequired\n};\n\nexport default RowDragDropHandle;\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export default RowError;
|
|
2
|
-
declare function RowError({ getExecutionContext }: {
|
|
2
|
+
declare function RowError({ getExecutionContext, getParentContext }: {
|
|
3
3
|
getExecutionContext: any;
|
|
4
|
+
getParentContext: any;
|
|
4
5
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
5
6
|
declare namespace RowError {
|
|
6
7
|
namespace propTypes {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowError.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowError.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RowError.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowError.jsx"],"names":[],"mappings":";AAKA;;;mDAeC;;;;;;sBApBqB,YAAY"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Icon, Tooltip,
|
|
4
|
-
|
|
3
|
+
import { Icon, Tooltip, useElement, Button } from '@pega/cosmos-react-core';
|
|
4
|
+
import { ROW_DENSITY } from 'pega-repeating-structures-core';
|
|
5
|
+
function RowError({ getExecutionContext, getParentContext }) {
|
|
5
6
|
const [avatarEl, setAvatarEl] = useElement(null);
|
|
6
7
|
const message = getExecutionContext().getRowError()?.message;
|
|
7
|
-
return message ? (_jsxs(
|
|
8
|
+
return message ? (_jsxs(Button, { variant: 'simple', icon: true, compact: getParentContext().getRowDensity() === ROW_DENSITY.SHORT, children: [_jsx(Icon, { ref: setAvatarEl, name: 'warn-solid', "aria-label": message }), _jsx(Tooltip, { target: avatarEl, showDelay: 'none', hideDelay: 'none', describeTarget: false, children: getExecutionContext().getRowError()?.message })] })) : null;
|
|
8
9
|
}
|
|
9
10
|
RowError.propTypes = {
|
|
10
11
|
getExecutionContext: PropTypes.func.isRequired
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowError.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowError.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"RowError.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/RowError.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,SAAS,QAAQ,CAAC,EAAE,mBAAmB,EAAE,gBAAgB,EAAE;IACzD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC,WAAW,EAAE,EAAE,OAAO,CAAC;IAC7D,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,MAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,gBAAgB,EAAE,CAAC,aAAa,EAAE,KAAK,WAAW,CAAC,KAAK,aAEjE,KAAC,IAAI,IAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAC,YAAY,gBAAa,OAAO,GAAI,EACjE,KAAC,OAAO,IAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,EAAC,cAAc,EAAE,KAAK,YAC/E,mBAAmB,EAAE,CAAC,WAAW,EAAE,EAAE,OAAO,GACrC,IACH,CACV,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,QAAQ,CAAC,SAAS,GAAG;IACnB,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CAC/C,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { Icon, Tooltip, useElement, Button } from '@pega/cosmos-react-core';\nimport { ROW_DENSITY } from 'pega-repeating-structures-core';\n\nfunction RowError({ getExecutionContext, getParentContext }) {\n const [avatarEl, setAvatarEl] = useElement(null);\n const message = getExecutionContext().getRowError()?.message;\n return message ? (\n <Button\n variant='simple'\n icon\n compact={getParentContext().getRowDensity() === ROW_DENSITY.SHORT}\n >\n <Icon ref={setAvatarEl} name='warn-solid' aria-label={message} />\n <Tooltip target={avatarEl} showDelay='none' hideDelay='none' describeTarget={false}>\n {getExecutionContext().getRowError()?.message}\n </Tooltip>\n </Button>\n ) : null;\n}\n\nRowError.propTypes = {\n getExecutionContext: PropTypes.func.isRequired\n};\n\nexport default RowError;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/EmptyContainer.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"EmptyContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/EmptyContainer.jsx"],"names":[],"mappings":";AAsBA;;4CASC"}
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { defaultThemeProp, EmptyState } from '@pega/cosmos-react-core';
|
|
4
4
|
import TestIdConstants from '../TestIdConstants';
|
|
5
|
-
import useTranslate from '../../Hooks/useTranslate';
|
|
6
5
|
const EmptyContainerStyle = styled.div `
|
|
7
6
|
position: absolute;
|
|
8
7
|
display: flex;
|
|
@@ -17,9 +16,8 @@ const EmptyContainerStyle = styled.div `
|
|
|
17
16
|
overflow: hidden;
|
|
18
17
|
`;
|
|
19
18
|
EmptyContainerStyle.defaultProps = defaultThemeProp;
|
|
20
|
-
const EmptyContainer = () => {
|
|
21
|
-
|
|
22
|
-
return (_jsx(EmptyContainerStyle, { "data-test-id": TestIdConstants.noRecords, "data-testid": TestIdConstants.noRecords, children: _jsx(EmptyState, { message: translate('No records found.') }) }));
|
|
19
|
+
const EmptyContainer = ({ message }) => {
|
|
20
|
+
return (_jsx(EmptyContainerStyle, { "data-test-id": TestIdConstants.noRecords, "data-testid": TestIdConstants.noRecords, children: _jsx(EmptyState, { message: message }) }));
|
|
23
21
|
};
|
|
24
22
|
export default EmptyContainer;
|
|
25
23
|
//# sourceMappingURL=EmptyContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyContainer.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/EmptyContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,eAAe,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"EmptyContainer.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/EmptyContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAEjD,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;gBAUtB,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;;CAEtE,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IACrC,OAAO,CACL,KAAC,mBAAmB,oBACJ,eAAe,CAAC,SAAS,iBAC1B,eAAe,CAAC,SAAS,YAEtC,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,GAAI,GACZ,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import styled from 'styled-components';\n\nimport { defaultThemeProp, EmptyState } from '@pega/cosmos-react-core';\n\nimport TestIdConstants from '../TestIdConstants';\n\nconst EmptyContainerStyle = styled.div`\n position: absolute;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n top: var(--row-height, 0);\n left: 0;\n right: 0;\n bottom: 0;\n background: ${props => props.theme.base.palette['primary-background']};\n overflow: hidden;\n`;\n\nEmptyContainerStyle.defaultProps = defaultThemeProp;\n\nconst EmptyContainer = ({ message }) => {\n return (\n <EmptyContainerStyle\n data-test-id={TestIdConstants.noRecords}\n data-testid={TestIdConstants.noRecords}\n >\n <EmptyState message={message} />\n </EmptyContainerStyle>\n );\n};\n\nexport default EmptyContainer;\n"]}
|
|
@@ -63,7 +63,9 @@ declare const _default: {
|
|
|
63
63
|
sortRenderer: typeof sort;
|
|
64
64
|
filterRenderer: typeof Filter;
|
|
65
65
|
headerCellRenderer: typeof HeaderCell;
|
|
66
|
-
emptyContainerRenderer: (
|
|
66
|
+
emptyContainerRenderer: ({ message }: {
|
|
67
|
+
message: any;
|
|
68
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
67
69
|
loadingIndicator: typeof LoadingIndicator;
|
|
68
70
|
rowHeightRenderer: typeof RowHeightRenderer;
|
|
69
71
|
personalizationSelectorRenderer: typeof personalizationSelectorRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/index.jsx"],"names":[],"mappings":"AA8BA,uGAKC;;;;;;;;;;AAUD,mGASC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/index.jsx"],"names":[],"mappings":"AA8BA,uGAKC;;;;;;;;;;AAUD,mGASC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAtDqB,YAAY;iBAEjB,QAAQ;mBACN,UAAU;uBAEN,cAAc;6BAGR,oBAAoB;8BACnB,aAAa;4CAEC,2BAA2B;8CACzB,6BAA6B;8BAC7C,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonFilter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Filters/CommonFilter.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommonFilter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Filters/CommonFilter.jsx"],"names":[],"mappings":"AAgBA;;;;;4CA2GC;;;;;;;;;;;sBA3HqB,YAAY"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useState, useCallback, useEffect } from 'react';
|
|
4
4
|
import { Select, Option, Flex, FormDialog } from '@pega/cosmos-react-core';
|
|
5
|
-
import { addFilter, getFilterInitializers, comparatorMap } from 'pega-repeating-structures-core';
|
|
5
|
+
import { addFilter, getFilterInitializers, comparatorMap, FieldType } from 'pega-repeating-structures-core';
|
|
6
6
|
import useTranslate from '../../Hooks/useTranslate';
|
|
7
7
|
import InputWrapper from './InputWrapper';
|
|
8
8
|
import useFilterSubmit from './Hooks/useFilterSubmit';
|
|
@@ -47,7 +47,7 @@ export default function CommonFilter({ column, onFilter, finishPopOver, popoverB
|
|
|
47
47
|
};
|
|
48
48
|
// eslint-disable-next-line sonarjs/no-small-switch
|
|
49
49
|
switch (column.field.type) {
|
|
50
|
-
case
|
|
50
|
+
case FieldType.NUMBER: {
|
|
51
51
|
content = (_jsx(InputWrapper, { id: `${column.field.name}`, type: 'number', onChange: onNumberChange, onKeyDown: handleSubmitHandler, style: { width: '100%' }, label: translate('Filter value'), value: filterInput }));
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonFilter.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/CommonFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,
|
|
1
|
+
{"version":3,"file":"CommonFilter.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/CommonFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,aAAa,EACb,SAAS,EACV,MAAM,gCAAgC,CAAC;AAExC,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,eAAe,MAAM,yBAAyB,CAAC;AAEtD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa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,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useState, useCallback, useEffect } from 'react';\n\nimport { Select, Option, Flex, FormDialog } from '@pega/cosmos-react-core';\nimport {\n addFilter,\n getFilterInitializers,\n comparatorMap,\n FieldType\n} from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport InputWrapper from './InputWrapper';\nimport useFilterSubmit from './Hooks/useFilterSubmit';\n\nexport default function CommonFilter({ column, onFilter, finishPopOver, popoverButtonRef }) {\n const params = column.field.filterParams || [];\n const [fInput, fValue, filter, filterExpression] = getFilterInitializers(column);\n const [filterInput, setFilterInput] = useState(fInput);\n const [comparator, setComparator] = useState(fValue);\n const [translate] = useTranslate();\n let content = null;\n useEffect(() => {\n /* Safe check for params */\n if (params?.[0]?.key && !comparator) setComparator(params[0].key);\n }, []);\n\n const submitFilter = useCallback(() => {\n /* Sending filter expression */\n const newFilterExpression = addFilter({\n filterExpression: filter ? null : filterExpression,\n column,\n comparator: comparatorMap[comparator],\n input: filterInput\n });\n onFilter({\n filterExp: newFilterExpression\n });\n }, [filter, filterExpression, column, comparator, filterInput, onFilter]);\n\n const onFilterChange = useCallback(({ value: comparatorType }) => {\n setComparator(comparatorType);\n }, []);\n\n const applyFilter = useFilterSubmit({ finishPopOver, submitFilter });\n\n const onTextChange = useCallback(value => {\n setFilterInput(value);\n }, []);\n\n const onNumberChange = useCallback(value => {\n setFilterInput(parseFloat(value));\n }, []);\n\n const handleSubmitHandler = e => {\n if (e.key === 'Enter') {\n applyFilter();\n }\n };\n\n // eslint-disable-next-line sonarjs/no-small-switch\n switch (column.field.type) {\n case FieldType.NUMBER: {\n content = (\n <InputWrapper\n id={`${column.field.name}`}\n type='number'\n onChange={onNumberChange}\n onKeyDown={handleSubmitHandler}\n style={{ width: '100%' }}\n label={translate('Filter value')}\n value={filterInput}\n />\n );\n break;\n }\n default: {\n content = (\n <InputWrapper\n id={`${column.field.name}`}\n type='text'\n onChange={onTextChange}\n onKeyDown={handleSubmitHandler}\n style={{ width: '100%' }}\n label={translate('Filter value')}\n value={filterInput}\n />\n );\n break;\n }\n }\n\n return (\n <>\n {popoverButtonRef.current ? (\n <FormDialog\n heading={translate('Filter column')}\n onSubmit={applyFilter}\n onCancel={finishPopOver}\n target={popoverButtonRef.current}\n >\n <Flex container={{ direction: 'column', wrap: 'no-wrap', itemGap: 1 }}>\n <Flex item>\n <Select\n defaultValue={comparator}\n onChange={e => onFilterChange({ value: e.target.value })}\n id={`select-${column.field.name}`}\n label={translate('Filter comparison')}\n >\n {params.map(opt => (\n <Option key={opt.key} value={opt.key}>\n {translate(opt.value)}\n </Option>\n ))}\n </Select>\n </Flex>\n <Flex item>{content}</Flex>\n </Flex>\n </FormDialog>\n ) : null}\n </>\n );\n}\n\nCommonFilter.propTypes = {\n column: PropTypes.objectOf(PropTypes.any).isRequired,\n finishPopOver: PropTypes.func.isRequired,\n onFilter: PropTypes.func.isRequired\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { getFilterConditions } from 'pega-repeating-structures-core';
|
|
3
|
+
import { getFilterConditions, FieldType } from 'pega-repeating-structures-core';
|
|
4
4
|
import AdvanceFilter from './AdvanceFilter';
|
|
5
5
|
import SelectFilter from './SelectFilter';
|
|
6
6
|
import SimpleFilter from './SimpleFilter';
|
|
@@ -17,12 +17,12 @@ export default function FilterType({ column, onFilter, finishPopOver, popoverBut
|
|
|
17
17
|
if (column.field.filterPickList) {
|
|
18
18
|
return (_jsx(SelectFilter, { column: column, onFilter: onFilter, finishPopOver: finishPopOver, popoverButtonRef: popoverButtonRef }));
|
|
19
19
|
}
|
|
20
|
-
if (column.field.type ===
|
|
21
|
-
column.field.type ===
|
|
22
|
-
column.field.type ===
|
|
20
|
+
if (column.field.type === FieldType.DATE ||
|
|
21
|
+
column.field.type === FieldType.DATE_TIME ||
|
|
22
|
+
column.field.type === FieldType.TIME) {
|
|
23
23
|
return (_jsx(SimpleFilter, { column: column, onFilter: onFilter, finishPopOver: finishPopOver, popoverButtonRef: popoverButtonRef }));
|
|
24
24
|
}
|
|
25
|
-
if (column.field.type ===
|
|
25
|
+
if (column.field.type === FieldType.BOOLEAN) {
|
|
26
26
|
return (_jsx(BooleanFilter, { column: column, onFilter: onFilter, finishPopOver: finishPopOver, popoverButtonRef: popoverButtonRef }));
|
|
27
27
|
}
|
|
28
28
|
return (_jsx(CommonFilter, { column: column, onFilter: onFilter, finishPopOver: finishPopOver, popoverButtonRef: popoverButtonRef }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterType.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/FilterType.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterType.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/FilterType.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE;IACtF,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,gBAAgB,GAAG,MAAM,EAAE,mBAAmB,EAAE,EAAE,gBAAgB,CAAC;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,CAAC;AAED,UAAU,CAAC,SAAS,GAAG;IACrB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IACzC,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { getFilterConditions, FieldType } from 'pega-repeating-structures-core';\n\nimport AdvanceFilter from './AdvanceFilter';\nimport SelectFilter from './SelectFilter';\nimport SimpleFilter from './SimpleFilter';\nimport CommonFilter from './CommonFilter';\nimport BooleanFilter from './BooleanFilter';\n\nexport default function FilterType({ column, onFilter, finishPopOver, popoverButtonRef }) {\n if (!column) return null;\n\n const filterExpression = column?.getFilterProperties()?.filterExpression;\n const filters = getFilterConditions({ filterExpression });\n\n if (filters.length >= 2) {\n return (\n <AdvanceFilter\n view={column.parent}\n setShowFilter={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n }\n\n if (column.field.filterPickList) {\n return (\n <SelectFilter\n column={column}\n onFilter={onFilter}\n finishPopOver={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n }\n if (\n column.field.type === FieldType.DATE ||\n column.field.type === FieldType.DATE_TIME ||\n column.field.type === FieldType.TIME\n ) {\n return (\n <SimpleFilter\n column={column}\n onFilter={onFilter}\n finishPopOver={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n }\n if (column.field.type === FieldType.BOOLEAN) {\n return (\n <BooleanFilter\n column={column}\n onFilter={onFilter}\n finishPopOver={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n }\n\n return (\n <CommonFilter\n column={column}\n onFilter={onFilter}\n finishPopOver={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n}\n\nFilterType.propTypes = {\n column: PropTypes.objectOf(PropTypes.any),\n finishPopOver: PropTypes.func.isRequired,\n onFilter: PropTypes.func.isRequired\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectFilter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Filters/SelectFilter.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectFilter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Filters/SelectFilter.jsx"],"names":[],"mappings":"AA6BA;;;;;4CA8JC;;;;;;;;;;;sBA3LqB,YAAY"}
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { Checkbox, CheckboxGroup, Flex, Select, Option, FormDialog } from '@pega/cosmos-react-core';
|
|
6
|
-
import { addFilter, getFilterInitializers, comparatorMap } from 'pega-repeating-structures-core';
|
|
6
|
+
import { addFilter, getFilterInitializers, comparatorMap, FieldType } from 'pega-repeating-structures-core';
|
|
7
7
|
import LoadingIndicator from '../LoadingIndicator';
|
|
8
8
|
import RenderingEngine from '../RenderingEngine/RenderCell';
|
|
9
9
|
import useTranslate from '../../Hooks/useTranslate';
|
|
@@ -80,7 +80,7 @@ export default function SelectFilter({ column, finishPopOver, onFilter, popoverB
|
|
|
80
80
|
const onSelectOrDeselect = useCallback(event => {
|
|
81
81
|
/* Disabling operators like isAnyOf isNoneOf */
|
|
82
82
|
const { value, checked } = event.target;
|
|
83
|
-
const inputValue = column.field.type ===
|
|
83
|
+
const inputValue = column.field.type === FieldType.NUMBER ? parseFloat(value) : value;
|
|
84
84
|
/* collecting set of unique values to sent with different operators */
|
|
85
85
|
if (checked)
|
|
86
86
|
setSelectedValues(selectedValues
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectFilter.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/SelectFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAA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L,CACtB,IACU,CACd,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,SAAS,GAAG;IACvB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useState, useEffect, useCallback } from 'react';\nimport styled from 'styled-components';\n\nimport { Checkbox, CheckboxGroup, Flex, Select, Option, FormDialog } from '@pega/cosmos-react-core';\nimport { addFilter, getFilterInitializers, comparatorMap } from 'pega-repeating-structures-core';\n\nimport LoadingIndicator from '../LoadingIndicator';\nimport RenderingEngine from '../RenderingEngine/RenderCell';\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst LoadingIndicatorStyle = styled.div`\n position: absolute;\n margin: auto;\n left: 0;\n right: 0;\n`;\n\nconst CheckboxGroupStyle = styled.div`\n max-height: 11.719rem;\n overflow: auto;\n margin-top: 0.5rem;\n`;\n\nexport default function SelectFilter({ column, finishPopOver, onFilter, popoverButtonRef }) {\n const [fInput, fValue, , filterExpression] = getFilterInitializers(column);\n const [uniqueValues, setUniqueColumnValues] = useState([]);\n const [uniqueValuesFetched, setUniqueValuesFetched] = useState(false);\n // Prepopulate the select filter with values only when global filter condition matches with condition in select filter.\n const prePopulateSelectFilter = column.field.filterParams.some(\n filterParam => filterParam.key === fValue\n );\n const [selectedValues, setSelectedValues] = useState(prePopulateSelectFilter ? fInput : []);\n const [comparator, setComparator] = useState(fValue);\n\n const syncUniqueValues = useCallback(() => {\n if (!uniqueValuesFetched)\n column.getUniqueValues().then(filteredData => {\n setUniqueValuesFetched(true);\n setUniqueColumnValues(filteredData);\n });\n }, [column, uniqueValuesFetched]);\n const [translate] = useTranslate();\n useEffect(() => {\n const resultSet = new Set();\n column.data.forEach(d => {\n if (d) resultSet.add(d);\n });\n setUniqueColumnValues([...resultSet]);\n }, [column]);\n\n // set the comparator as 1st option by default only if global filter criteria does not match with select filter (prepopulateSelectFilter)\n useEffect(() => {\n if (!prePopulateSelectFilter && column.field.filterParams?.[0]?.key)\n setComparator(column.field.filterParams[0].key);\n // Should be call only on initial load thats why empty dependencies\n }, []);\n\n useEffect(() => {\n if (!column.field?.filterParams?.find(item => item.key !== 'select')) return;\n syncUniqueValues();\n }, [column, syncUniqueValues]);\n\n const onFilterChange = useCallback(({ value: comparatorType }) => {\n setComparator(comparatorType);\n }, []);\n\n const submitFilter = useCallback(() => {\n const formattedComp = comparatorMap[comparator];\n let localFilterExpression = null;\n const input =\n formattedComp === comparatorMap.isNull || formattedComp === comparatorMap.isNotNull\n ? null\n : selectedValues;\n localFilterExpression = addFilter({\n // Ignore the initial filter expression if prePopulateSelectFilter is true as user has chosen to override it.\n filterExpression: prePopulateSelectFilter ? null : filterExpression,\n comparator: formattedComp,\n column,\n input\n });\n onFilter({\n filterExp: localFilterExpression\n });\n finishPopOver();\n }, [comparator, selectedValues, filterExpression, column, onFilter, prePopulateSelectFilter]);\n\n const isSelected = useCallback(\n value => {\n return new Set(selectedValues).has(value);\n },\n [selectedValues]\n );\n\n const onSelectOrDeselect = useCallback(\n event => {\n /* Disabling operators like isAnyOf isNoneOf */\n const { value, checked } = event.target;\n const inputValue = column.field.type === 'number' ? parseFloat(value) : value;\n /* collecting set of unique values to sent with different operators */\n if (checked)\n setSelectedValues(\n selectedValues\n ? [...new Set([inputValue, ...selectedValues])]\n : [...new Set([inputValue])]\n );\n else {\n const index = selectedValues.findIndex(val => val === inputValue);\n const values = selectedValues.slice(0, index).concat(selectedValues.slice(index + 1));\n setSelectedValues(values);\n }\n },\n [column, selectedValues]\n );\n\n // show unique values checkboxes for selection only if comparator is other than 'IS_NULL' and 'IS_NOT_NULL'\n const showUniqueValues = ![comparatorMap.isNull, comparatorMap.isNotNull].includes(\n comparatorMap[comparator]\n );\n\n return (\n <>\n {popoverButtonRef.current ? (\n <FormDialog\n heading={translate('Filter column')}\n onSubmit={submitFilter}\n onCancel={finishPopOver}\n target={popoverButtonRef.current}\n >\n <Flex>\n <Select\n defaultValue={comparator}\n onChange={e => onFilterChange({ value: e.target.value })}\n >\n {(column.field.filterParams || []).map(opt => (\n <Option key={opt.key} value={opt.key}>\n {translate(opt.value)}\n </Option>\n ))}\n </Select>\n </Flex>\n {showUniqueValues && (\n <CheckboxGroupStyle className='popup-menu'>\n <CheckboxGroup>\n {uniqueValues.map(item => {\n const isItemSelected = isSelected(item);\n // Custom context prepared for Rendering engine should contain getExecutionContext\n // otherwise the execution context will be populated wrongly from the previous table rendering cycle.\n // For Select filter execution context should be derived from unique values that are displayed in the modal.\n const context = {\n getExecutionContext: () => {\n return {\n getValue: () => ({ [column.field.name]: item }),\n name: 'selectFilter'\n };\n },\n getValue: () => item\n };\n return (\n <Checkbox\n key={item}\n id={item}\n defaultChecked={isItemSelected}\n name={item}\n onClick={onSelectOrDeselect}\n value={item}\n label={\n <RenderingEngine {...column.getRenderingEngineProps()} context={context} />\n }\n />\n );\n })}\n </CheckboxGroup>\n <LoadingIndicatorStyle>\n <LoadingIndicator view={column.parent} show={!uniqueValuesFetched} />\n </LoadingIndicatorStyle>\n </CheckboxGroupStyle>\n )}\n </FormDialog>\n ) : null}\n </>\n );\n}\n\nSelectFilter.propTypes = {\n column: PropTypes.objectOf(PropTypes.any).isRequired,\n finishPopOver: PropTypes.func.isRequired,\n onFilter: PropTypes.func.isRequired\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SelectFilter.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/SelectFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,QAAQ,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YAAY,CAAC,SAAS,GAAG;IACvB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useState, useEffect, useCallback } from 'react';\nimport styled from 'styled-components';\n\nimport { Checkbox, CheckboxGroup, Flex, Select, Option, FormDialog } from '@pega/cosmos-react-core';\nimport {\n addFilter,\n getFilterInitializers,\n comparatorMap,\n FieldType\n} from 'pega-repeating-structures-core';\n\nimport LoadingIndicator from '../LoadingIndicator';\nimport RenderingEngine from '../RenderingEngine/RenderCell';\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst LoadingIndicatorStyle = styled.div`\n position: absolute;\n margin: auto;\n left: 0;\n right: 0;\n`;\n\nconst CheckboxGroupStyle = styled.div`\n max-height: 11.719rem;\n overflow: auto;\n margin-top: 0.5rem;\n`;\n\nexport default function SelectFilter({ column, finishPopOver, onFilter, popoverButtonRef }) {\n const [fInput, fValue, , filterExpression] = getFilterInitializers(column);\n const [uniqueValues, setUniqueColumnValues] = useState([]);\n const [uniqueValuesFetched, setUniqueValuesFetched] = useState(false);\n // Prepopulate the select filter with values only when global filter condition matches with condition in select filter.\n const prePopulateSelectFilter = column.field.filterParams.some(\n filterParam => filterParam.key === fValue\n );\n const [selectedValues, setSelectedValues] = useState(prePopulateSelectFilter ? fInput : []);\n const [comparator, setComparator] = useState(fValue);\n\n const syncUniqueValues = useCallback(() => {\n if (!uniqueValuesFetched)\n column.getUniqueValues().then(filteredData => {\n setUniqueValuesFetched(true);\n setUniqueColumnValues(filteredData);\n });\n }, [column, uniqueValuesFetched]);\n const [translate] = useTranslate();\n useEffect(() => {\n const resultSet = new Set();\n column.data.forEach(d => {\n if (d) resultSet.add(d);\n });\n setUniqueColumnValues([...resultSet]);\n }, [column]);\n\n // set the comparator as 1st option by default only if global filter criteria does not match with select filter (prepopulateSelectFilter)\n useEffect(() => {\n if (!prePopulateSelectFilter && column.field.filterParams?.[0]?.key)\n setComparator(column.field.filterParams[0].key);\n // Should be call only on initial load thats why empty dependencies\n }, []);\n\n useEffect(() => {\n if (!column.field?.filterParams?.find(item => item.key !== 'select')) return;\n syncUniqueValues();\n }, [column, syncUniqueValues]);\n\n const onFilterChange = useCallback(({ value: comparatorType }) => {\n setComparator(comparatorType);\n }, []);\n\n const submitFilter = useCallback(() => {\n const formattedComp = comparatorMap[comparator];\n let localFilterExpression = null;\n const input =\n formattedComp === comparatorMap.isNull || formattedComp === comparatorMap.isNotNull\n ? null\n : selectedValues;\n localFilterExpression = addFilter({\n // Ignore the initial filter expression if prePopulateSelectFilter is true as user has chosen to override it.\n filterExpression: prePopulateSelectFilter ? null : filterExpression,\n comparator: formattedComp,\n column,\n input\n });\n onFilter({\n filterExp: localFilterExpression\n });\n finishPopOver();\n }, [comparator, selectedValues, filterExpression, column, onFilter, prePopulateSelectFilter]);\n\n const isSelected = useCallback(\n value => {\n return new Set(selectedValues).has(value);\n },\n [selectedValues]\n );\n\n const onSelectOrDeselect = useCallback(\n event => {\n /* Disabling operators like isAnyOf isNoneOf */\n const { value, checked } = event.target;\n const inputValue = column.field.type === FieldType.NUMBER ? parseFloat(value) : value;\n /* collecting set of unique values to sent with different operators */\n if (checked)\n setSelectedValues(\n selectedValues\n ? [...new Set([inputValue, ...selectedValues])]\n : [...new Set([inputValue])]\n );\n else {\n const index = selectedValues.findIndex(val => val === inputValue);\n const values = selectedValues.slice(0, index).concat(selectedValues.slice(index + 1));\n setSelectedValues(values);\n }\n },\n [column, selectedValues]\n );\n\n // show unique values checkboxes for selection only if comparator is other than 'IS_NULL' and 'IS_NOT_NULL'\n const showUniqueValues = ![comparatorMap.isNull, comparatorMap.isNotNull].includes(\n comparatorMap[comparator]\n );\n\n return (\n <>\n {popoverButtonRef.current ? (\n <FormDialog\n heading={translate('Filter column')}\n onSubmit={submitFilter}\n onCancel={finishPopOver}\n target={popoverButtonRef.current}\n >\n <Flex>\n <Select\n defaultValue={comparator}\n onChange={e => onFilterChange({ value: e.target.value })}\n >\n {(column.field.filterParams || []).map(opt => (\n <Option key={opt.key} value={opt.key}>\n {translate(opt.value)}\n </Option>\n ))}\n </Select>\n </Flex>\n {showUniqueValues && (\n <CheckboxGroupStyle className='popup-menu'>\n <CheckboxGroup>\n {uniqueValues.map(item => {\n const isItemSelected = isSelected(item);\n // Custom context prepared for Rendering engine should contain getExecutionContext\n // otherwise the execution context will be populated wrongly from the previous table rendering cycle.\n // For Select filter execution context should be derived from unique values that are displayed in the modal.\n const context = {\n getExecutionContext: () => {\n return {\n getValue: () => ({ [column.field.name]: item }),\n name: 'selectFilter'\n };\n },\n getValue: () => item\n };\n return (\n <Checkbox\n key={item}\n id={item}\n defaultChecked={isItemSelected}\n name={item}\n onClick={onSelectOrDeselect}\n value={item}\n label={\n <RenderingEngine {...column.getRenderingEngineProps()} context={context} />\n }\n />\n );\n })}\n </CheckboxGroup>\n <LoadingIndicatorStyle>\n <LoadingIndicator view={column.parent} show={!uniqueValuesFetched} />\n </LoadingIndicatorStyle>\n </CheckboxGroupStyle>\n )}\n </FormDialog>\n ) : null}\n </>\n );\n}\n\nSelectFilter.propTypes = {\n column: PropTypes.objectOf(PropTypes.any).isRequired,\n finishPopOver: PropTypes.func.isRequired,\n onFilter: PropTypes.func.isRequired\n};\n"]}
|
|
@@ -11,5 +11,21 @@ declare namespace GroupHeader {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
export default GroupHeader;
|
|
14
|
+
/**
|
|
15
|
+
* Formats additional field data based on its type and properties.
|
|
16
|
+
*/
|
|
17
|
+
export type AdditionalFieldData = NonNullable<Awaited<ReturnType<NonNullable<import("pega-repeating-structures-core").RsCoreTypes.ApiContext["fetchGroupedInfo"]>>>[number]["additionalFieldsData"]>[number];
|
|
18
|
+
/**
|
|
19
|
+
* Formats additional field data based on its type and properties.
|
|
20
|
+
*/
|
|
21
|
+
export type Column = import("pega-repeating-structures-core").RsCoreTypes.Column;
|
|
22
|
+
/**
|
|
23
|
+
* Formats additional field data based on its type and properties.
|
|
24
|
+
*/
|
|
25
|
+
export type Meta = import("pega-repeating-structures-core").RsCoreTypes.Meta;
|
|
26
|
+
/**
|
|
27
|
+
* Formats additional field data based on its type and properties.
|
|
28
|
+
*/
|
|
29
|
+
export type GroupGenerator = import("pega-repeating-structures-core").RsCoreTypes.GroupGenerator;
|
|
14
30
|
import PropTypes from 'prop-types';
|
|
15
31
|
//# sourceMappingURL=GroupRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupRenderer.d.ts","sourceRoot":"","sources":["../../../Core/Components/GroupRenderer.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GroupRenderer.d.ts","sourceRoot":"","sources":["../../../Core/Components/GroupRenderer.jsx"],"names":[],"mappings":"AAoYA;;;mDAqIC;;;;;;;;;;;;;kCAxVY,WAAW,CACnB,OAAO,CACL,UAAU,CACR,WAAW,CACnB,OAAiB,gCAAgC,EAAE,WAAW,CAAC,UAAU,CAAC,kBAAkB,CAAC,CACpF,CACF,CACF,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAClC,CAAC,MAAM,CAAC;;;;qBAEC,OAAO,gCAAgC,EAAE,WAAW,CAAC,MAAM;;;;mBAC3D,OAAO,gCAAgC,EAAE,WAAW,CAAC,IAAI;;;;6BACzD,OAAO,gCAAgC,EAAE,WAAW,CAAC,cAAc;sBA7L1D,YAAY"}
|