@pega/lists-react 8.0.0-build.43.4 → 8.0.0-build.43.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":"AAkBA;;;;mDAsCC;;;;;;;;;sBAvDqB,YAAY"}
1
+ {"version":3,"file":"SelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":"AAmBA;;;;mDA2CC;;;;;;;;;sBA7DqB,YAAY"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styled from 'styled-components';
3
3
  import PropTypes from 'prop-types';
4
+ import { useRef } from 'react';
4
5
  import { Checkbox } from '@pega/cosmos-react-core';
5
6
  import { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';
6
7
  import useTranslate from '../../Hooks/useTranslate';
@@ -15,6 +16,7 @@ const StyledDivWrapper = styled.div `
15
16
  `;
16
17
  export default function SelectAllCheckbox({ selectAllRows, getExecutionContext, getDisableSelection }) {
17
18
  const [translate] = useTranslate();
19
+ const isProcessingRef = useRef(false);
18
20
  const { selectedRecordsCount, resultsCount, getState, getMeta } = getExecutionContext();
19
21
  if (!getState().showSelectAllCheckbox) {
20
22
  return null;
@@ -24,11 +26,14 @@ export default function SelectAllCheckbox({ selectAllRows, getExecutionContext,
24
26
  const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;
25
27
  const isChecked = (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;
26
28
  const handleChange = event => {
27
- if (disableSelection) {
29
+ if (disableSelection || isProcessingRef.current) {
28
30
  return;
29
31
  }
30
32
  const { checked } = event.target;
31
- selectAllRows(checked);
33
+ isProcessingRef.current = true;
34
+ selectAllRows(checked).then(() => {
35
+ isProcessingRef.current = false;
36
+ });
32
37
  };
33
38
  return (_jsx(StyledDivWrapper, { item: true, children: _jsx(Checkbox, { className: 'select-all-checkbox', checked: isChecked, onChange: handleChange, indeterminate: isIndeterminate, "aria-label": translate('Select all'), disabled: disableSelection }) }));
34
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectAllCheckbox.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;IAK/B,sBAAsB;;;CAGzB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACpB;IACC,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACxF,IAAI,CAAC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7C,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,IAAI,sBAAsB,CAAC;IAEzE,MAAM,eAAe,GAAG,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC;IAE1F,MAAM,SAAS,GACb,CAAC,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC,IAAI,eAAe,CAAC;IAEzF,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE;QAC3B,IAAI,gBAAgB,EAAE,CAAC;YACrB,OAAO;QACT,CAAC;QACD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QACjC,aAAa,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,IAAC,IAAI,kBACpB,KAAC,QAAQ,IACP,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,gBAClB,SAAS,CAAC,YAAY,CAAC,EACnC,QAAQ,EAAE,gBAAgB,GAC1B,GACe,CACpB,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,SAAS,GAAG;IAC5B,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IAC9C,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,mBAAmB,EAAE,SAAS,CAAC,IAAI;CACpC,CAAC","sourcesContent":["import styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { Checkbox } from '@pega/cosmos-react-core';\nimport { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst StyledDivWrapper = styled.div`\n height: 100%;\n > div {\n height: 100%;\n }\n ${StyledPseudoRadioCheck} {\n margin-inline-end: 0;\n }\n`;\n\nexport default function SelectAllCheckbox({\n selectAllRows,\n getExecutionContext,\n getDisableSelection\n}) {\n const [translate] = useTranslate();\n const { selectedRecordsCount, resultsCount, getState, getMeta } = getExecutionContext();\n if (!getState().showSelectAllCheckbox) {\n return null;\n }\n const { disableSelectionOnLoad } = getMeta();\n const disableSelection = getDisableSelection() ?? disableSelectionOnLoad;\n\n const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;\n\n const isChecked =\n (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;\n\n const handleChange = event => {\n if (disableSelection) {\n return;\n }\n const { checked } = event.target;\n selectAllRows(checked);\n };\n\n return (\n <StyledDivWrapper item>\n <Checkbox\n className='select-all-checkbox'\n checked={isChecked}\n onChange={handleChange}\n indeterminate={isIndeterminate}\n aria-label={translate('Select all')}\n disabled={disableSelection}\n />\n </StyledDivWrapper>\n );\n}\n\nSelectAllCheckbox.propTypes = {\n getExecutionContext: PropTypes.func.isRequired,\n selectAllRows: PropTypes.func.isRequired,\n getDisableSelection: PropTypes.func\n};\n"]}
1
+ {"version":3,"file":"SelectAllCheckbox.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;IAK/B,sBAAsB;;;CAGzB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACpB;IACC,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACxF,IAAI,CAAC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7C,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,IAAI,sBAAsB,CAAC;IAEzE,MAAM,eAAe,GAAG,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC;IAE1F,MAAM,SAAS,GACb,CAAC,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC,IAAI,eAAe,CAAC;IACzF,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE;QAC3B,IAAI,gBAAgB,IAAI,eAAe,CAAC,OAAO,EAAE,CAAC;YAChD,OAAO;QACT,CAAC;QACD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QACjC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;QAE/B,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC/B,eAAe,CAAC,OAAO,GAAG,KAAK,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,IAAC,IAAI,kBACpB,KAAC,QAAQ,IACP,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,gBAClB,SAAS,CAAC,YAAY,CAAC,EACnC,QAAQ,EAAE,gBAAgB,GAC1B,GACe,CACpB,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,SAAS,GAAG;IAC5B,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IAC9C,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,mBAAmB,EAAE,SAAS,CAAC,IAAI;CACpC,CAAC","sourcesContent":["import styled from 'styled-components';\nimport PropTypes from 'prop-types';\nimport { useRef } from 'react';\n\nimport { Checkbox } from '@pega/cosmos-react-core';\nimport { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst StyledDivWrapper = styled.div`\n height: 100%;\n > div {\n height: 100%;\n }\n ${StyledPseudoRadioCheck} {\n margin-inline-end: 0;\n }\n`;\n\nexport default function SelectAllCheckbox({\n selectAllRows,\n getExecutionContext,\n getDisableSelection\n}) {\n const [translate] = useTranslate();\n const isProcessingRef = useRef(false);\n\n const { selectedRecordsCount, resultsCount, getState, getMeta } = getExecutionContext();\n if (!getState().showSelectAllCheckbox) {\n return null;\n }\n const { disableSelectionOnLoad } = getMeta();\n const disableSelection = getDisableSelection() ?? disableSelectionOnLoad;\n\n const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;\n\n const isChecked =\n (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;\n const handleChange = event => {\n if (disableSelection || isProcessingRef.current) {\n return;\n }\n const { checked } = event.target;\n isProcessingRef.current = true;\n\n selectAllRows(checked).then(() => {\n isProcessingRef.current = false;\n });\n };\n\n return (\n <StyledDivWrapper item>\n <Checkbox\n className='select-all-checkbox'\n checked={isChecked}\n onChange={handleChange}\n indeterminate={isIndeterminate}\n aria-label={translate('Select all')}\n disabled={disableSelection}\n />\n </StyledDivWrapper>\n );\n}\n\nSelectAllCheckbox.propTypes = {\n getExecutionContext: PropTypes.func.isRequired,\n selectAllRows: PropTypes.func.isRequired,\n getDisableSelection: PropTypes.func\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-react",
3
- "version": "8.0.0-build.43.4",
3
+ "version": "8.0.0-build.43.6",
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,10 +14,10 @@
14
14
  "build": "tsc -b tsconfig.build.json"
15
15
  },
16
16
  "dependencies": {
17
- "@pega/cosmos-react-condition-builder": "8.0.0-build.43.4",
18
- "@pega/cosmos-react-core": "8.0.0-build.43.4",
19
- "@pega/cosmos-react-rte": "8.0.0-build.43.4",
20
- "@pega/cosmos-react-work": "8.0.0-build.43.4",
17
+ "@pega/cosmos-react-condition-builder": "8.0.0-build.43.6",
18
+ "@pega/cosmos-react-core": "8.0.0-build.43.6",
19
+ "@pega/cosmos-react-rte": "8.0.0-build.43.6",
20
+ "@pega/cosmos-react-work": "8.0.0-build.43.6",
21
21
  "@types/lodash.get": "^4.4.9",
22
22
  "@types/react": "^17.0.62 || ^18.3.3",
23
23
  "@types/react-dom": "^17.0.20 || ^18.3.0",
@@ -25,8 +25,8 @@
25
25
  "dayjs": "^1.11.10",
26
26
  "fast-deep-equal": "^3.1.3",
27
27
  "lodash.get": "^4.4.2",
28
- "pega-repeating-structures-core": "npm:@pega/lists-core@8.0.0-build.43.4",
29
- "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@8.0.0-build.43.4",
28
+ "pega-repeating-structures-core": "npm:@pega/lists-core@8.0.0-build.43.6",
29
+ "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@8.0.0-build.43.6",
30
30
  "polished": "^4.1.0",
31
31
  "prop-types": "^15.8.1",
32
32
  "react": "^17.0.0 || ^18.0.0",
@@ -45,7 +45,7 @@
45
45
  "@testing-library/react": "^16.0.0",
46
46
  "@testing-library/user-event": "^14.5.1",
47
47
  "jest-axe": "^8.0.0",
48
- "srs-utils": "8.0.0-build.43.4",
48
+ "srs-utils": "8.0.0-build.43.6",
49
49
  "typescript": "~5.5.4"
50
50
  }
51
51
  }