@pega/lists-react 10.0.0-build.7.1 → 10.0.0-build.8.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.
@@ -5,7 +5,7 @@ export default function useSelectAllCheckbox({ selectedRecordsCount = 0, results
5
5
  const isSupportedMode = !!selectionMode && SUPPORTED_MODES_FOR_SELECTALL.includes(selectionMode);
6
6
  const showSelectAllCheckbox = isSupportedMode &&
7
7
  (resultsCount ?? 0) > 0 &&
8
- (resultsCount ?? 0) <= (selectionCountThreshold ?? 0) &&
8
+ (selectionCountThreshold === undefined || (resultsCount ?? 0) <= selectionCountThreshold) &&
9
9
  !hasMoreResults;
10
10
  const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;
11
11
  const isChecked = (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;
@@ -1 +1 @@
1
- {"version":3,"file":"useSelectAllCheckbox.js","sourceRoot":"","sources":["../../../Core/Hooks/useSelectAllCheckbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,MAAM,6BAA6B,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAU,CAAC;AAqB3E,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,oBAAoB,GAAG,CAAC,EACxB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EACvC,mBAAmB,EACQ;IAC3B,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,eAAe,GACnB,CAAC,CAAC,aAAa,IAAK,6BAAmD,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAElG,MAAM,qBAAqB,GACzB,eAAe;QACf,CAAC,YAAY,IAAI,CAAC,CAAC,GAAG,CAAC;QACvB,CAAC,YAAY,IAAI,CAAC,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,CAAC;QACrD,CAAC,cAAc,CAAC;IAElB,MAAM,eAAe,GAAG,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC;IAC1F,MAAM,SAAS,GACb,CAAC,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC,IAAI,eAAe,CAAC;IACzF,MAAM,UAAU,GAAG,mBAAmB,EAAE,EAAE,IAAI,sBAAsB,IAAI,KAAK,CAAC;IAE9E,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE;QAC5D,IAAI,UAAU,IAAI,eAAe,CAAC,OAAO;YAAE,OAAO;QAClD,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;QAC/B,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;YAC/C,eAAe,CAAC,OAAO,GAAG,KAAK,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACzF,CAAC","sourcesContent":["import { useRef } from 'react';\nimport type { ChangeEvent } from 'react';\n\nconst SUPPORTED_MODES_FOR_SELECTALL = ['multi', 'multi_on_hover'] as const;\n\ninterface UseSelectAllCheckboxParams {\n selectedRecordsCount?: number;\n resultsCount?: number;\n hasMoreResults?: boolean;\n selectionMode?: string;\n selectionCountThreshold?: number;\n disableSelectionOnLoad?: boolean;\n selectAllRows?: (checked: boolean) => Promise<void>;\n getDisableSelection?: () => boolean | undefined;\n}\n\ninterface UseSelectAllCheckboxResult {\n showSelectAllCheckbox: boolean;\n isChecked: boolean;\n isIndeterminate: boolean;\n isDisabled: boolean;\n handleChange: (event: ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport default function useSelectAllCheckbox({\n selectedRecordsCount = 0,\n resultsCount,\n hasMoreResults,\n selectionMode,\n selectionCountThreshold,\n disableSelectionOnLoad,\n selectAllRows = () => Promise.resolve(),\n getDisableSelection\n}: UseSelectAllCheckboxParams): UseSelectAllCheckboxResult {\n const isProcessingRef = useRef(false);\n\n const isSupportedMode =\n !!selectionMode && (SUPPORTED_MODES_FOR_SELECTALL as readonly string[]).includes(selectionMode);\n\n const showSelectAllCheckbox =\n isSupportedMode &&\n (resultsCount ?? 0) > 0 &&\n (resultsCount ?? 0) <= (selectionCountThreshold ?? 0) &&\n !hasMoreResults;\n\n const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;\n const isChecked =\n (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;\n const isDisabled = getDisableSelection?.() ?? disableSelectionOnLoad ?? false;\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled || isProcessingRef.current) return;\n isProcessingRef.current = true;\n selectAllRows(event.target.checked).finally(() => {\n isProcessingRef.current = false;\n });\n };\n\n return { showSelectAllCheckbox, isChecked, isIndeterminate, isDisabled, handleChange };\n}\n"]}
1
+ {"version":3,"file":"useSelectAllCheckbox.js","sourceRoot":"","sources":["../../../Core/Hooks/useSelectAllCheckbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,MAAM,6BAA6B,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAU,CAAC;AAqB3E,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,oBAAoB,GAAG,CAAC,EACxB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EACvC,mBAAmB,EACQ;IAC3B,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,eAAe,GACnB,CAAC,CAAC,aAAa,IAAK,6BAAmD,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAElG,MAAM,qBAAqB,GACzB,eAAe;QACf,CAAC,YAAY,IAAI,CAAC,CAAC,GAAG,CAAC;QACvB,CAAC,uBAAuB,KAAK,SAAS,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,IAAI,uBAAuB,CAAC;QACzF,CAAC,cAAc,CAAC;IAElB,MAAM,eAAe,GAAG,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC;IAC1F,MAAM,SAAS,GACb,CAAC,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC,IAAI,eAAe,CAAC;IACzF,MAAM,UAAU,GAAG,mBAAmB,EAAE,EAAE,IAAI,sBAAsB,IAAI,KAAK,CAAC;IAE9E,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE;QAC5D,IAAI,UAAU,IAAI,eAAe,CAAC,OAAO;YAAE,OAAO;QAClD,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;QAC/B,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;YAC/C,eAAe,CAAC,OAAO,GAAG,KAAK,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACzF,CAAC","sourcesContent":["import { useRef } from 'react';\nimport type { ChangeEvent } from 'react';\n\nconst SUPPORTED_MODES_FOR_SELECTALL = ['multi', 'multi_on_hover'] as const;\n\ninterface UseSelectAllCheckboxParams {\n selectedRecordsCount?: number;\n resultsCount?: number;\n hasMoreResults?: boolean;\n selectionMode?: string;\n selectionCountThreshold?: number;\n disableSelectionOnLoad?: boolean;\n selectAllRows?: (checked: boolean) => Promise<void>;\n getDisableSelection?: () => boolean | undefined;\n}\n\ninterface UseSelectAllCheckboxResult {\n showSelectAllCheckbox: boolean;\n isChecked: boolean;\n isIndeterminate: boolean;\n isDisabled: boolean;\n handleChange: (event: ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport default function useSelectAllCheckbox({\n selectedRecordsCount = 0,\n resultsCount,\n hasMoreResults,\n selectionMode,\n selectionCountThreshold,\n disableSelectionOnLoad,\n selectAllRows = () => Promise.resolve(),\n getDisableSelection\n}: UseSelectAllCheckboxParams): UseSelectAllCheckboxResult {\n const isProcessingRef = useRef(false);\n\n const isSupportedMode =\n !!selectionMode && (SUPPORTED_MODES_FOR_SELECTALL as readonly string[]).includes(selectionMode);\n\n const showSelectAllCheckbox =\n isSupportedMode &&\n (resultsCount ?? 0) > 0 &&\n (selectionCountThreshold === undefined || (resultsCount ?? 0) <= selectionCountThreshold) &&\n !hasMoreResults;\n\n const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;\n const isChecked =\n (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;\n const isDisabled = getDisableSelection?.() ?? disableSelectionOnLoad ?? false;\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (isDisabled || isProcessingRef.current) return;\n isProcessingRef.current = true;\n selectAllRows(event.target.checked).finally(() => {\n isProcessingRef.current = false;\n });\n };\n\n return { showSelectAllCheckbox, isChecked, isIndeterminate, isDisabled, handleChange };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-react",
3
- "version": "10.0.0-build.7.1",
3
+ "version": "10.0.0-build.8.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,17 +14,17 @@
14
14
  "build": "tsc -b tsconfig.build.json"
15
15
  },
16
16
  "dependencies": {
17
- "@pega/cosmos-react-condition-builder": "10.0.0-build.7.1",
18
- "@pega/cosmos-react-core": "10.0.0-build.7.1",
19
- "@pega/cosmos-react-rte": "10.0.0-build.7.1",
17
+ "@pega/cosmos-react-condition-builder": "10.0.0-build.8.0",
18
+ "@pega/cosmos-react-core": "10.0.0-build.8.0",
19
+ "@pega/cosmos-react-rte": "10.0.0-build.8.0",
20
20
  "@types/lodash-es": "^4.17.12",
21
21
  "@types/react": "^17.0.62 || ^18.3.3",
22
22
  "@types/react-dom": "^17.0.20 || ^18.3.0",
23
23
  "dayjs": "^1.11.13",
24
24
  "fast-deep-equal": "^3.1.3",
25
25
  "lodash-es": "^4.18.1",
26
- "pega-repeating-structures-core": "npm:@pega/lists-core@10.0.0-build.7.1",
27
- "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@10.0.0-build.7.1",
26
+ "pega-repeating-structures-core": "npm:@pega/lists-core@10.0.0-build.8.0",
27
+ "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@10.0.0-build.8.0",
28
28
  "polished": "^4.1.0",
29
29
  "prop-types": "^15.8.1",
30
30
  "react": "^17.0.0 || ^18.0.0",
@@ -42,7 +42,7 @@
42
42
  "@testing-library/react": "^16.0.0",
43
43
  "@testing-library/user-event": "^14.6.1",
44
44
  "jest-axe": "^8.0.0",
45
- "srs-utils": "10.0.0-build.7.1",
45
+ "srs-utils": "10.0.0-build.8.0",
46
46
  "typescript": "~6.0.3"
47
47
  }
48
48
  }