@pega/lists-react 9.0.0-build.11.6 → 9.0.0-build.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts +0 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js +0 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts +0 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js +1 -3
- package/lib/Core/Components/RenderingEngine/RenderCell.js.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.js +8 -27
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
- package/package.json +7 -7
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts +0 -12
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js +0 -36
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts +0 -15
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js +0 -50
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts +0 -12
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js +0 -44
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts +0 -16
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js +0 -64
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -203,9 +203,6 @@ APIs exposed on the component ref are accessible via `compRef.current.<API_NAME>
|
|
|
203
203
|
|
|
204
204
|
- The first focus will be on the table's first header cell if earlier no navigation has been done.
|
|
205
205
|
- To navigate between the cells, use the arrow keys.
|
|
206
|
-
- Pressing enter on the cell can turn the cell in edit mode if it is editable.
|
|
207
|
-
- Pressing enter again will submit the data
|
|
208
|
-
- Pressing escape will discard the changes and turn the cell back to read mode.
|
|
209
206
|
- To focus out from the table cells, press the tab key and focus will be shifted to the next focusable element on the page after table.
|
|
210
207
|
- Next time when navigated again to the table, the last visited cell will be focused.
|
|
211
208
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
Operator: typeof Operator;
|
|
3
|
-
cellEditRenderer: typeof Editor;
|
|
4
3
|
RowActionMenu: typeof RowActionMenu;
|
|
5
4
|
RowDragDropHandle: typeof RowDragDropHandle;
|
|
6
5
|
RowSelectHandle: import("react").MemoExoticComponent<{
|
|
@@ -40,7 +39,6 @@ declare const _default: {
|
|
|
40
39
|
};
|
|
41
40
|
export default _default;
|
|
42
41
|
import Operator from './Operator';
|
|
43
|
-
import Editor from './EditComponents';
|
|
44
42
|
import RowActionMenu from './RowActionMenu';
|
|
45
43
|
import RowDragDropHandle from './RowDragDropHandle';
|
|
46
44
|
import RowError from './RowError';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAKqB,YAAY;0BAEP,iBAAiB;8BACb,qBAAqB;qBAG9B,YAAY;gCADD,uBAAuB;uBAPhC,cAAc;qBAFhB,YAAY;uBACV,cAAc"}
|
|
@@ -5,7 +5,6 @@ import CustomCell from './CustomCell';
|
|
|
5
5
|
import Link from './Link';
|
|
6
6
|
import Operator from './Operator';
|
|
7
7
|
import templates from './ColumnMergeTemplates';
|
|
8
|
-
import Editor from './EditComponents';
|
|
9
8
|
import RowActionMenu from './RowActionMenu';
|
|
10
9
|
import RowDragDropHandle from './RowDragDropHandle';
|
|
11
10
|
import RowSelectHandle from './RowSelectHandle';
|
|
@@ -19,7 +18,6 @@ export default {
|
|
|
19
18
|
...Link,
|
|
20
19
|
...templates,
|
|
21
20
|
Operator,
|
|
22
|
-
cellEditRenderer: Editor,
|
|
23
21
|
RowActionMenu,
|
|
24
22
|
RowDragDropHandle,
|
|
25
23
|
RowSelectHandle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/index.js"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../Core/Components/DefaultComponents/CellRenderers/index.js"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,eAAe;IACb,YAAY,EAAE,IAAI;IAClB,kBAAkB,EAAE,UAAU;IAC9B,QAAQ;IACR,UAAU;IACV,GAAG,IAAI;IACP,GAAG,SAAS;IACZ,QAAQ;IACR,aAAa;IACb,iBAAiB;IACjB,eAAe;IACf,QAAQ;IACR,cAAc,EAAE,mBAAmB;CACpC,CAAC","sourcesContent":["import Cell from './Cell';\nimport RichText from './RichText';\nimport CheckCross from './CheckCross';\nimport CustomCell from './CustomCell';\nimport Link from './Link';\nimport Operator from './Operator';\nimport templates from './ColumnMergeTemplates';\nimport RowActionMenu from './RowActionMenu';\nimport RowDragDropHandle from './RowDragDropHandle';\nimport RowSelectHandle from './RowSelectHandle';\nimport DefaultTextRenderer from './DefaultTextRenderer';\nimport RowError from './RowError';\n\nexport default {\n cellRenderer: Cell,\n customCellRenderer: CustomCell,\n RichText,\n CheckCross,\n ...Link,\n ...templates,\n Operator,\n RowActionMenu,\n RowDragDropHandle,\n RowSelectHandle,\n RowError,\n 'Text-Default': DefaultTextRenderer\n};\n"]}
|
|
@@ -23,7 +23,6 @@ export namespace extRenderer {
|
|
|
23
23
|
}
|
|
24
24
|
declare const _default: {
|
|
25
25
|
Operator: typeof import("./CellRenderers/Operator").default;
|
|
26
|
-
cellEditRenderer: typeof import("./CellRenderers/EditComponents").default;
|
|
27
26
|
RowActionMenu: typeof import("./CellRenderers/RowActionMenu").default;
|
|
28
27
|
RowDragDropHandle: typeof import("./CellRenderers/RowDragDropHandle").default;
|
|
29
28
|
RowSelectHandle: import("react").MemoExoticComponent<{
|
|
@@ -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":"RenderCell.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/RenderCell.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAe7E,UAAU,oBAAqB,SAAQ,WAAW,CAAC,0BAA0B;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,eAAe,CAAC,EACvB,SAAgB,EAChB,WAAmB,EACnB,mBAA2B,EAC3B,YAAoB,EACpB,OAAe,EACf,OAAO,EACP,MAAM,EACN,KAAY,EACZ,SAAS,EACV,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"RenderCell.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/RenderCell.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAe7E,UAAU,oBAAqB,SAAQ,WAAW,CAAC,0BAA0B;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,eAAe,CAAC,EACvB,SAAgB,EAChB,WAAmB,EACnB,mBAA2B,EAC3B,YAAoB,EACpB,OAAe,EACf,OAAO,EACP,MAAM,EACN,KAAY,EACZ,SAAS,EACV,EAAE,oBAAoB,2CAgDtB;;AAED,wBAAqC"}
|
|
@@ -28,9 +28,7 @@ function RenderingEngine({ formatter = true, highlighter = false, expressionEval
|
|
|
28
28
|
const pipeline = [];
|
|
29
29
|
const { getField, getRendererType } = engineContext;
|
|
30
30
|
const field = getField();
|
|
31
|
-
const isHighlighterApplicable = useMemo(() => !!(
|
|
32
|
-
field.type === FieldType.TEXT &&
|
|
33
|
-
column.parent?.meta?.globalSearch), [field.type, column]);
|
|
31
|
+
const isHighlighterApplicable = useMemo(() => !!(field.type === FieldType.TEXT && column.parent?.meta?.globalSearch), [field.type, column]);
|
|
34
32
|
if (expressionEvaluator)
|
|
35
33
|
pipeline.push(ExpresssionEvaluator);
|
|
36
34
|
if (column.formatterAllowed)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderCell.js","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/RenderCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,SAAS,EAAoB,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAA0C;IACpE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK;CACvB,CAAC;AAaF,SAAS,eAAe,CAAC,EACvB,SAAS,GAAG,IAAI,EAChB,WAAW,GAAG,KAAK,EACnB,mBAAmB,GAAG,KAAK,EAC3B,YAAY,GAAG,KAAK,EACpB,OAAO,GAAG,KAAK,EACf,OAAO,EACP,MAAM,EACN,KAAK,GAAG,IAAI,CAAC,8CAA8C,EAC3D,SAAS,EACY;IACrB,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAEjF,MAAM,aAAa,G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AI,YAAY;QAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,IAAI,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEpC,cAAc,CAAC,aAAa,EAAE;QAC5B,eAAe,EAAE,WAAW,IAAI,uBAAuB;KACxD,CAAC,CAAC;IAEH,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;IAExC,OAAO,CACL,KAAC,UAAU,IACT,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC,KACpC,CAAC,WAAW;YACd,uBAAuB;YACvB,aAAa,CAAC,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,CAAC,gBAAgB,EAAE,EAAE,CAAC,YAE/E,oBAAoB,CAAC,eAAe,EAAE,EAAE,IAAI,cAAc,EAAE,aAAa,EAAE,aAAa,CAAC,GAC/E,CACd,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import { memo, useMemo, useRef, useContext } from 'react';\nimport styled from 'styled-components';\nimport type { CSSObject } from 'styled-components';\n\nimport { FieldType, type RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport { createClassName as cx } from '../../Utils';\nimport GlobalContext from '../../Context/GlobalContext';\n\nimport Formatter from './Formatter';\nimport ExpresssionEvaluator from './ExpresssionEvaluator';\nimport Flasher from './Flasher';\nimport useHighlighter from './useHighlighter';\nimport ErrorHandler from './ErrorHandler';\n\nconst StyledSpan = styled.span<{ style: RenderingEngineProps['style'] }>`\n ${props => props.style}\n`;\n\ninterface RenderingEngineProps extends RsCoreTypes.ColumnRenderingEngineProps {\n formatter?: boolean;\n highlighter?: boolean;\n expressionEvaluator?: boolean;\n errorHandler?: boolean;\n flasher?: boolean;\n context?: any;\n style?: CSSObject | null;\n className?: string;\n}\n\nfunction RenderingEngine({\n formatter = true,\n highlighter = false,\n expressionEvaluator = false,\n errorHandler = false,\n flasher = false,\n context,\n column,\n style = null /* This prop is provided by CellWrapper.jsx */,\n className\n}: RenderingEngineProps) {\n const { resolveCellComponent, resolveViewComponent } = useContext(GlobalContext);\n\n const engineWrapper = useRef();\n const { renderFactory } = column;\n\n const columnExecutionContext = column.getExecutionContext();\n\n const engineContext = {\n getElement: () => engineWrapper.current,\n ...column.getContext(columnExecutionContext),\n ...context,\n renderFactory,\n resolveCellComponent,\n resolveViewComponent\n };\n const pipeline: any[] = [];\n const { getField, getRendererType } = engineContext;\n const field = getField();\n\n const isHighlighterApplicable = useMemo(\n () => !!(field.type === FieldType.TEXT && column.parent?.meta?.globalSearch),\n [field.type, column]\n );\n\n if (expressionEvaluator) pipeline.push(ExpresssionEvaluator);\n if (column.formatterAllowed) pipeline.push((c: any) => Formatter(c, formatter));\n if (errorHandler) pipeline.push(ErrorHandler);\n if (flasher) pipeline.push(Flasher);\n\n useHighlighter(engineContext, {\n shouldHighlight: highlighter && isHighlighterApplicable\n });\n\n pipeline.forEach(p => p(engineContext));\n\n return (\n <StyledSpan\n ref={engineWrapper}\n style={style}\n className={cx('cell-content', className)}\n {...(highlighter &&\n isHighlighterApplicable &&\n engineContext.getSearchKeyword() && { key: engineContext.getSearchKeyword() })}\n >\n {resolveCellComponent(getRendererType?.() || 'cellRenderer', renderFactory, engineContext)}\n </StyledSpan>\n );\n}\n\nexport default memo(RenderingEngine);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAwBA,oNAq3BG"}
|
|
@@ -4,7 +4,8 @@ import styled, { css } from 'styled-components';
|
|
|
4
4
|
import { getLuminance, meetsContrastGuidelines, mix, readableColor, transparentize } from 'polished';
|
|
5
5
|
import { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';
|
|
6
6
|
import { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';
|
|
7
|
-
import { StyledLabel, calculateFontSize, tryCatch } from '@pega/cosmos-react-core';
|
|
7
|
+
import { StyledLabel, StyledProgressBackdrop, calculateFontSize, tryCatch } from '@pega/cosmos-react-core';
|
|
8
|
+
import { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';
|
|
8
9
|
import { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';
|
|
9
10
|
import { CellIcon } from './CellWrapper';
|
|
10
11
|
const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref: ref, ...props })))(({ theme, view, isFullscreen }) => {
|
|
@@ -64,6 +65,9 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
64
65
|
position: relative;
|
|
65
66
|
letter-spacing: var(--letter-spacing);
|
|
66
67
|
font-stretch: var(--font-stretch);
|
|
68
|
+
${StyledTabPanel} & ${StyledProgressBackdrop} {
|
|
69
|
+
border-radius: var(--border-radius, ${theme.base['border-radius']});
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
.hide-rows-till-ready .row[aria-rowindex] {
|
|
@@ -163,17 +167,10 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
163
167
|
outline: 0.125rem auto var(--medium-blue);
|
|
164
168
|
}
|
|
165
169
|
|
|
166
|
-
.cell.
|
|
170
|
+
.cell.selection-border:focus {
|
|
167
171
|
outline: none 0;
|
|
168
172
|
}
|
|
169
173
|
|
|
170
|
-
.editable-cell > span {
|
|
171
|
-
height: 100%;
|
|
172
|
-
display: flex;
|
|
173
|
-
padding: 0 6px;
|
|
174
|
-
align-items: center;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
174
|
.row {
|
|
178
175
|
display: inline-flex;
|
|
179
176
|
height: var(--row-height);
|
|
@@ -426,24 +423,8 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
426
423
|
}
|
|
427
424
|
}
|
|
428
425
|
|
|
429
|
-
.
|
|
430
|
-
|
|
431
|
-
border: 2px solid ${theme.base.palette.interactive} !important;
|
|
432
|
-
box-shadow: 0 0 1px 1px rgba(0, 118, 209) !important;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.editable-cell input {
|
|
436
|
-
border: none;
|
|
437
|
-
outline: none;
|
|
438
|
-
min-width: calc(100%);
|
|
439
|
-
min-height: 0;
|
|
440
|
-
max-height: 100%;
|
|
441
|
-
box-shadow: none !important;
|
|
442
|
-
border-radius: 0;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
.editable-cell.align-right input {
|
|
446
|
-
justify-content: right;
|
|
426
|
+
.cell-right-align .filter-info-container svg {
|
|
427
|
+
margin: 0 0.312rem 0 0;
|
|
447
428
|
}
|
|
448
429
|
|
|
449
430
|
&.show-expand-collapse-all {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledTableContainer.js","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,GAAG,EACH,aAAa,EACb,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnF,O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,CAAC,GAAG;;;;;;;;;;;;;;;;uBAgBV,QAAQ,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA2DH,oBAAoB;QAC3C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqD1B,YAAY;;;;;;QAMZ,gBAAgB,IAAI,WAAW;;;;;;;;;;;;;;;;;;;mBAmBpB,QAAQ;;;;;;;;;;;;;;;;YAgBf,QAAQ;;;;;;;;;;;;+BAYW,oBAAoB;QAC3C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,uBAAuB;;;;;;;;;;;;;;;;mBAgBd,QAAQ;;;;;;;;;;;;;;YAcf,QAAQ;;;;;;;;;;;;;;;;;;;;mBAoBD,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;4BAqBD,gBAAgB;;;;;8BAKd,gBAAgB;;;;4BAIlB,cAAc;;;;;;;;8BAQZ,cAAc;;;;;wBAKpB,cAAc;;;;;;;;;uBASf,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;uBAKlB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport {\n getLuminance,\n meetsContrastGuidelines,\n mix,\n readableColor,\n transparentize\n} from 'polished';\n\nimport { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';\nimport { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\nimport { StyledLabel, calculateFontSize, tryCatch } from '@pega/cosmos-react-core';\n\nimport { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';\n\nimport { CellIcon } from './CellWrapper';\n\nconst StyledTableContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(({\n theme,\n view,\n isFullscreen\n}) => {\n const isAggregationApplied = view.columns?.filter(c => !c.hidden).some(c => c.aggregated);\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const showFreezeLine =\n view.state.responsive?.sm &&\n !(view.hasNoRecords || view.hasNoFrozenColumns || view.bHideFreezeLine);\n const selectedRowColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n const lightGreyColor = theme.base.colors.gray['extra-light'];\n const freezeLineShadowTransparent = transparentize(\n 0.9,\n theme.components.table.header['foreground-color']\n );\n const oddRowBackgroundColor =\n getLuminance(theme.components.table.body['secondary-background-color']) > 0.5\n ? theme.components.table.body['secondary-background-color']\n : mix(\n 0.75,\n theme.components.table.body['background-color'],\n theme.components.table.body['secondary-background-color']\n );\n\n const headerForegroundContrast = meetsContrastGuidelines(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n ).AA;\n const usableHeaderForeground = headerForegroundContrast\n ? theme.components.table.header['foreground-color']\n : readableColor(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n );\n const oddRowContrast = meetsContrastGuidelines(\n theme.components.table.body['foreground-color'],\n oddRowBackgroundColor\n ).AA;\n const useableOddRowForeground = oddRowContrast\n ? theme.components.table.body['foreground-color']\n : readableColor(theme.components.table.body['foreground-color'], oddRowBackgroundColor);\n\n return css`\n --primary-background: ${theme.base.palette['primary-background']};\n --secondary-background: ${theme.components.table.header['background-color']};\n --forground-color: ${theme.base.palette['foreground-color']};\n --interactive: ${theme.base.palette.interactive};\n --medium-blue: ${theme.base.colors.blue.medium};\n --border-color: ${theme.base.palette['border-line']};\n --border-color-freeze: #a5a5a5;\n --border-width: 0.062rem;\n --border-style: var(--border-width) solid var(--border-color);\n --font-stretch: ${theme.components.table.typography['font-stretch']};\n --letter-spacing: ${theme.components.table.typography['letter-spacing']};\n --cell-padding: ${theme.base.spacing};\n --cell-vertical-padding: calc(${theme.base.spacing} * 0.5);\n --header-cell-padding: 0 0.125rem 0 var(--cell-padding);\n --header-bg-color: var(--secondary-background);\n --header-fg-color: ${usableHeaderForeground};\n --default-group-header-height: 1.5rem;\n --group-header-height: var(--default-group-header-height);\n --box-sizing: content-box;\n --animation-ease: ${theme.base.animation.timing.ease};\n --font-weight-semi-bold: ${theme.base['font-weight']['semi-bold']};\n --row-height-multiplier: 1.125;\n --cell-fixed-position: sticky;\n position: relative;\n ${() => generateRSHeightStyles({ view, isFullscreen })}\n\n .small-screen-table {\n --cell-fixed-position: static;\n }\n\n .container {\n ${() => generateRSDataContainerHeightStyles()};\n border: var(--border-style);\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n position: relative;\n letter-spacing: var(--letter-spacing);\n font-stretch: var(--font-stretch);\n }\n\n .hide-rows-till-ready .row[aria-rowindex] {\n visibility: hidden;\n }\n\n .table-drag-proxy {\n background: rgba(0, 0, 0, 0.21);\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .table-drag-line {\n background: #999999;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 0.12rem;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .cell-fixed {\n z-index: 1;\n }\n\n .group-wrapper {\n overflow: hidden;\n display: inline-flex;\n line-height: var(--group-header-height);\n\n .group-context-count {\n display: inline-flex;\n overflow: hidden;\n }\n }\n\n /* In review mode(Ex: Tabs) cosmos components are rendered and mark up is not compatible with\n group-wrapper cell. Overridden css in group-header when dl exists inside that class which indicates\n mark up is generated from cosmos which differentiates from normal table cell markup */\n .group-wrapper .group-context-count dl {\n grid-template-columns: auto;\n }\n\n .fallback,\n .fallback-footer {\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n position: absolute;\n width: 100%;\n z-index: -1;\n box-sizing: var(--box-sizing);\n }\n\n .fallback {\n /* stylelint-disable unit-allowed-list */\n top: -1px;\n border-bottom: var(--border-style);\n }\n\n .fallback-footer {\n top: 0;\n border-top: var(--border-style);\n }\n\n .sticky-header {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 6;\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n }\n\n .cell {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n\n .icons-ph {\n /* Maintaining action button aspect ratio of 1:1 with 24*24px width and height */\n min-width: 1.5rem;\n }\n\n &.custom-item {\n width: 10em;\n }\n }\n\n .cell:focus {\n outline: 0.125rem auto var(--medium-blue);\n }\n\n .cell.editable-cell:focus {\n outline: none 0;\n }\n\n .editable-cell > span {\n height: 100%;\n display: flex;\n padding: 0 6px;\n align-items: center;\n }\n\n .row {\n display: inline-flex;\n height: var(--row-height);\n outline: none 0;\n transition: transform 0.5s var(--animation-ease);\n box-sizing: var(--box-sizing);\n position: relative;\n\n > .row-select-handle {\n display: flex;\n justify-content: center;\n &:active {\n outline: none;\n }\n\n > .header-lable-container {\n min-width: 20px;\n }\n /* stylelint-disable selector-max-class */\n &.cell-fixed > .cell-content {\n flex-grow: unset;\n }\n }\n\n > .cell,\n .group-header-aggregation-row > .cell {\n transition: transform 0.5s var(--animation-ease);\n border-right: var(--border-style);\n position: relative;\n ${!theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n display: flex;\n align-items: center;\n\n &::after {\n opacity: 1;\n transition: opacity 0.1s var(--animation-ease);\n }\n\n .row-action-menu {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.cell-action {\n position: sticky;\n z-index: 4;\n right: 0;\n border-right: 0;\n justify-content: center;\n border-left: var(--border-style);\n\n /* The below styles are needed to avoid ellipses in safari when no text is present\n and to hide the 'Actions' label */\n\n /* stylelint-disable max-nesting-depth */\n\n div.header-label {\n text-overflow: unset;\n }\n }\n &.aggregateCell {\n background-color: var(--header-bg-color);\n }\n }\n\n /** Adds bottom border to the last row of a group, when striped-rows are enabled */\n &:has(+ .group-header-row) > .cell {\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n &.header > .cell {\n border-bottom: var(--border-style);\n }\n .group-header-aggregation-row {\n > .cell {\n &.cell-action {\n overflow: initial;\n\n /* extending border on the top left of row action cell as we need to show border for at the end group label value when row actions are present */\n &::before {\n content: '';\n position: absolute;\n inline-size: 0;\n inset-inline-start: calc(var(--border-width) * -1);\n inset-block-start: calc(var(--group-header-height) * -1);\n block-size: var(--group-header-height);\n border-inline-start: var(--border-style);\n }\n }\n }\n }\n\n > .cell-action {\n background-color: var(--primary-background);\n }\n\n > .row-reorder-handle {\n padding: 0;\n border-right: 0 !important;\n justify-content: center;\n cursor: move;\n }\n\n .aggregateCell.cell {\n border-right: none;\n }\n\n > .cell.cell-fixed,\n .group-header-aggregation-row > .cell-fixed {\n position: var(--cell-fixed-position);\n z-index: 4;\n\n ${showFreezeLine &&\n css`\n &.cell-last-frozen {\n border-right: solid 1px var(--border-color-freeze);\n box-shadow: calc(${theme.base.spacing} * 0.25) 0 0 0 ${freezeLineShadowTransparent};\n transition: 0.5s;\n }\n `}\n\n /* As the row select column and row dragDrop column always have to be frozen */\n &[data-col-id='RowSelect'],\n &[data-col-id='RowDragDrop'],\n &[data-col-id='RowError'] {\n position: sticky;\n flex-shrink: 0;\n z-index: 5;\n }\n }\n\n > .cell.cell-fixed:focus-within,\n .group-header-aggregation-row > .cell-fixed {\n z-index: 6;\n }\n\n &.click {\n cursor: pointer;\n }\n\n &:last-child {\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n > .cell {\n &:first-child {\n border-end-start-radius: inherit;\n }\n\n &:last-child {\n border-end-end-radius: inherit;\n }\n\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n }\n }\n .row:not(.row-error):not(.group-header-row):not(.header) {\n .cell-fixed {\n background: var(--primary-background);\n }\n .cell-fixed.aggregateCell {\n background: var(--header-bg-color);\n }\n }\n ${theme.components.table['striped-rows'] &&\n css`\n /* Targets rows with an odd data-index attribute, excluding group header rows */\n .row[data-index$='1']:not(.group-header-row):not(.header),\n .row[data-index$='3']:not(.group-header-row):not(.header),\n .row[data-index$='5']:not(.group-header-row):not(.header),\n .row[data-index$='7']:not(.group-header-row):not(.header),\n .row[data-index$='9']:not(.group-header-row):not(.header) {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n .cell-fixed {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n }\n > .cell-action {\n background: ${oddRowBackgroundColor};\n }\n }\n .row[data-index$='0']:not(.group-header-row):not(.header),\n .row[data-index$='2']:not(.group-header-row):not(.header),\n .row[data-index$='4']:not(.group-header-row):not(.header),\n .row[data-index$='6']:not(.group-header-row):not(.header),\n .row[data-index$='8']:not(.group-header-row):not(.header) {\n background: var(--primary-background);\n .cell-fixed {\n background: var(--primary-background);\n }\n > .cell-action {\n background: var(--primary-background);\n }\n }\n `}\n\n .row-error {\n background: ${mix(\n 0.1,\n theme.components['form-field'].error['status-color'],\n theme.base.palette['primary-background']\n )};\n\n /* stylelint-disable no-descending-specificity */\n .cell-fixed,\n .cell-action {\n background: inherit;\n }\n\n > .cell:not(.cell-fixed):not(.cell-action) {\n background: none;\n }\n }\n\n .sort-info-container {\n .sort-sequence {\n font-size: 0.625rem;\n color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n\n .filter-info-container {\n display: flex;\n justify-content: center;\n align-items: center;\n\n svg {\n width: 14px;\n height: 14px;\n }\n }\n\n .cell.row-error-column {\n padding: 0;\n border-right: 0;\n text-align: right;\n outline: none;\n\n /* Focus handling will be done as part of interation 2: EPIC-88751 */\n\n svg {\n color: ${theme.base.colors.red.medium};\n }\n }\n\n .editable-cell {\n padding: 0;\n border: 2px solid ${theme.base.palette.interactive} !important;\n box-shadow: 0 0 1px 1px rgba(0, 118, 209) !important;\n }\n\n .editable-cell input {\n border: none;\n outline: none;\n min-width: calc(100%);\n min-height: 0;\n max-height: 100%;\n box-shadow: none !important;\n border-radius: 0;\n }\n\n .editable-cell.align-right input {\n justify-content: right;\n }\n\n &.show-expand-collapse-all {\n .row > .cell-first {\n padding-left: calc(var(--expand-collapse-all-width) + var(--cell-padding) + 0.25rem);\n &.row-reorder-handle,\n &.row-error-column {\n padding: 0;\n }\n &.row-select-handle {\n padding-left: calc(var(--expand-collapse-all-width) + 0.25rem);\n }\n }\n\n .row-container .row > .cell-first {\n &.row-select-handle {\n padding-inline-start: calc(\n var(--expand-collapse-all-width) - var(--cell-padding) + 0.25rem\n );\n }\n }\n\n /* stylelint-enable selector-max-class */\n .expand-collapse-all {\n position: absolute;\n width: var(--expand-collapse-all-width);\n z-index: 10;\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n border-right: var(--border-style);\n border-bottom: var(--border-style);\n border-start-start-radius: ${theme.base['border-radius']};\n padding-inline-start: 0.125rem;\n margin-inline-start: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: -0.25rem;\n width: 0.25rem;\n height: 100%;\n background-color: var(--header-bg-color);\n z-index: 12;\n }\n\n > button {\n color: var(--forground-color);\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n .no-border-right {\n border-right: 0;\n }\n }\n\n /* stylelint-disable selector-max-class */\n\n .scroll-end {\n &.row-container > .row:last-child {\n & > .cell,\n & .group-header-aggregation-row > .cell {\n border-bottom: 0;\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n .header {\n font-weight: var(--font-weight-semi-bold);\n position: relative; /* This is required to position .border-fix element */\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n\n > .cell.row-error-column {\n border-right: 0;\n }\n > .cell {\n display: flex;\n justify-content: space-between;\n align-items: center;\n z-index: 2;\n position: relative;\n cursor: pointer;\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n font-weight: ${theme.base['font-weight'].bold};\n font-size: ${fontSize.xxs};\n border-right: var(--border-style);\n padding: var(--header-cell-padding);\n\n &:first-child {\n border-start-start-radius: inherit;\n }\n\n &:last-child {\n border-start-end-radius: inherit;\n }\n\n .header-lable-container {\n display: inline-flex;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ${fontSize.xs};\n font-weight: var(--font-weight-semi-bold);\n align-items: center;\n gap: 0.125rem;\n }\n\n .header-label {\n overflow: hidden;\n text-overflow: ellipsis;\n\n /* To avoid browser tooltip when we get ellipsis in safari */\n &::after {\n content: '';\n display: block;\n }\n\n /* To utilize smart tooltip making it as a non-box element */\n /* stylelint-disable selector-max-class */\n .cell-content {\n display: contents;\n }\n }\n }\n\n > .row-reorder-handle {\n padding: 0;\n }\n\n > .row-select-handle {\n /* Nullifying padding applied from .header > .cell */\n padding: 0;\n justify-content: center;\n }\n\n > .cell-first {\n padding: 0 var(--cell-padding);\n }\n\n .row {\n border-bottom: none;\n }\n }\n\n /* 4 selectors required as aggregateCell of only footer need this effect */\n\n .pContainer:not(.pContainerScroll) .footer .aggregateCell.cell {\n border-bottom: none;\n }\n\n /* stylelint-enable selector-max-class */\n .row .cell.cell-last {\n border-right: 0;\n flex-grow: 1;\n }\n\n .row-container {\n --data-row-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding)\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--data-row-height)'};\n &:not(.wrap-content-height) > .row:not(.group-header-row) {\n height: var(--data-row-height);\n }\n\n & > .row:not(.group-header-row) {\n min-width: 100%;\n }\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n & > .row .cell-content {\n /*\n * Using box sizing content-box so that the padding is not considered for the alignment of the cell content.\n * Vertical alignment is done using flex and max-height below even though the .cell-content might overflow due to padding + content size.\n */\n box-sizing: content-box;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: break-all;\n flex-grow: 1;\n\n /* Adding padding on .cell-content so that focus rings can appear properly and doesn't clip due to overflow: hidden */\n padding: var(--cell-vertical-padding) var(--cell-padding);\n\n /* setting max-height so that the elements with more height like RTL, align with the row density height */\n max-height: var(--data-row-height);\n\n /* hiding scroll bar in case the cell render introduces scrollbar based on its implementation */\n & * {\n scrollbar-width: none;\n }\n\n /* in case of combine columns, removing padding from parent cell-content as children already have the padding */\n &:has(.combined-cell) {\n padding: 0;\n\n /* stylelint-disable-next-line selector-max-class */\n .cell-content {\n flex-grow: unset;\n }\n }\n }\n }\n\n .row .aggregateCell .cell-content {\n line-height: initial;\n padding: 0;\n }\n\n .short-height,\n .medium-height {\n ${StyledStatus} {\n white-space: nowrap;\n }\n }\n\n .short-height {\n ${StyledRadioCheck} ${StyledLabel} {\n min-height: auto;\n }\n }\n\n .medium-height {\n --row-height-multiplier: 4 / 3;\n }\n\n .tall-height {\n --row-height-multiplier: calc(4 / 3 + 0.5);\n > .row:not(.group-header-row) {\n > .cell {\n display: inline-grid;\n align-items: start;\n white-space: normal;\n word-break: break-all;\n grid-auto-flow: column;\n\n :has(> ${CellIcon}) {\n /* Adds spacing between children when icons are rendered alongside cell content in the cell container. */\n justify-content: space-between;\n }\n\n /* stylelint-disable selector-max-class */\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .wrap-content-height {\n --row-height-multiplier: 4 / 3;\n --row-min-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding) * 2\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--row-min-height)'};\n\n > .row:not(.group-header-row) {\n height: auto;\n min-height: var(--row-min-height);\n > .cell {\n white-space: normal;\n\n /* -- For BUG-625508 -- */\n word-break: break-word;\n display: inline-grid;\n align-items: start;\n padding-top: var(--cell-vertical-padding);\n padding-bottom: var(--cell-vertical-padding);\n grid-auto-flow: column;\n\n :has(> ${CellIcon}) {\n /* Adds spacing between children when icons are rendered alongside cell content in the cell container. */\n justify-content: space-between;\n }\n\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n /* for full-content, the row cells should adjust according to content */\n max-height: none;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .footer {\n .row {\n .cell {\n padding: 0;\n }\n }\n }\n\n /* stylelint-disable no-duplicate-selectors */\n .row-container {\n position: absolute;\n display: grid;\n width: 100%;\n font-size: ${fontSize.s};\n\n > .group-header-row,\n .hierarchical-group-footer-row {\n height: var(--group-header-height);\n .cell {\n padding: 0;\n border-right-width: 0;\n }\n }\n\n > .hierarchical-group-header-row {\n height: var(--group-header-height);\n }\n input.checkbox-on-hover + label {\n opacity: 0;\n }\n input.checkbox-on-hover:checked + label {\n opacity: 1;\n }\n .row.selected-row {\n background-color: ${selectedRowColor};\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${selectedRowColor};\n }\n }\n .row-on-hover:hover {\n background-color: ${lightGreyColor};\n input.checkbox-on-hover + label {\n opacity: 1;\n }\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${lightGreyColor};\n }\n }\n .row.hierarchical-group-footer-row {\n .cell-fixed {\n background: ${lightGreyColor};\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n\n .toolbar-button-applied {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .toolbar-button {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .column-resizer {\n cursor: col-resize;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n width: 0.25rem;\n height: 100%;\n }\n\n .column-resizer:hover,\n .column-resizer:active {\n background: var(--interactive);\n }\n\n .align-right {\n justify-content: right;\n\n .cell-content {\n text-align: right;\n }\n }\n\n .align-left {\n justify-content: left;\n\n .cell-content {\n text-align: left;\n }\n }\n\n .align-center {\n justify-content: center;\n\n .cell-content {\n text-align: center;\n }\n }\n\n .popper {\n div.row {\n display: flex;\n vertical-align: middle;\n line-height: unset;\n border-bottom: none;\n outline: none 0;\n height: auto;\n }\n }\n `;\n});\n\nexport default StyledTableContainer;\n"]}
|
|
1
|
+
{"version":3,"file":"StyledTableContainer.js","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,GAAG,EACH,aAAa,EACb,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAChG,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAEtF,OAAO,EAAE,mCAAmC,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,oBAAoB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,cAAK,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC,CAAC,CAAC,CAAC,EAC7F,KAAK,EACL,IAAI,EACJ,YAAY,EACb,EAAE,EAAE;IACH,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,MAA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;;;;;;;;;;;+BAYW,oBAAoB;QAC3C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,uBAAuB;;;;;;;;;;;;;;;;mBAgBd,QAAQ;;;;;;;;;;;;;;YAcf,QAAQ;;;;;;;;;;;;;;;;;;;;mBAoBD,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;4BAqBD,gBAAgB;;;;;8BAKd,gBAAgB;;;;4BAIlB,cAAc;;;;;;;;8BAQZ,cAAc;;;;;wBAKpB,cAAc;;;;;;;;;uBASf,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;uBAKlB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport {\n getLuminance,\n meetsContrastGuidelines,\n mix,\n readableColor,\n transparentize\n} from 'polished';\n\nimport { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';\nimport { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\nimport {\n StyledLabel,\n StyledProgressBackdrop,\n calculateFontSize,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\n\nimport { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';\n\nimport { CellIcon } from './CellWrapper';\n\nconst StyledTableContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(({\n theme,\n view,\n isFullscreen\n}) => {\n const isAggregationApplied = view.columns?.filter(c => !c.hidden).some(c => c.aggregated);\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const showFreezeLine =\n view.state.responsive?.sm &&\n !(view.hasNoRecords || view.hasNoFrozenColumns || view.bHideFreezeLine);\n const selectedRowColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n const lightGreyColor = theme.base.colors.gray['extra-light'];\n const freezeLineShadowTransparent = transparentize(\n 0.9,\n theme.components.table.header['foreground-color']\n );\n const oddRowBackgroundColor =\n getLuminance(theme.components.table.body['secondary-background-color']) > 0.5\n ? theme.components.table.body['secondary-background-color']\n : mix(\n 0.75,\n theme.components.table.body['background-color'],\n theme.components.table.body['secondary-background-color']\n );\n\n const headerForegroundContrast = meetsContrastGuidelines(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n ).AA;\n const usableHeaderForeground = headerForegroundContrast\n ? theme.components.table.header['foreground-color']\n : readableColor(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n );\n const oddRowContrast = meetsContrastGuidelines(\n theme.components.table.body['foreground-color'],\n oddRowBackgroundColor\n ).AA;\n const useableOddRowForeground = oddRowContrast\n ? theme.components.table.body['foreground-color']\n : readableColor(theme.components.table.body['foreground-color'], oddRowBackgroundColor);\n\n return css`\n --primary-background: ${theme.base.palette['primary-background']};\n --secondary-background: ${theme.components.table.header['background-color']};\n --forground-color: ${theme.base.palette['foreground-color']};\n --interactive: ${theme.base.palette.interactive};\n --medium-blue: ${theme.base.colors.blue.medium};\n --border-color: ${theme.base.palette['border-line']};\n --border-color-freeze: #a5a5a5;\n --border-width: 0.062rem;\n --border-style: var(--border-width) solid var(--border-color);\n --font-stretch: ${theme.components.table.typography['font-stretch']};\n --letter-spacing: ${theme.components.table.typography['letter-spacing']};\n --cell-padding: ${theme.base.spacing};\n --cell-vertical-padding: calc(${theme.base.spacing} * 0.5);\n --header-cell-padding: 0 0.125rem 0 var(--cell-padding);\n --header-bg-color: var(--secondary-background);\n --header-fg-color: ${usableHeaderForeground};\n --default-group-header-height: 1.5rem;\n --group-header-height: var(--default-group-header-height);\n --box-sizing: content-box;\n --animation-ease: ${theme.base.animation.timing.ease};\n --font-weight-semi-bold: ${theme.base['font-weight']['semi-bold']};\n --row-height-multiplier: 1.125;\n --cell-fixed-position: sticky;\n position: relative;\n ${() => generateRSHeightStyles({ view, isFullscreen })}\n\n .small-screen-table {\n --cell-fixed-position: static;\n }\n\n .container {\n ${() => generateRSDataContainerHeightStyles()};\n border: var(--border-style);\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n position: relative;\n letter-spacing: var(--letter-spacing);\n font-stretch: var(--font-stretch);\n ${StyledTabPanel} & ${StyledProgressBackdrop} {\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n }\n }\n\n .hide-rows-till-ready .row[aria-rowindex] {\n visibility: hidden;\n }\n\n .table-drag-proxy {\n background: rgba(0, 0, 0, 0.21);\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .table-drag-line {\n background: #999999;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 0.12rem;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .cell-fixed {\n z-index: 1;\n }\n\n .group-wrapper {\n overflow: hidden;\n display: inline-flex;\n line-height: var(--group-header-height);\n\n .group-context-count {\n display: inline-flex;\n overflow: hidden;\n }\n }\n\n /* In review mode(Ex: Tabs) cosmos components are rendered and mark up is not compatible with\n group-wrapper cell. Overridden css in group-header when dl exists inside that class which indicates\n mark up is generated from cosmos which differentiates from normal table cell markup */\n .group-wrapper .group-context-count dl {\n grid-template-columns: auto;\n }\n\n .fallback,\n .fallback-footer {\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n position: absolute;\n width: 100%;\n z-index: -1;\n box-sizing: var(--box-sizing);\n }\n\n .fallback {\n /* stylelint-disable unit-allowed-list */\n top: -1px;\n border-bottom: var(--border-style);\n }\n\n .fallback-footer {\n top: 0;\n border-top: var(--border-style);\n }\n\n .sticky-header {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 6;\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n }\n\n .cell {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n\n .icons-ph {\n /* Maintaining action button aspect ratio of 1:1 with 24*24px width and height */\n min-width: 1.5rem;\n }\n\n &.custom-item {\n width: 10em;\n }\n }\n\n .cell:focus {\n outline: 0.125rem auto var(--medium-blue);\n }\n\n .cell.selection-border:focus {\n outline: none 0;\n }\n\n .row {\n display: inline-flex;\n height: var(--row-height);\n outline: none 0;\n transition: transform 0.5s var(--animation-ease);\n box-sizing: var(--box-sizing);\n position: relative;\n\n > .row-select-handle {\n display: flex;\n justify-content: center;\n &:active {\n outline: none;\n }\n\n > .header-lable-container {\n min-width: 20px;\n }\n /* stylelint-disable selector-max-class */\n &.cell-fixed > .cell-content {\n flex-grow: unset;\n }\n }\n\n > .cell,\n .group-header-aggregation-row > .cell {\n transition: transform 0.5s var(--animation-ease);\n border-right: var(--border-style);\n position: relative;\n ${!theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n display: flex;\n align-items: center;\n\n &::after {\n opacity: 1;\n transition: opacity 0.1s var(--animation-ease);\n }\n\n .row-action-menu {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.cell-action {\n position: sticky;\n z-index: 4;\n right: 0;\n border-right: 0;\n justify-content: center;\n border-left: var(--border-style);\n\n /* The below styles are needed to avoid ellipses in safari when no text is present\n and to hide the 'Actions' label */\n\n /* stylelint-disable max-nesting-depth */\n\n div.header-label {\n text-overflow: unset;\n }\n }\n &.aggregateCell {\n background-color: var(--header-bg-color);\n }\n }\n\n /** Adds bottom border to the last row of a group, when striped-rows are enabled */\n &:has(+ .group-header-row) > .cell {\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n &.header > .cell {\n border-bottom: var(--border-style);\n }\n .group-header-aggregation-row {\n > .cell {\n &.cell-action {\n overflow: initial;\n\n /* extending border on the top left of row action cell as we need to show border for at the end group label value when row actions are present */\n &::before {\n content: '';\n position: absolute;\n inline-size: 0;\n inset-inline-start: calc(var(--border-width) * -1);\n inset-block-start: calc(var(--group-header-height) * -1);\n block-size: var(--group-header-height);\n border-inline-start: var(--border-style);\n }\n }\n }\n }\n\n > .cell-action {\n background-color: var(--primary-background);\n }\n\n > .row-reorder-handle {\n padding: 0;\n border-right: 0 !important;\n justify-content: center;\n cursor: move;\n }\n\n .aggregateCell.cell {\n border-right: none;\n }\n\n > .cell.cell-fixed,\n .group-header-aggregation-row > .cell-fixed {\n position: var(--cell-fixed-position);\n z-index: 4;\n\n ${showFreezeLine &&\n css`\n &.cell-last-frozen {\n border-right: solid 1px var(--border-color-freeze);\n box-shadow: calc(${theme.base.spacing} * 0.25) 0 0 0 ${freezeLineShadowTransparent};\n transition: 0.5s;\n }\n `}\n\n /* As the row select column and row dragDrop column always have to be frozen */\n &[data-col-id='RowSelect'],\n &[data-col-id='RowDragDrop'],\n &[data-col-id='RowError'] {\n position: sticky;\n flex-shrink: 0;\n z-index: 5;\n }\n }\n\n > .cell.cell-fixed:focus-within,\n .group-header-aggregation-row > .cell-fixed {\n z-index: 6;\n }\n\n &.click {\n cursor: pointer;\n }\n\n &:last-child {\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n > .cell {\n &:first-child {\n border-end-start-radius: inherit;\n }\n\n &:last-child {\n border-end-end-radius: inherit;\n }\n\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n }\n }\n .row:not(.row-error):not(.group-header-row):not(.header) {\n .cell-fixed {\n background: var(--primary-background);\n }\n .cell-fixed.aggregateCell {\n background: var(--header-bg-color);\n }\n }\n ${theme.components.table['striped-rows'] &&\n css`\n /* Targets rows with an odd data-index attribute, excluding group header rows */\n .row[data-index$='1']:not(.group-header-row):not(.header),\n .row[data-index$='3']:not(.group-header-row):not(.header),\n .row[data-index$='5']:not(.group-header-row):not(.header),\n .row[data-index$='7']:not(.group-header-row):not(.header),\n .row[data-index$='9']:not(.group-header-row):not(.header) {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n .cell-fixed {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n }\n > .cell-action {\n background: ${oddRowBackgroundColor};\n }\n }\n .row[data-index$='0']:not(.group-header-row):not(.header),\n .row[data-index$='2']:not(.group-header-row):not(.header),\n .row[data-index$='4']:not(.group-header-row):not(.header),\n .row[data-index$='6']:not(.group-header-row):not(.header),\n .row[data-index$='8']:not(.group-header-row):not(.header) {\n background: var(--primary-background);\n .cell-fixed {\n background: var(--primary-background);\n }\n > .cell-action {\n background: var(--primary-background);\n }\n }\n `}\n\n .row-error {\n background: ${mix(\n 0.1,\n theme.components['form-field'].error['status-color'],\n theme.base.palette['primary-background']\n )};\n\n /* stylelint-disable no-descending-specificity */\n .cell-fixed,\n .cell-action {\n background: inherit;\n }\n\n > .cell:not(.cell-fixed):not(.cell-action) {\n background: none;\n }\n }\n\n .sort-info-container {\n .sort-sequence {\n font-size: 0.625rem;\n color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n\n .filter-info-container {\n display: flex;\n justify-content: center;\n align-items: center;\n\n svg {\n width: 14px;\n height: 14px;\n }\n }\n\n .cell.row-error-column {\n padding: 0;\n border-right: 0;\n text-align: right;\n outline: none;\n\n /* Focus handling will be done as part of interation 2: EPIC-88751 */\n\n svg {\n color: ${theme.base.colors.red.medium};\n }\n }\n\n .cell-right-align .filter-info-container svg {\n margin: 0 0.312rem 0 0;\n }\n\n &.show-expand-collapse-all {\n .row > .cell-first {\n padding-left: calc(var(--expand-collapse-all-width) + var(--cell-padding) + 0.25rem);\n &.row-reorder-handle,\n &.row-error-column {\n padding: 0;\n }\n &.row-select-handle {\n padding-left: calc(var(--expand-collapse-all-width) + 0.25rem);\n }\n }\n\n .row-container .row > .cell-first {\n &.row-select-handle {\n padding-inline-start: calc(\n var(--expand-collapse-all-width) - var(--cell-padding) + 0.25rem\n );\n }\n }\n\n /* stylelint-enable selector-max-class */\n .expand-collapse-all {\n position: absolute;\n width: var(--expand-collapse-all-width);\n z-index: 10;\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n border-right: var(--border-style);\n border-bottom: var(--border-style);\n border-start-start-radius: ${theme.base['border-radius']};\n padding-inline-start: 0.125rem;\n margin-inline-start: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: -0.25rem;\n width: 0.25rem;\n height: 100%;\n background-color: var(--header-bg-color);\n z-index: 12;\n }\n\n > button {\n color: var(--forground-color);\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n .no-border-right {\n border-right: 0;\n }\n }\n\n /* stylelint-disable selector-max-class */\n\n .scroll-end {\n &.row-container > .row:last-child {\n & > .cell,\n & .group-header-aggregation-row > .cell {\n border-bottom: 0;\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n .header {\n font-weight: var(--font-weight-semi-bold);\n position: relative; /* This is required to position .border-fix element */\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n\n > .cell.row-error-column {\n border-right: 0;\n }\n > .cell {\n display: flex;\n justify-content: space-between;\n align-items: center;\n z-index: 2;\n position: relative;\n cursor: pointer;\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n font-weight: ${theme.base['font-weight'].bold};\n font-size: ${fontSize.xxs};\n border-right: var(--border-style);\n padding: var(--header-cell-padding);\n\n &:first-child {\n border-start-start-radius: inherit;\n }\n\n &:last-child {\n border-start-end-radius: inherit;\n }\n\n .header-lable-container {\n display: inline-flex;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ${fontSize.xs};\n font-weight: var(--font-weight-semi-bold);\n align-items: center;\n gap: 0.125rem;\n }\n\n .header-label {\n overflow: hidden;\n text-overflow: ellipsis;\n\n /* To avoid browser tooltip when we get ellipsis in safari */\n &::after {\n content: '';\n display: block;\n }\n\n /* To utilize smart tooltip making it as a non-box element */\n /* stylelint-disable selector-max-class */\n .cell-content {\n display: contents;\n }\n }\n }\n\n > .row-reorder-handle {\n padding: 0;\n }\n\n > .row-select-handle {\n /* Nullifying padding applied from .header > .cell */\n padding: 0;\n justify-content: center;\n }\n\n > .cell-first {\n padding: 0 var(--cell-padding);\n }\n\n .row {\n border-bottom: none;\n }\n }\n\n /* 4 selectors required as aggregateCell of only footer need this effect */\n\n .pContainer:not(.pContainerScroll) .footer .aggregateCell.cell {\n border-bottom: none;\n }\n\n /* stylelint-enable selector-max-class */\n .row .cell.cell-last {\n border-right: 0;\n flex-grow: 1;\n }\n\n .row-container {\n --data-row-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding)\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--data-row-height)'};\n &:not(.wrap-content-height) > .row:not(.group-header-row) {\n height: var(--data-row-height);\n }\n\n & > .row:not(.group-header-row) {\n min-width: 100%;\n }\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n & > .row .cell-content {\n /*\n * Using box sizing content-box so that the padding is not considered for the alignment of the cell content.\n * Vertical alignment is done using flex and max-height below even though the .cell-content might overflow due to padding + content size.\n */\n box-sizing: content-box;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: break-all;\n flex-grow: 1;\n\n /* Adding padding on .cell-content so that focus rings can appear properly and doesn't clip due to overflow: hidden */\n padding: var(--cell-vertical-padding) var(--cell-padding);\n\n /* setting max-height so that the elements with more height like RTL, align with the row density height */\n max-height: var(--data-row-height);\n\n /* hiding scroll bar in case the cell render introduces scrollbar based on its implementation */\n & * {\n scrollbar-width: none;\n }\n\n /* in case of combine columns, removing padding from parent cell-content as children already have the padding */\n &:has(.combined-cell) {\n padding: 0;\n\n /* stylelint-disable-next-line selector-max-class */\n .cell-content {\n flex-grow: unset;\n }\n }\n }\n }\n\n .row .aggregateCell .cell-content {\n line-height: initial;\n padding: 0;\n }\n\n .short-height,\n .medium-height {\n ${StyledStatus} {\n white-space: nowrap;\n }\n }\n\n .short-height {\n ${StyledRadioCheck} ${StyledLabel} {\n min-height: auto;\n }\n }\n\n .medium-height {\n --row-height-multiplier: 4 / 3;\n }\n\n .tall-height {\n --row-height-multiplier: calc(4 / 3 + 0.5);\n > .row:not(.group-header-row) {\n > .cell {\n display: inline-grid;\n align-items: start;\n white-space: normal;\n word-break: break-all;\n grid-auto-flow: column;\n\n :has(> ${CellIcon}) {\n /* Adds spacing between children when icons are rendered alongside cell content in the cell container. */\n justify-content: space-between;\n }\n\n /* stylelint-disable selector-max-class */\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .wrap-content-height {\n --row-height-multiplier: 4 / 3;\n --row-min-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding) * 2\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--row-min-height)'};\n\n > .row:not(.group-header-row) {\n height: auto;\n min-height: var(--row-min-height);\n > .cell {\n white-space: normal;\n\n /* -- For BUG-625508 -- */\n word-break: break-word;\n display: inline-grid;\n align-items: start;\n padding-top: var(--cell-vertical-padding);\n padding-bottom: var(--cell-vertical-padding);\n grid-auto-flow: column;\n\n :has(> ${CellIcon}) {\n /* Adds spacing between children when icons are rendered alongside cell content in the cell container. */\n justify-content: space-between;\n }\n\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n /* for full-content, the row cells should adjust according to content */\n max-height: none;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .footer {\n .row {\n .cell {\n padding: 0;\n }\n }\n }\n\n /* stylelint-disable no-duplicate-selectors */\n .row-container {\n position: absolute;\n display: grid;\n width: 100%;\n font-size: ${fontSize.s};\n\n > .group-header-row,\n .hierarchical-group-footer-row {\n height: var(--group-header-height);\n .cell {\n padding: 0;\n border-right-width: 0;\n }\n }\n\n > .hierarchical-group-header-row {\n height: var(--group-header-height);\n }\n input.checkbox-on-hover + label {\n opacity: 0;\n }\n input.checkbox-on-hover:checked + label {\n opacity: 1;\n }\n .row.selected-row {\n background-color: ${selectedRowColor};\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${selectedRowColor};\n }\n }\n .row-on-hover:hover {\n background-color: ${lightGreyColor};\n input.checkbox-on-hover + label {\n opacity: 1;\n }\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${lightGreyColor};\n }\n }\n .row.hierarchical-group-footer-row {\n .cell-fixed {\n background: ${lightGreyColor};\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n\n .toolbar-button-applied {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .toolbar-button {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .column-resizer {\n cursor: col-resize;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n width: 0.25rem;\n height: 100%;\n }\n\n .column-resizer:hover,\n .column-resizer:active {\n background: var(--interactive);\n }\n\n .align-right {\n justify-content: right;\n\n .cell-content {\n text-align: right;\n }\n }\n\n .align-left {\n justify-content: left;\n\n .cell-content {\n text-align: left;\n }\n }\n\n .align-center {\n justify-content: center;\n\n .cell-content {\n text-align: center;\n }\n }\n\n .popper {\n div.row {\n display: flex;\n vertical-align: middle;\n line-height: unset;\n border-bottom: none;\n outline: none 0;\n height: auto;\n }\n }\n `;\n});\n\nexport default StyledTableContainer;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-react",
|
|
3
|
-
"version": "9.0.0-build.
|
|
3
|
+
"version": "9.0.0-build.12.0",
|
|
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,9 +14,9 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "9.0.0-build.
|
|
18
|
-
"@pega/cosmos-react-core": "9.0.0-build.
|
|
19
|
-
"@pega/cosmos-react-rte": "9.0.0-build.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "9.0.0-build.12.0",
|
|
18
|
+
"@pega/cosmos-react-core": "9.0.0-build.12.0",
|
|
19
|
+
"@pega/cosmos-react-rte": "9.0.0-build.12.0",
|
|
20
20
|
"@types/lodash.get": "^4.4.9",
|
|
21
21
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
22
22
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dayjs": "^1.11.13",
|
|
25
25
|
"fast-deep-equal": "^3.1.3",
|
|
26
26
|
"lodash.get": "^4.4.2",
|
|
27
|
-
"pega-repeating-structures-core": "npm:@pega/lists-core@9.0.0-build.
|
|
28
|
-
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.0.0-build.
|
|
27
|
+
"pega-repeating-structures-core": "npm:@pega/lists-core@9.0.0-build.12.0",
|
|
28
|
+
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.0.0-build.12.0",
|
|
29
29
|
"polished": "^4.1.0",
|
|
30
30
|
"prop-types": "^15.8.1",
|
|
31
31
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@testing-library/react": "^16.0.0",
|
|
45
45
|
"@testing-library/user-event": "^14.6.1",
|
|
46
46
|
"jest-axe": "^8.0.0",
|
|
47
|
-
"srs-utils": "9.0.0-build.
|
|
47
|
+
"srs-utils": "9.0.0-build.12.0",
|
|
48
48
|
"typescript": "~5.8.3"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default DateTime;
|
|
2
|
-
declare function DateTime(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace DateTime {
|
|
4
|
-
namespace propTypes {
|
|
5
|
-
let onCancel: PropTypes.Validator<(...args: any[]) => any>;
|
|
6
|
-
let onSubmit: PropTypes.Validator<(...args: any[]) => any>;
|
|
7
|
-
let getField: PropTypes.Validator<(...args: any[]) => any>;
|
|
8
|
-
let getValue: PropTypes.Validator<(...args: any[]) => any>;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
12
|
-
//# sourceMappingURL=DateTime.d.ts.map
|
package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.jsx"],"names":[],"mappings":";AAUA,+EAoCC;;;;;;;;;sBA7CqB,YAAY"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Input } from '@pega/cosmos-react-core';
|
|
5
|
-
import { FieldType } from 'pega-repeating-structures-core';
|
|
6
|
-
const styles = {
|
|
7
|
-
input: { width: '100%' }
|
|
8
|
-
};
|
|
9
|
-
function DateTime(props) {
|
|
10
|
-
const { getField, getValue } = props;
|
|
11
|
-
const { type } = getField();
|
|
12
|
-
const oldValue = getValue();
|
|
13
|
-
const [value, setValue] = useState(type === FieldType.DATE_TIME ? oldValue?.slice(0, -1) : oldValue);
|
|
14
|
-
const inputRef = useRef(null);
|
|
15
|
-
const onChange = event => setValue(event.target.value);
|
|
16
|
-
const onEscape = event => {
|
|
17
|
-
if (event.key === 'Escape') {
|
|
18
|
-
props.onCancel();
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const onBlur = () => props.onSubmit({ oldValue, newValue: value });
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
inputRef.current?.focus();
|
|
24
|
-
}, [inputRef]);
|
|
25
|
-
return (_jsx(Input, { ...props, type: type === FieldType.DATE_TIME ? 'datetime-local' : type, value: value, style: styles.input, ref: ref => {
|
|
26
|
-
inputRef.current = ref;
|
|
27
|
-
}, onChange: onChange, onBlur: onBlur, onKeyDown: onEscape }));
|
|
28
|
-
}
|
|
29
|
-
DateTime.propTypes = {
|
|
30
|
-
onCancel: PropTypes.func.isRequired,
|
|
31
|
-
onSubmit: PropTypes.func.isRequired,
|
|
32
|
-
getField: PropTypes.func.isRequired,
|
|
33
|
-
getValue: PropTypes.func.isRequired
|
|
34
|
-
};
|
|
35
|
-
export default DateTime;
|
|
36
|
-
//# sourceMappingURL=DateTime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../../../../../Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACzB,CAAC;AAEF,SAAS,QAAQ,CAAC,KAAK;IACrB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC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AC,SAAS,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { useState, useRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Input } from '@pega/cosmos-react-core';\nimport { FieldType } from 'pega-repeating-structures-core';\n\nconst styles = {\n input: { width: '100%' }\n};\n\nfunction DateTime(props) {\n const { getField, getValue } = props;\n const { type } = getField();\n const oldValue = getValue();\n const [value, setValue] = useState(\n type === FieldType.DATE_TIME ? oldValue?.slice(0, -1) : oldValue\n );\n const inputRef = useRef(null);\n\n const onChange = event => setValue(event.target.value);\n\n const onEscape = event => {\n if (event.key === 'Escape') {\n props.onCancel();\n }\n };\n\n const onBlur = () => props.onSubmit({ oldValue, newValue: value });\n useEffect(() => {\n inputRef.current?.focus();\n }, [inputRef]);\n\n return (\n <Input\n {...props}\n type={type === FieldType.DATE_TIME ? 'datetime-local' : type}\n value={value}\n style={styles.input}\n ref={ref => {\n inputRef.current = ref;\n }}\n onChange={onChange}\n onBlur={onBlur}\n onKeyDown={onEscape}\n />\n );\n}\n\nDateTime.propTypes = {\n onCancel: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n getField: PropTypes.func.isRequired,\n getValue: PropTypes.func.isRequired\n};\n\nexport default DateTime;\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default RadioGroup;
|
|
2
|
-
declare function RadioGroup(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace RadioGroup {
|
|
4
|
-
namespace propTypes {
|
|
5
|
-
let onCancel: PropTypes.Validator<(...args: any[]) => any>;
|
|
6
|
-
let onSubmit: PropTypes.Validator<(...args: any[]) => any>;
|
|
7
|
-
let getField: PropTypes.Validator<(...args: any[]) => any>;
|
|
8
|
-
let getValue: PropTypes.Validator<(...args: any[]) => any>;
|
|
9
|
-
let getFormatter: PropTypes.Validator<(...args: any[]) => any>;
|
|
10
|
-
let renderFactory: PropTypes.Validator<(...args: any[]) => any>;
|
|
11
|
-
let resolveCellComponent: PropTypes.Validator<(...args: any[]) => any>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
import PropTypes from 'prop-types';
|
|
15
|
-
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.jsx"],"names":[],"mappings":";AASA,iFA+CC;;;;;;;;;;;;sBAvDqB,YAAY"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { RadioButton, RadioCheckGroup } from '@pega/cosmos-react-core';
|
|
6
|
-
import { FieldType } from 'pega-repeating-structures-core';
|
|
7
|
-
const StyledRadioGroup = styled.div ``;
|
|
8
|
-
function RadioGroup(props) {
|
|
9
|
-
const { getField, getValue, getFormatter, renderFactory, resolveCellComponent } = props;
|
|
10
|
-
const field = getField();
|
|
11
|
-
const { id } = field;
|
|
12
|
-
const oldValue = getValue();
|
|
13
|
-
const translatedValue = oldValue === 'null' || oldValue === '' || oldValue === null || typeof oldValue === 'undefined'
|
|
14
|
-
? 'Empty'
|
|
15
|
-
: oldValue;
|
|
16
|
-
const [value, setValue] = useState(translatedValue);
|
|
17
|
-
const radioOptions = field.type === FieldType.BOOLEAN ? [true, false, 'Empty'] : field.filterPickListOptions;
|
|
18
|
-
const onChange = event => {
|
|
19
|
-
setValue(event.target.id);
|
|
20
|
-
let newValue = event.target.id;
|
|
21
|
-
if (field.type === FieldType.BOOLEAN) {
|
|
22
|
-
if (event.target.id === 'Empty')
|
|
23
|
-
newValue = null;
|
|
24
|
-
else
|
|
25
|
-
newValue = event.target.id === 'true';
|
|
26
|
-
}
|
|
27
|
-
props.onSubmit({ oldValue, newValue });
|
|
28
|
-
};
|
|
29
|
-
return (_jsx(StyledRadioGroup, { children: _jsx(RadioCheckGroup, { name: id, children: radioOptions.map(item => {
|
|
30
|
-
const checkedProp = {};
|
|
31
|
-
if (item === value)
|
|
32
|
-
checkedProp.defaultChecked = true;
|
|
33
|
-
return (_jsx(RadioButton, { id: `${item}`, name: `${item}`, onClick: onChange, label: resolveCellComponent('cellRenderer', renderFactory, {
|
|
34
|
-
...props,
|
|
35
|
-
getValue: () => item.toString(),
|
|
36
|
-
getFormattedValue: () => getFormatter?.()?.(item) || item.toString()
|
|
37
|
-
}), ...checkedProp }, `${item}`));
|
|
38
|
-
}) }) }));
|
|
39
|
-
}
|
|
40
|
-
RadioGroup.propTypes = {
|
|
41
|
-
onCancel: PropTypes.func.isRequired,
|
|
42
|
-
onSubmit: PropTypes.func.isRequired,
|
|
43
|
-
getField: PropTypes.func.isRequired,
|
|
44
|
-
getValue: PropTypes.func.isRequired,
|
|
45
|
-
getFormatter: PropTypes.func.isRequired,
|
|
46
|
-
renderFactory: PropTypes.func.isRequired,
|
|
47
|
-
resolveCellComponent: PropTypes.func.isRequired
|
|
48
|
-
};
|
|
49
|
-
export default RadioGroup;
|
|
50
|
-
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../../../../Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EA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ChD,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport { RadioButton, RadioCheckGroup } from '@pega/cosmos-react-core';\nimport { FieldType } from 'pega-repeating-structures-core';\n\nconst StyledRadioGroup = styled.div``;\n\nfunction RadioGroup(props) {\n const { getField, getValue, getFormatter, renderFactory, resolveCellComponent } = props;\n const field = getField();\n const { id } = field;\n const oldValue = getValue();\n const translatedValue =\n oldValue === 'null' || oldValue === '' || oldValue === null || typeof oldValue === 'undefined'\n ? 'Empty'\n : oldValue;\n const [value, setValue] = useState(translatedValue);\n const radioOptions =\n field.type === FieldType.BOOLEAN ? [true, false, 'Empty'] : field.filterPickListOptions;\n const onChange = event => {\n setValue(event.target.id);\n let newValue = event.target.id;\n if (field.type === FieldType.BOOLEAN) {\n if (event.target.id === 'Empty') newValue = null;\n else newValue = event.target.id === 'true';\n }\n props.onSubmit({ oldValue, newValue });\n };\n\n return (\n <StyledRadioGroup>\n <RadioCheckGroup name={id}>\n {radioOptions.map(item => {\n const checkedProp = {};\n if (item === value) checkedProp.defaultChecked = true;\n\n return (\n <RadioButton\n key={`${item}`}\n id={`${item}`}\n name={`${item}`}\n onClick={onChange}\n label={resolveCellComponent('cellRenderer', renderFactory, {\n ...props,\n getValue: () => item.toString(),\n getFormattedValue: () => getFormatter?.()?.(item) || item.toString()\n })}\n {...checkedProp}\n />\n );\n })}\n </RadioCheckGroup>\n </StyledRadioGroup>\n );\n}\n\nRadioGroup.propTypes = {\n onCancel: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n getField: PropTypes.func.isRequired,\n getValue: PropTypes.func.isRequired,\n getFormatter: PropTypes.func.isRequired,\n renderFactory: PropTypes.func.isRequired,\n resolveCellComponent: PropTypes.func.isRequired\n};\n\nexport default RadioGroup;\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default TextInput;
|
|
2
|
-
declare function TextInput(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace TextInput {
|
|
4
|
-
namespace propTypes {
|
|
5
|
-
let onCancel: PropTypes.Validator<(...args: any[]) => any>;
|
|
6
|
-
let onSubmit: PropTypes.Validator<(...args: any[]) => any>;
|
|
7
|
-
let getField: PropTypes.Validator<(...args: any[]) => any>;
|
|
8
|
-
let getValue: PropTypes.Validator<(...args: any[]) => any>;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
12
|
-
//# sourceMappingURL=TextInput.d.ts.map
|
package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.jsx"],"names":[],"mappings":";AASA,gFA2CC;;;;;;;;;sBAnDqB,YAAY"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Input } from '@pega/cosmos-react-core';
|
|
5
|
-
const styles = {
|
|
6
|
-
input: { width: '100%', outline: 'none', border: 'none', boxShadow: 'none' }
|
|
7
|
-
};
|
|
8
|
-
function TextInput(props) {
|
|
9
|
-
const { getField, getValue } = props;
|
|
10
|
-
const { type } = getField();
|
|
11
|
-
const oldValue = getValue();
|
|
12
|
-
const [value, setValue] = useState(oldValue);
|
|
13
|
-
const inputRef = useRef(null);
|
|
14
|
-
const onChange = event => {
|
|
15
|
-
let { value: val } = event.target;
|
|
16
|
-
if (type?.toLowerCase() === 'number') {
|
|
17
|
-
val = parseInt(val, 10);
|
|
18
|
-
}
|
|
19
|
-
setValue(val);
|
|
20
|
-
};
|
|
21
|
-
const onKeyDown = event => {
|
|
22
|
-
if (event.key === 'Enter') {
|
|
23
|
-
props.onSubmit({ oldValue, newValue: value });
|
|
24
|
-
}
|
|
25
|
-
else if (event.key === 'Escape') {
|
|
26
|
-
props.onCancel();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const onBlur = () => props.onSubmit({ oldValue, newValue: value });
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
inputRef.current?.focus();
|
|
32
|
-
}, [inputRef]);
|
|
33
|
-
return (_jsx(Input, { ...props, value: value, type: type, style: styles.input, ref: ref => {
|
|
34
|
-
inputRef.current = ref;
|
|
35
|
-
}, onChange: onChange, onBlur: onBlur, onKeyDown: onKeyDown }));
|
|
36
|
-
}
|
|
37
|
-
TextInput.propTypes = {
|
|
38
|
-
onCancel: PropTypes.func.isRequired,
|
|
39
|
-
onSubmit: PropTypes.func.isRequired,
|
|
40
|
-
getField: PropTypes.func.isRequired,
|
|
41
|
-
getValue: PropTypes.func.isRequired
|
|
42
|
-
};
|
|
43
|
-
export default TextInput;
|
|
44
|
-
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../../../Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;CAC7E,CAAC;AAEF,SAAS,SAAS,CAAC,KAAK;IACtB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,E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;YACT,QAAQ,CAAC,OAAO,GAAG,GAAG,CAAC;QACzB,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,SAAS,GAAG;IACpB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useState, useRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Input } from '@pega/cosmos-react-core';\n\nconst styles = {\n input: { width: '100%', outline: 'none', border: 'none', boxShadow: 'none' }\n};\n\nfunction TextInput(props) {\n const { getField, getValue } = props;\n const { type } = getField();\n const oldValue = getValue();\n const [value, setValue] = useState(oldValue);\n const inputRef = useRef(null);\n\n const onChange = event => {\n let { value: val } = event.target;\n if (type?.toLowerCase() === 'number') {\n val = parseInt(val, 10);\n }\n setValue(val);\n };\n\n const onKeyDown = event => {\n if (event.key === 'Enter') {\n props.onSubmit({ oldValue, newValue: value });\n } else if (event.key === 'Escape') {\n props.onCancel();\n }\n };\n\n const onBlur = () => props.onSubmit({ oldValue, newValue: value });\n\n useEffect(() => {\n inputRef.current?.focus();\n }, [inputRef]);\n\n return (\n <Input\n {...props}\n value={value}\n type={type}\n style={styles.input}\n ref={ref => {\n inputRef.current = ref;\n }}\n onChange={onChange}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n />\n );\n}\n\nTextInput.propTypes = {\n onCancel: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n getField: PropTypes.func.isRequired,\n getValue: PropTypes.func.isRequired\n};\n\nexport default TextInput;\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default Editor;
|
|
2
|
-
declare function Editor(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace Editor {
|
|
4
|
-
namespace propTypes {
|
|
5
|
-
let getField: PropTypes.Validator<(...args: any[]) => any>;
|
|
6
|
-
let onCancel: PropTypes.Validator<(...args: any[]) => any>;
|
|
7
|
-
let getElement: PropTypes.Validator<(...args: any[]) => any>;
|
|
8
|
-
let setEditContext: PropTypes.Validator<(...args: any[]) => any>;
|
|
9
|
-
let getFormatter: PropTypes.Validator<(...args: any[]) => any>;
|
|
10
|
-
let getValue: PropTypes.Validator<(...args: any[]) => any>;
|
|
11
|
-
let renderFactory: PropTypes.Validator<(...args: any[]) => any>;
|
|
12
|
-
let resolveCellComponent: PropTypes.Validator<(...args: any[]) => any>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
import PropTypes from 'prop-types';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/DefaultComponents/CellRenderers/EditComponents/index.jsx"],"names":[],"mappings":";AAcA,6EA8DC;;;;;;;;;;;;;sBA5EqB,YAAY"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Popover, useElement, useOuterEvent } from '@pega/cosmos-react-core';
|
|
5
|
-
import { FieldType } from 'pega-repeating-structures-core';
|
|
6
|
-
import TextInput from './TextInput';
|
|
7
|
-
import DateTime from './DateTime';
|
|
8
|
-
import Radio from './Radio';
|
|
9
|
-
const StyledPopover = styled.div `
|
|
10
|
-
padding: 1rem;
|
|
11
|
-
min-width: 7rem;
|
|
12
|
-
`;
|
|
13
|
-
function Editor(props) {
|
|
14
|
-
const { getField, onCancel, getElement, setEditContext, getFormatter, getValue, renderFactory, resolveCellComponent } = props;
|
|
15
|
-
setEditContext();
|
|
16
|
-
const { type, filterPickList, filterPickListOptions } = getField();
|
|
17
|
-
const showInPopOver = type === FieldType.BOOLEAN || (filterPickList && filterPickListOptions);
|
|
18
|
-
const [popperRef, setPopperRef] = useElement();
|
|
19
|
-
const [popperTarget, setPopperTarget] = useElement(getElement());
|
|
20
|
-
useOuterEvent('mousedown', [popperRef], () => {
|
|
21
|
-
setPopperTarget(null);
|
|
22
|
-
if (showInPopOver)
|
|
23
|
-
onCancel();
|
|
24
|
-
});
|
|
25
|
-
let Component = null;
|
|
26
|
-
switch (type) {
|
|
27
|
-
case FieldType.TEXT:
|
|
28
|
-
case FieldType.NUMBER:
|
|
29
|
-
Component = TextInput;
|
|
30
|
-
break;
|
|
31
|
-
case FieldType.DATE:
|
|
32
|
-
case FieldType.DATE_TIME:
|
|
33
|
-
Component = DateTime;
|
|
34
|
-
break;
|
|
35
|
-
case FieldType.BOOLEAN:
|
|
36
|
-
Component = Radio;
|
|
37
|
-
break;
|
|
38
|
-
default:
|
|
39
|
-
Component = TextInput;
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
if (filterPickList && filterPickListOptions) {
|
|
43
|
-
Component = Radio;
|
|
44
|
-
}
|
|
45
|
-
if (!showInPopOver)
|
|
46
|
-
return _jsx(Component, { ...props });
|
|
47
|
-
const value = getValue();
|
|
48
|
-
return (_jsxs(_Fragment, { children: [resolveCellComponent('cellRenderer', renderFactory, {
|
|
49
|
-
...props,
|
|
50
|
-
getFormattedValue: () => getFormatter?.()?.(value) || value
|
|
51
|
-
}), showInPopOver && (_jsx(Popover, { ref: setPopperRef, className: 'editpopper', target: popperTarget, children: _jsx(StyledPopover, { children: _jsx(Component, { ...props }) }) }))] }));
|
|
52
|
-
}
|
|
53
|
-
Editor.propTypes = {
|
|
54
|
-
getField: PropTypes.func.isRequired,
|
|
55
|
-
onCancel: PropTypes.func.isRequired,
|
|
56
|
-
getElement: PropTypes.func.isRequired,
|
|
57
|
-
setEditContext: PropTypes.func.isRequired,
|
|
58
|
-
getFormatter: PropTypes.func.isRequired,
|
|
59
|
-
getValue: PropTypes.func.isRequired,
|
|
60
|
-
renderFactory: PropTypes.func.isRequired,
|
|
61
|
-
resolveCellComponent: PropTypes.func.isRequired
|
|
62
|
-
};
|
|
63
|
-
export default Editor;
|
|
64
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../Core/Components/DefaultComponents/CellRenderers/EditComponents/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG/B,CAAC;AACF,SAAS,MAAM,CAAC,KAAK;IACnB,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,oBAAoB,EACrB,GAAG,KAAK,CAAC;IACV,cAAc,EAAE,CAAC;IAEjB,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,qBAAqB,EAAE,GAAG,QAAQ,EAAE,CAAC;IACnE,MAAM,aAAa,GAAG,IAAI,KAAK,SAAS,CAAC,OAAO,IAAI,CAAC,cAAc,IAAI,qBAAqB,CAAC,CAAC;IAC9F,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,UAAU,EAAE,CAAC;IAC/C,MAAM,CAAC,Y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CAAC;AAED,MAAM,CAAC,SAAS,GAAG;IACjB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACrC,cAAc,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACzC,YAAY,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACvC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,oBAAoB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CAChD,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport { Popover, useElement, useOuterEvent } from '@pega/cosmos-react-core';\nimport { FieldType } from 'pega-repeating-structures-core';\n\nimport TextInput from './TextInput';\nimport DateTime from './DateTime';\nimport Radio from './Radio';\n\nconst StyledPopover = styled.div`\n padding: 1rem;\n min-width: 7rem;\n`;\nfunction Editor(props) {\n const {\n getField,\n onCancel,\n getElement,\n setEditContext,\n getFormatter,\n getValue,\n renderFactory,\n resolveCellComponent\n } = props;\n setEditContext();\n\n const { type, filterPickList, filterPickListOptions } = getField();\n const showInPopOver = type === FieldType.BOOLEAN || (filterPickList && filterPickListOptions);\n const [popperRef, setPopperRef] = useElement();\n const [popperTarget, setPopperTarget] = useElement(getElement());\n\n useOuterEvent('mousedown', [popperRef], () => {\n setPopperTarget(null);\n if (showInPopOver) onCancel();\n });\n let Component = null;\n switch (type) {\n case FieldType.TEXT:\n case FieldType.NUMBER:\n Component = TextInput;\n break;\n case FieldType.DATE:\n case FieldType.DATE_TIME:\n Component = DateTime;\n break;\n case FieldType.BOOLEAN:\n Component = Radio;\n break;\n\n default:\n Component = TextInput;\n break;\n }\n if (filterPickList && filterPickListOptions) {\n Component = Radio;\n }\n\n if (!showInPopOver) return <Component {...props} />;\n const value = getValue();\n return (\n <>\n {resolveCellComponent('cellRenderer', renderFactory, {\n ...props,\n getFormattedValue: () => getFormatter?.()?.(value) || value\n })}\n\n {showInPopOver && (\n <Popover ref={setPopperRef} className='editpopper' target={popperTarget}>\n <StyledPopover>\n <Component {...props} />\n </StyledPopover>\n </Popover>\n )}\n </>\n );\n}\n\nEditor.propTypes = {\n getField: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n getElement: PropTypes.func.isRequired,\n setEditContext: PropTypes.func.isRequired,\n getFormatter: PropTypes.func.isRequired,\n getValue: PropTypes.func.isRequired,\n renderFactory: PropTypes.func.isRequired,\n resolveCellComponent: PropTypes.func.isRequired\n};\n\nexport default Editor;\n"]}
|