@pega/lists-react 9.25.1-3 → 9.25.1-4
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/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/RowSelectHandle.js +9 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowSelectHandle.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/Virtualise/VirtualizeInfinite.js +4 -2
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
- package/lib/Core/Components/Virtualise/index.js +5 -3
- 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 +49 -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/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 +24 -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 +74 -24
- 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/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/package.json +8 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMasterDetailHost.js","sourceRoot":"","sources":["../../../../Core/Views/Table/useMasterDetailHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAMpC,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAE1D,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAe9D,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,IAAI,EACJ,OAAO,EACmB;IAC1B,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC9B,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IAClD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IACjF,MAAM,UAAU,GAAG,YAAY,EAAE,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;IACpD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC5E,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAChF,MAAM,EAAE,qBAAqB,EAAE,GAAG,sBAAsB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAEzE,MAAM,iBAAiB,GAAG,WAAW,CAAC,GA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CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;YAC3E,IAAI,EAAE,kBAAkB,EAAE,IAAI;SAC/B;QACH,CAAC,CAAC,SAAS,CAAC;IACd,OAAO;QACL,MAAM,EAAE,uBAAuB,CAAC;YAC9B,IAAI;YACJ,YAAY;YACZ,mBAAmB;YACnB,qBAAqB;SACtB,CAAC;QACF,iBAAiB,EAAE;YACjB,IAAI,EAAE,CAAC,CAAC,YAAY;YACpB,SAAS;YACT,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;YAC9C,YAAY;YACZ,OAAO,EAAE,iBAAiB;SAC3B;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport type { ReactNode } from 'react';\n\nimport type { MasterDetailProps } from '@pega/cosmos-react-work';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\nimport fetchRowActions from '../../Utils/fetchRowActions';\n\nimport useMasterDetailState from './useMasterDetailState';\nimport useMasterDetailRenderer from './useMasterDetailRenderer';\nimport useMasterDetailCleanup from './useMasterDetailCleanup';\n\ninterface UseMasterDetailHostParams {\n view: RsCoreTypes.View;\n onClose?: () => void;\n}\n\nexport interface UseMasterDetailHostResult {\n detail: ReactNode | undefined;\n masterDetailProps: Pick<\n MasterDetailProps,\n 'open' | 'selection' | 'loading' | 'nestedNavigation' | 'presentation' | 'onClose'\n >;\n}\n\nexport default function useMasterDetailHost({\n view,\n onClose\n}: UseMasterDetailHostParams): UseMasterDetailHostResult {\n const { masterDetail } = view;\n const masterDetailConfig = view.meta.masterDetail;\n const presentation = view.state?.responsive?.sm === false ? 'overlay' : 'docked';\n const rowContext = masterDetail?.row.getContext?.();\n const headerColumn = view.columns?.find(column => column.isFirstDataColumn);\n const { detailState, onDetailStateChange } = useMasterDetailState(masterDetail);\n const { registerDetailCleanup } = useMasterDetailCleanup(!!masterDetail);\n\n const closeMasterDetail = useCallback(() => {\n view.type.closeMasterDetail();\n onClose?.();\n }, [onClose, view.type]);\n\n const previous = useCallback(() => view.type.navigateMasterDetail('previous'), [view.type]);\n const next = useCallback(() => view.type.navigateMasterDetail('next'), [view.type]);\n\n const [translate] = useTranslate();\n const fetchActions = useCallback(\n () =>\n fetchRowActions({\n getExecutionContext: masterDetail?.row.getContext,\n meta: view.meta,\n translate\n }),\n [masterDetail?.row, translate, view.meta]\n );\n\n const headerValue = headerColumn?.getContext(rowContext).getValue()?.toString();\n const selection = masterDetail\n ? {\n id: masterDetail.rowKey,\n header: headerValue,\n accessibleName: headerValue,\n onPrevious: masterDetail.hasPrevious ? previous : undefined,\n onNext: masterDetail.hasNext ? next : undefined,\n actions: view.meta.editing || view.meta.deleting ? fetchActions : undefined,\n icon: masterDetailConfig?.icon\n }\n : undefined;\n return {\n detail: useMasterDetailRenderer({\n view,\n masterDetail,\n onDetailStateChange,\n registerDetailCleanup\n }),\n masterDetailProps: {\n open: !!masterDetail,\n selection,\n loading: detailState.loading,\n nestedNavigation: detailState.nestedNavigation,\n presentation,\n onClose: closeMasterDetail\n }\n };\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
3
|
+
import type { DetailState } from './useMasterDetailState';
|
|
4
|
+
interface UseMasterDetailRendererParams {
|
|
5
|
+
view: RsCoreTypes.View;
|
|
6
|
+
masterDetail: RsCoreTypes.View['masterDetail'];
|
|
7
|
+
onDetailStateChange: (state: Partial<DetailState>) => void;
|
|
8
|
+
registerDetailCleanup: (cleanup?: () => void) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Resolves and renders configured detail content for the active Master Detail selection. */
|
|
11
|
+
export default function useMasterDetailRenderer({ view, masterDetail, onDetailStateChange, registerDetailCleanup }: UseMasterDetailRendererParams): ReactNode | undefined;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=useMasterDetailRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMasterDetailRenderer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/useMasterDetailRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAKlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,UAAU,6BAA6B;IACrC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC/C,mBAAmB,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC3D,qBAAqB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACvD;AAED,6FAA6F;AAC7F,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,IAAI,EACJ,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACtB,EAAE,6BAA6B,GAAG,SAAS,GAAG,SAAS,CAmBvD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, useMemo } from 'react';
|
|
3
|
+
import { createUID } from '@pega/cosmos-react-core';
|
|
4
|
+
import { resolveComponent } from '../../Components/RenderingEngine/ComponentResolverFactory';
|
|
5
|
+
import { MASTER_DETAIL_RENDERER_KEY } from '../../constants';
|
|
6
|
+
/** Resolves and renders configured detail content for the active Master Detail selection. */
|
|
7
|
+
export default function useMasterDetailRenderer({ view, masterDetail, onDetailStateChange, registerDetailCleanup }) {
|
|
8
|
+
// Remount the detail renderer when its row is regenerated or an explicit detail refresh is requested.
|
|
9
|
+
const detailRenderKey = useMemo(() => createUID(), [masterDetail?.row, masterDetail?.refreshKey]);
|
|
10
|
+
const rowContext = masterDetail?.row.getContext?.();
|
|
11
|
+
if (!masterDetail || !view.meta.masterDetail)
|
|
12
|
+
return undefined;
|
|
13
|
+
const detail = resolveComponent(MASTER_DETAIL_RENDERER_KEY, view.renderFactory, {
|
|
14
|
+
rowContext,
|
|
15
|
+
context: rowContext?.getValue?.(),
|
|
16
|
+
nestedTarget: masterDetail.nestedTarget,
|
|
17
|
+
viewName: masterDetail.viewName ?? view.meta.masterDetail?.viewName,
|
|
18
|
+
onDetailStateChange,
|
|
19
|
+
registerDetailCleanup
|
|
20
|
+
});
|
|
21
|
+
return detail ? (_jsx(Fragment, { children: detail }, `${masterDetail.rowKey}:${detailRenderKey}`)) : undefined;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=useMasterDetailRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMasterDetailRenderer.js","sourceRoot":"","sources":["../../../../Core/Views/Table/useMasterDetailRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAW7D,6FAA6F;AAC7F,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,IAAI,EACJ,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACS;IAC9B,sGAAsG;IACtG,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IAClG,MAAM,UAAU,GAAG,YAAY,EAAE,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;IAEpD,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY;QAAE,OAAO,SAAS,CAAC;IAE/D,MAAM,MAAM,GAAG,gBAAgB,CAAC,0BAA0B,EAAE,IAAI,CAAC,aAAa,EAAE;QAC9E,UAAU;QACV,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE;QACjC,YAAY,EAAE,YAAY,CAAC,YAAY;QACvC,QAAQ,EAAE,YAAY,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ;QACnE,mBAAmB;QACnB,qBAAqB;KACtB,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,CAAC,CAAC,CACd,KAAC,QAAQ,cAAoD,MAAM,IAApD,GAAG,YAAY,CAAC,MAAM,IAAI,eAAe,EAAE,CAAqB,CAChF,CAAC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC","sourcesContent":["import { Fragment, useMemo } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { createUID } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport { resolveComponent } from '../../Components/RenderingEngine/ComponentResolverFactory';\nimport { MASTER_DETAIL_RENDERER_KEY } from '../../constants';\n\nimport type { DetailState } from './useMasterDetailState';\n\ninterface UseMasterDetailRendererParams {\n view: RsCoreTypes.View;\n masterDetail: RsCoreTypes.View['masterDetail'];\n onDetailStateChange: (state: Partial<DetailState>) => void;\n registerDetailCleanup: (cleanup?: () => void) => void;\n}\n\n/** Resolves and renders configured detail content for the active Master Detail selection. */\nexport default function useMasterDetailRenderer({\n view,\n masterDetail,\n onDetailStateChange,\n registerDetailCleanup\n}: UseMasterDetailRendererParams): ReactNode | undefined {\n // Remount the detail renderer when its row is regenerated or an explicit detail refresh is requested.\n const detailRenderKey = useMemo(() => createUID(), [masterDetail?.row, masterDetail?.refreshKey]);\n const rowContext = masterDetail?.row.getContext?.();\n\n if (!masterDetail || !view.meta.masterDetail) return undefined;\n\n const detail = resolveComponent(MASTER_DETAIL_RENDERER_KEY, view.renderFactory, {\n rowContext,\n context: rowContext?.getValue?.(),\n nestedTarget: masterDetail.nestedTarget,\n viewName: masterDetail.viewName ?? view.meta.masterDetail?.viewName,\n onDetailStateChange,\n registerDetailCleanup\n });\n\n return detail ? (\n <Fragment key={`${masterDetail.rowKey}:${detailRenderKey}`}>{detail}</Fragment>\n ) : undefined;\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MouseEvent, KeyboardEvent } from 'react';
|
|
2
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
3
|
+
export default function useMasterDetailRow(row: RsCoreTypes.Row): {
|
|
4
|
+
isMasterDetailEnabled: boolean;
|
|
5
|
+
onRowClick: (event: MouseEvent) => void;
|
|
6
|
+
onCellKeyDownCapture: (event: KeyboardEvent) => void;
|
|
7
|
+
rowElementRef: import("react").MutableRefObject<HTMLElement | null>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useMasterDetailRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMasterDetailRow.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/useMasterDetailRow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAalE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG;;wBAiBnD,UAAU;kCAWV,aAAa;;EAgCxB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
import { ACTIONABLE_SELECTORS, FOCUSABLE_SELECTORS } from '../../constants';
|
|
3
|
+
const INTERACTIVE_SELECTOR = [
|
|
4
|
+
...FOCUSABLE_SELECTORS,
|
|
5
|
+
...ACTIONABLE_SELECTORS,
|
|
6
|
+
'.cell-action',
|
|
7
|
+
'[role="button"]',
|
|
8
|
+
'[role="menuitem"]',
|
|
9
|
+
'[aria-haspopup="menu"]'
|
|
10
|
+
].join(',');
|
|
11
|
+
export default function useMasterDetailRow(row) {
|
|
12
|
+
const rowElementRef = useRef(null);
|
|
13
|
+
const isMasterDetailEnabled = !!row.parent?.meta?.masterDetail;
|
|
14
|
+
const isRowSelectionEnabled = !!row.parent?.meta?.selectionMode &&
|
|
15
|
+
!(row.parent?.columns?.find(column => column.field.name === 'RowSelect')?.disableSelection ??
|
|
16
|
+
row.parent?.meta?.disableSelectionOnLoad);
|
|
17
|
+
const selectRowIfEnabled = useCallback(() => {
|
|
18
|
+
if (isRowSelectionEnabled) {
|
|
19
|
+
row.selectRow(!row.$selected);
|
|
20
|
+
}
|
|
21
|
+
}, [isRowSelectionEnabled, row]);
|
|
22
|
+
const onRowClick = useCallback((event) => {
|
|
23
|
+
const target = event.target;
|
|
24
|
+
if (target?.closest?.(INTERACTIVE_SELECTOR))
|
|
25
|
+
return;
|
|
26
|
+
selectRowIfEnabled();
|
|
27
|
+
row.openMasterDetail?.();
|
|
28
|
+
}, [row, selectRowIfEnabled]);
|
|
29
|
+
const onCellKeyDownCapture = useCallback((event) => {
|
|
30
|
+
if (event.key !== 'Enter' || event.target !== event.currentTarget)
|
|
31
|
+
return;
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
selectRowIfEnabled();
|
|
35
|
+
row.openMasterDetail?.();
|
|
36
|
+
}, [row, selectRowIfEnabled]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const rowElement = rowElementRef.current;
|
|
39
|
+
if (!row.masterDetailActive || !rowElement)
|
|
40
|
+
return;
|
|
41
|
+
const scrollContainer = row.parent?.virtualizeElements?.rootVirtualiser?.getParentContainer?.();
|
|
42
|
+
if (!scrollContainer) {
|
|
43
|
+
rowElement.scrollIntoView({ block: 'nearest' });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const rowRect = rowElement.getBoundingClientRect();
|
|
47
|
+
const viewportRect = scrollContainer.getBoundingClientRect();
|
|
48
|
+
const isOutsideViewport = rowRect.top < viewportRect.top || rowRect.bottom > viewportRect.bottom;
|
|
49
|
+
if (isOutsideViewport) {
|
|
50
|
+
rowElement.scrollIntoView({ block: 'nearest' });
|
|
51
|
+
}
|
|
52
|
+
}, [row.masterDetailActive]);
|
|
53
|
+
return { isMasterDetailEnabled, onRowClick, onCellKeyDownCapture, rowElementRef };
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=useMasterDetailRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMasterDetailRow.js","sourceRoot":"","sources":["../../../../Core/Views/Table/useMasterDetailRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAKvD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,MAAM,oBAAoB,GAAG;IAC3B,GAAG,mBAAmB;IACtB,GAAG,oBAAoB;IACvB,cAAc;IACd,iBAAiB;IACjB,mBAAmB;IACnB,wBAAwB;CACzB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,GAAoB;IAC7D,MAAM,aAAa,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IACvD,MAAM,qBAAqB,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC;IAC/D,MAAM,qBAAqB,GACzB,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,aAAa;QACjC,CAAC,CACC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,C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GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,EAAE,CAAC;QAChG,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YAChD,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAG,UAAU,CAAC,qBAAqB,EAAE,CAAC;QACnD,MAAM,YAAY,GAAG,eAAe,CAAC,qBAAqB,EAAE,CAAC;QAC7D,MAAM,iBAAiB,GACrB,OAAO,CAAC,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;QAEzE,IAAI,iBAAiB,EAAE,CAAC;YACtB,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAClD,CAAC;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAE7B,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,CAAC;AACpF,CAAC","sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport type { MouseEvent, KeyboardEvent } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport { ACTIONABLE_SELECTORS, FOCUSABLE_SELECTORS } from '../../constants';\n\nconst INTERACTIVE_SELECTOR = [\n ...FOCUSABLE_SELECTORS,\n ...ACTIONABLE_SELECTORS,\n '.cell-action',\n '[role=\"button\"]',\n '[role=\"menuitem\"]',\n '[aria-haspopup=\"menu\"]'\n].join(',');\n\nexport default function useMasterDetailRow(row: RsCoreTypes.Row) {\n const rowElementRef = useRef<HTMLElement | null>(null);\n const isMasterDetailEnabled = !!row.parent?.meta?.masterDetail;\n const isRowSelectionEnabled =\n !!row.parent?.meta?.selectionMode &&\n !(\n row.parent?.columns?.find(column => column.field.name === 'RowSelect')?.disableSelection ??\n row.parent?.meta?.disableSelectionOnLoad\n );\n\n const selectRowIfEnabled = useCallback(() => {\n if (isRowSelectionEnabled) {\n row.selectRow(!row.$selected);\n }\n }, [isRowSelectionEnabled, row]);\n\n const onRowClick = useCallback(\n (event: MouseEvent) => {\n const target = event.target as HTMLElement;\n if (target?.closest?.(INTERACTIVE_SELECTOR)) return;\n\n selectRowIfEnabled();\n row.openMasterDetail?.();\n },\n [row, selectRowIfEnabled]\n );\n\n const onCellKeyDownCapture = useCallback(\n (event: KeyboardEvent) => {\n if (event.key !== 'Enter' || event.target !== event.currentTarget) return;\n\n event.preventDefault();\n event.stopPropagation();\n selectRowIfEnabled();\n row.openMasterDetail?.();\n },\n [row, selectRowIfEnabled]\n );\n\n useEffect(() => {\n const rowElement = rowElementRef.current;\n if (!row.masterDetailActive || !rowElement) return;\n\n const scrollContainer = row.parent?.virtualizeElements?.rootVirtualiser?.getParentContainer?.();\n if (!scrollContainer) {\n rowElement.scrollIntoView({ block: 'nearest' });\n return;\n }\n\n const rowRect = rowElement.getBoundingClientRect();\n const viewportRect = scrollContainer.getBoundingClientRect();\n const isOutsideViewport =\n rowRect.top < viewportRect.top || rowRect.bottom > viewportRect.bottom;\n\n if (isOutsideViewport) {\n rowElement.scrollIntoView({ block: 'nearest' });\n }\n }, [row.masterDetailActive]);\n\n return { isMasterDetailEnabled, onRowClick, onCellKeyDownCapture, rowElementRef };\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
3
|
+
export interface DetailNestedNavigation {
|
|
4
|
+
onBack?: () => void;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
subtitle?: ReactNode;
|
|
7
|
+
icon?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DetailState {
|
|
10
|
+
rowKey?: string;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
nestedNavigation?: DetailNestedNavigation;
|
|
13
|
+
}
|
|
14
|
+
interface UseMasterDetailStateResult {
|
|
15
|
+
detailState: DetailState;
|
|
16
|
+
onDetailStateChange: (nextState: Partial<DetailState>) => void;
|
|
17
|
+
}
|
|
18
|
+
/** Manages transient renderer state for the currently open Master Detail item. */
|
|
19
|
+
export default function useMasterDetailState(masterDetail: RsCoreTypes.View['masterDetail']): UseMasterDetailStateResult;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useMasterDetailState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMasterDetailState.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/useMasterDetailState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;CAC3C;AAED,UAAU,0BAA0B;IAClC,WAAW,EAAE,WAAW,CAAC;IACzB,mBAAmB,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAChE;AAED,kFAAkF;AAClF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,GAC7C,0BAA0B,CAoC5B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
/** Manages transient renderer state for the currently open Master Detail item. */
|
|
3
|
+
export default function useMasterDetailState(masterDetail) {
|
|
4
|
+
const [detailState, setDetailState] = useState({});
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
if (!masterDetail) {
|
|
7
|
+
setDetailState({});
|
|
8
|
+
}
|
|
9
|
+
}, [masterDetail]);
|
|
10
|
+
const onDetailStateChange = useCallback((nextState) => {
|
|
11
|
+
if (!masterDetail)
|
|
12
|
+
return;
|
|
13
|
+
setDetailState(previousState => {
|
|
14
|
+
if (previousState.rowKey !== masterDetail.rowKey) {
|
|
15
|
+
return { rowKey: masterDetail.rowKey, ...nextState };
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
...previousState,
|
|
19
|
+
...nextState,
|
|
20
|
+
nestedNavigation: nextState.nestedNavigation
|
|
21
|
+
? { ...previousState.nestedNavigation, ...nextState.nestedNavigation }
|
|
22
|
+
: previousState.nestedNavigation
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}, [masterDetail]);
|
|
26
|
+
return {
|
|
27
|
+
detailState: detailState.rowKey === masterDetail?.rowKey
|
|
28
|
+
? detailState
|
|
29
|
+
: { loading: false, nestedNavigation: undefined },
|
|
30
|
+
onDetailStateChange
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=useMasterDetailState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMasterDetailState.js","sourceRoot":"","sources":["../../../../Core/Views/Table/useMasterDetailState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAuBzD,kFAAkF;AAClF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,YAA8C;IAE9C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAc,EAAE,CAAC,CAAC;IAEhE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,cAAc,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,mBAAmB,GAAG,WAAW,CACrC,CAAC,SAA+B,EAAE,EAAE;QAClC,IAAI,CAAC,YAAY;YAAE,OAAO;QAE1B,cAAc,CAAC,aAAa,CAAC,EAAE;YAC7B,IAAI,aAAa,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM,EAAE,CAAC;gBACjD,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;YACvD,CAAC;YACD,OAAO;gBACL,GAAG,aAAa;gBAChB,GAAG,SAAS;gBACZ,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;oBAC1C,CAAC,CAAC,EAAE,GAAG,aAAa,CAAC,gBAAgB,EAAE,GAAG,SAAS,CAAC,gBAAgB,EAAE;oBACtE,CAAC,CAAC,aAAa,CAAC,gBAAgB;aACnC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,EACD,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,OAAO;QACL,WAAW,EACT,WAAW,CAAC,MAAM,KAAK,YAAY,EAAE,MAAM;YACzC,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE;QACrD,mBAAmB;KACpB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport type { ReactNode } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nexport interface DetailNestedNavigation {\n onBack?: () => void;\n title?: ReactNode;\n subtitle?: ReactNode;\n icon?: string;\n}\n\nexport interface DetailState {\n rowKey?: string;\n loading?: boolean;\n nestedNavigation?: DetailNestedNavigation;\n}\n\ninterface UseMasterDetailStateResult {\n detailState: DetailState;\n onDetailStateChange: (nextState: Partial<DetailState>) => void;\n}\n\n/** Manages transient renderer state for the currently open Master Detail item. */\nexport default function useMasterDetailState(\n masterDetail: RsCoreTypes.View['masterDetail']\n): UseMasterDetailStateResult {\n const [detailState, setDetailState] = useState<DetailState>({});\n\n useEffect(() => {\n if (!masterDetail) {\n setDetailState({});\n }\n }, [masterDetail]);\n\n const onDetailStateChange = useCallback(\n (nextState: Partial<DetailState>) => {\n if (!masterDetail) return;\n\n setDetailState(previousState => {\n if (previousState.rowKey !== masterDetail.rowKey) {\n return { rowKey: masterDetail.rowKey, ...nextState };\n }\n return {\n ...previousState,\n ...nextState,\n nestedNavigation: nextState.nestedNavigation\n ? { ...previousState.nestedNavigation, ...nextState.nestedNavigation }\n : previousState.nestedNavigation\n };\n });\n },\n [masterDetail]\n );\n\n return {\n detailState:\n detailState.rowKey === masterDetail?.rowKey\n ? detailState\n : { loading: false, nestedNavigation: undefined },\n onDetailStateChange\n };\n}\n"]}
|
package/lib/Core/constants.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export declare const EXTERNAL_FILTERS = "externalFilters";
|
|
2
2
|
export declare const DEFAULT_FORMAT = "Default";
|
|
3
|
+
/** Render-factory key registered by the host for the Master Detail content renderer. */
|
|
4
|
+
export declare const MASTER_DETAIL_RENDERER_KEY = "masterDetailRenderer";
|
|
5
|
+
export declare const MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS = "preview-highlight-row";
|
|
6
|
+
export declare const MASTER_DETAIL_INDICATOR_CLASS = "detail-indicator-anchor";
|
|
3
7
|
export declare const SELECTION_MODES: {
|
|
4
8
|
single: string;
|
|
5
9
|
multi: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../Core/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAClD,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC,eAAO,MAAM,eAAe;;;;CAI3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;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AAO,MAAM,oBAAoB,UAYhC,CAAC"}
|
package/lib/Core/constants.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export const EXTERNAL_FILTERS = 'externalFilters';
|
|
2
2
|
export const DEFAULT_FORMAT = 'Default';
|
|
3
|
+
/** Render-factory key registered by the host for the Master Detail content renderer. */
|
|
4
|
+
export const MASTER_DETAIL_RENDERER_KEY = 'masterDetailRenderer';
|
|
5
|
+
export const MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS = 'preview-highlight-row';
|
|
6
|
+
export const MASTER_DETAIL_INDICATOR_CLASS = 'detail-indicator-anchor';
|
|
3
7
|
export const SELECTION_MODES = {
|
|
4
8
|
single: 'single',
|
|
5
9
|
multi: 'multi',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../Core/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AAExC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE;IACzC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE;IAC1C,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE;IACxC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UA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ClC,kBAAkB;IAClB,mBAAmB,EAAE,sCAAsC;IAC3D,oBAAoB;IACpB,0BAA0B;IAC1B,sBAAsB;IACtB,iBAAiB;IACjB,mBAAmB;IACnB,sBAAsB;IACtB,UAAU;IACV,QAAQ;IACR,QAAQ;CACT,CAAC","sourcesContent":["export const EXTERNAL_FILTERS = 'externalFilters';\nexport const DEFAULT_FORMAT = 'Default';\n\nexport const SELECTION_MODES = {\n single: 'single',\n multi: 'multi',\n multi_on_hover: 'multi_on_hover'\n};\n\nexport const rowDensityClasses = {\n 1: { id: '1', className: 'short-height' },\n 2: { id: '2', className: 'medium-height' },\n 3: { id: '3', className: 'tall-height' },\n 4: { id: '4', className: 'wrap-content-height' }\n};\n\nexport const TEMPLATES = {\n GALLERY: 'Gallery',\n TABLE: 'Table',\n TIMELINE: 'Timeline'\n};\n\nexport const debugInfoFields = {\n className: 'className',\n dataPage: 'dataPage',\n dataSource: 'dataSource',\n timeTaken: 'timeTaken',\n insightId: 'insightId'\n};\n\nexport const CELL_ALIGN_CLASSES = {\n left: 'align-left',\n right: 'align-right',\n center: 'align-center'\n};\n\nexport const NonNullSortActions = [\n {\n actionId: 'asc',\n actionName: 'Sort ascending',\n actionIcon: 'arrow-up'\n },\n {\n actionId: 'desc',\n actionName: 'Sort descending',\n actionIcon: 'arrow-down'\n }\n];\n\nexport const sortActions = [\n ...NonNullSortActions,\n {\n actionId: null,\n actionName: 'Remove sort',\n actionIcon: 'reset'\n }\n];\nexport const TOOLBAR_FEATURES = {\n FILTER: 'filter',\n SORT: 'sort',\n GROUPING: 'grouping'\n} as const;\n\nexport const customFunctions = {\n TEXT_GROUPING: 'TEXT_GROUPING',\n RANGE_GROUPING: 'RANGE_GROUPING',\n INTERVAL_GROUPING: 'INTERVAL_GROUPING'\n};\n\nexport const intervalGroupingBoundaries = {\n includeLowerOnly: 'include-lower-only',\n includeUpperOnly: 'include-upper-only'\n};\n\nexport const FOCUSABLE_SELECTORS = [\n 'button',\n 'a[href]',\n 'input[type=file]',\n 'input[type=checkbox]',\n 'input[type=radio]',\n '.scalarlist-component',\n '.row-error-column svg'\n];\n\nexport const ACTIONABLE_SELECTORS = [\n 'input[type=text]',\n 'input:not([type])', // input without type defaults to text\n 'input[type=number]',\n 'input[inputmode=numeric]',\n 'input[inputmode=tel]',\n 'input[type=url]',\n 'input[type=email]',\n 'input[role=combobox]',\n 'textarea',\n 'select',\n 'iframe'\n];\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../Core/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AAExC,wFAAwF;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AACjE,MAAM,CAAC,MAAM,qCAAqC,GAAG,uBAAuB,CAAC;AAC7E,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEvE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE;IACzC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE;IAC1C,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE;IACxC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,eA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AC3D,oBAAoB;IACpB,0BAA0B;IAC1B,sBAAsB;IACtB,iBAAiB;IACjB,mBAAmB;IACnB,sBAAsB;IACtB,UAAU;IACV,QAAQ;IACR,QAAQ;CACT,CAAC","sourcesContent":["export const EXTERNAL_FILTERS = 'externalFilters';\nexport const DEFAULT_FORMAT = 'Default';\n\n/** Render-factory key registered by the host for the Master Detail content renderer. */\nexport const MASTER_DETAIL_RENDERER_KEY = 'masterDetailRenderer';\nexport const MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS = 'preview-highlight-row';\nexport const MASTER_DETAIL_INDICATOR_CLASS = 'detail-indicator-anchor';\n\nexport const SELECTION_MODES = {\n single: 'single',\n multi: 'multi',\n multi_on_hover: 'multi_on_hover'\n};\n\nexport const rowDensityClasses = {\n 1: { id: '1', className: 'short-height' },\n 2: { id: '2', className: 'medium-height' },\n 3: { id: '3', className: 'tall-height' },\n 4: { id: '4', className: 'wrap-content-height' }\n};\n\nexport const TEMPLATES = {\n GALLERY: 'Gallery',\n TABLE: 'Table',\n TIMELINE: 'Timeline'\n};\n\nexport const debugInfoFields = {\n className: 'className',\n dataPage: 'dataPage',\n dataSource: 'dataSource',\n timeTaken: 'timeTaken',\n insightId: 'insightId'\n};\n\nexport const CELL_ALIGN_CLASSES = {\n left: 'align-left',\n right: 'align-right',\n center: 'align-center'\n};\n\nexport const NonNullSortActions = [\n {\n actionId: 'asc',\n actionName: 'Sort ascending',\n actionIcon: 'arrow-up'\n },\n {\n actionId: 'desc',\n actionName: 'Sort descending',\n actionIcon: 'arrow-down'\n }\n];\n\nexport const sortActions = [\n ...NonNullSortActions,\n {\n actionId: null,\n actionName: 'Remove sort',\n actionIcon: 'reset'\n }\n];\nexport const TOOLBAR_FEATURES = {\n FILTER: 'filter',\n SORT: 'sort',\n GROUPING: 'grouping'\n} as const;\n\nexport const customFunctions = {\n TEXT_GROUPING: 'TEXT_GROUPING',\n RANGE_GROUPING: 'RANGE_GROUPING',\n INTERVAL_GROUPING: 'INTERVAL_GROUPING'\n};\n\nexport const intervalGroupingBoundaries = {\n includeLowerOnly: 'include-lower-only',\n includeUpperOnly: 'include-upper-only'\n};\n\nexport const FOCUSABLE_SELECTORS = [\n 'button',\n 'a[href]',\n 'input[type=file]',\n 'input[type=checkbox]',\n 'input[type=radio]',\n '.scalarlist-component',\n '.row-error-column svg'\n];\n\nexport const ACTIONABLE_SELECTORS = [\n 'input[type=text]',\n 'input:not([type])', // input without type defaults to text\n 'input[type=number]',\n 'input[inputmode=numeric]',\n 'input[inputmode=tel]',\n 'input[type=url]',\n 'input[type=email]',\n 'input[role=combobox]',\n 'textarea',\n 'select',\n 'iframe'\n];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-react",
|
|
3
|
-
"version": "9.25.1-
|
|
3
|
+
"version": "9.25.1-4",
|
|
4
4
|
"description": "Repeating view structures such as Table, Gallery(Repeating layouts), Kanban etc.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -14,17 +14,18 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "9.25.1-
|
|
18
|
-
"@pega/cosmos-react-core": "9.25.1-
|
|
19
|
-
"@pega/cosmos-react-rte": "9.25.1-
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "9.25.1-4",
|
|
18
|
+
"@pega/cosmos-react-core": "9.25.1-4",
|
|
19
|
+
"@pega/cosmos-react-rte": "9.25.1-4",
|
|
20
|
+
"@pega/cosmos-react-work": "9.25.1-4",
|
|
20
21
|
"@types/lodash-es": "^4.17.12",
|
|
21
22
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
22
23
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
23
24
|
"dayjs": "^1.11.13",
|
|
24
25
|
"fast-deep-equal": "^3.1.3",
|
|
25
26
|
"lodash-es": "^4.18.1",
|
|
26
|
-
"pega-repeating-structures-core": "npm:@pega/lists-core@9.25.1-
|
|
27
|
-
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.25.1-
|
|
27
|
+
"pega-repeating-structures-core": "npm:@pega/lists-core@9.25.1-4",
|
|
28
|
+
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.25.1-4",
|
|
28
29
|
"polished": "^4.1.0",
|
|
29
30
|
"prop-types": "^15.8.1",
|
|
30
31
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"@testing-library/react": "^16.0.0",
|
|
43
44
|
"@testing-library/user-event": "^14.6.1",
|
|
44
45
|
"jest-axe": "^8.0.0",
|
|
45
|
-
"srs-utils": "9.25.1-
|
|
46
|
+
"srs-utils": "9.25.1-4",
|
|
46
47
|
"typescript": "~5.9.3"
|
|
47
48
|
}
|
|
48
49
|
}
|