@pega/lists-react 9.0.0-build.29.25 → 9.0.0-build.29.27

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.
Files changed (25) hide show
  1. package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.d.ts.map +1 -1
  2. package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js +15 -19
  3. package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js.map +1 -1
  4. package/lib/Core/Components/Toolbar/AdvanceToolbar.js +1 -1
  5. package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
  6. package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
  7. package/lib/Core/Components/Toolbar/SimpleToolbar.js +2 -3
  8. package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
  9. package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts +1 -1
  10. package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts.map +1 -1
  11. package/lib/Core/Components/Toolbar/hooks/useWrapAction.js +26 -13
  12. package/lib/Core/Components/Toolbar/hooks/useWrapAction.js.map +1 -1
  13. package/lib/Core/Hooks/useDebounce.js +1 -1
  14. package/lib/Core/Hooks/useDebounce.js.map +1 -1
  15. package/lib/Core/Hooks/useSelectAllCheckbox.d.ts +21 -0
  16. package/lib/Core/Hooks/useSelectAllCheckbox.d.ts.map +1 -0
  17. package/lib/Core/Hooks/useSelectAllCheckbox.js +23 -0
  18. package/lib/Core/Hooks/useSelectAllCheckbox.js.map +1 -0
  19. package/lib/Core/Views/Table/GroupingHeaderCell.d.ts +6 -15
  20. package/lib/Core/Views/Table/GroupingHeaderCell.d.ts.map +1 -1
  21. package/lib/Core/Views/Table/GroupingHeaderCell.js +16 -14
  22. package/lib/Core/Views/Table/GroupingHeaderCell.js.map +1 -1
  23. package/lib/Core/Views/Table/index.js +1 -1
  24. package/lib/Core/Views/Table/index.js.map +1 -1
  25. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"SelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":"AAwBA;;;;mDA2CC;;;;;;;;;sBAlEqB,YAAY"}
1
+ {"version":3,"file":"SelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":"AAwBA;;;;mDAsCC;;;;;;;;;sBA7DqB,YAAY"}
@@ -1,10 +1,10 @@
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';
5
4
  import { Checkbox } from '@pega/cosmos-react-core';
6
5
  import { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';
7
6
  import useTranslate from '../../Hooks/useTranslate';
7
+ import useSelectAllCheckbox from '../../Hooks/useSelectAllCheckbox';
8
8
  const StyledDivWrapper = styled.div `
9
9
  height: 100%;
10
10
 
@@ -21,26 +21,22 @@ const StyledDivWrapper = styled.div `
21
21
  `;
22
22
  export default function SelectAllCheckbox({ selectAllRows, getExecutionContext, getDisableSelection }) {
23
23
  const [translate] = useTranslate();
24
- const isProcessingRef = useRef(false);
25
- const { selectedRecordsCount, resultsCount, getState, getMeta } = getExecutionContext();
26
- if (!getState().showSelectAllCheckbox) {
24
+ const { selectedRecordsCount, resultsCount, hasMoreResults, getMeta } = getExecutionContext?.() ?? {};
25
+ const { selectionMode, selectionCountThreshold, disableSelectionOnLoad } = getMeta?.() ?? {};
26
+ const { showSelectAllCheckbox, isChecked, isIndeterminate, isDisabled, handleChange } = useSelectAllCheckbox({
27
+ selectedRecordsCount,
28
+ resultsCount,
29
+ hasMoreResults,
30
+ selectionMode,
31
+ selectionCountThreshold,
32
+ disableSelectionOnLoad,
33
+ selectAllRows,
34
+ getDisableSelection
35
+ });
36
+ if (!showSelectAllCheckbox) {
27
37
  return null;
28
38
  }
29
- const { disableSelectionOnLoad } = getMeta();
30
- const disableSelection = getDisableSelection() ?? disableSelectionOnLoad;
31
- const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;
32
- const isChecked = (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;
33
- const handleChange = event => {
34
- if (disableSelection || isProcessingRef.current) {
35
- return;
36
- }
37
- const { checked } = event.target;
38
- isProcessingRef.current = true;
39
- selectAllRows(checked).then(() => {
40
- isProcessingRef.current = false;
41
- });
42
- };
43
- 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 }) }));
39
+ return (_jsx(StyledDivWrapper, { item: true, children: _jsx(Checkbox, { className: 'select-all-checkbox', checked: isChecked, onChange: handleChange, indeterminate: isIndeterminate, "aria-label": translate('Select all'), disabled: isDisabled }) }));
44
40
  }
45
41
  SelectAllCheckbox.propTypes = {
46
42
  getExecutionContext: PropTypes.func.isRequired,
@@ -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;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;;;;;;;;;;IAU/B,sBAAsB;;;CAGzB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,aAAa,EACb,mBAA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C;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\n /* adding padding to the row select checkbox to give space of outline focus ring */\n padding-block: 0.125rem;\n padding-inline: 0.25rem;\n\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"]}
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;AACpD,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AAEpE,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;IAU/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,cAAc,EAAE,OAAO,EAAE,GACnE,mBAAmB,EAAE,EAAE,IAAI,EAAE,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC;IAE7F,MAAM,EAAE,qBAAqB,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,GACnF,oBAAoB,CAAC;QACnB,oBAAoB;QACpB,YAAY;QACZ,cAAc;QACd,aAAa;QACb,uBAAuB;QACvB,sBAAsB;QACtB,aAAa;QACb,mBAAmB;KACpB,CAAC,CAAC;IAEL,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,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,UAAU,GACpB,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';\nimport useSelectAllCheckbox from '../../Hooks/useSelectAllCheckbox';\n\nconst StyledDivWrapper = styled.div`\n height: 100%;\n\n /* adding padding to the row select checkbox to give space of outline focus ring */\n padding-block: 0.125rem;\n padding-inline: 0.25rem;\n\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, hasMoreResults, getMeta } =\n getExecutionContext?.() ?? {};\n const { selectionMode, selectionCountThreshold, disableSelectionOnLoad } = getMeta?.() ?? {};\n\n const { showSelectAllCheckbox, isChecked, isIndeterminate, isDisabled, handleChange } =\n useSelectAllCheckbox({\n selectedRecordsCount,\n resultsCount,\n hasMoreResults,\n selectionMode,\n selectionCountThreshold,\n disableSelectionOnLoad,\n selectAllRows,\n getDisableSelection\n });\n\n if (!showSelectAllCheckbox) {\n return null;\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={isDisabled}\n />\n </StyledDivWrapper>\n );\n}\n\nSelectAllCheckbox.propTypes = {\n getExecutionContext: PropTypes.func.isRequired,\n selectAllRows: PropTypes.func.isRequired,\n getDisableSelection: PropTypes.func\n};\n"]}
@@ -41,7 +41,7 @@ export default function AdvanceToolbar({ view }) {
41
41
  onClick: createNewAction.onClick
42
42
  }
43
43
  : undefined;
44
- const Toolbar = template === REPEATING_STRUCTURE_TEMPLATES.MAP ? (_jsx(MapToolbar, { locationFieldId: mapFieldIds?.location, name: title, showName: showTitle, formControlProps: formControlProps, rows: rows, count: count, createNew: createNew, additionalActions: additionalActions })) : (_jsxs(_Fragment, { children: [_jsx(ListToolbar, { name: title, showName: showTitle, formControlProps: formControlProps, viewSelector: viewSelector, search: search, count: count, additionalActions: additionalActions, filter: filter, group: showFeatureForTemplate(template, 'group') && group, sort: sort, actions: actions, actionsButtonRef: actionsButtonRef, createNew: createNew, wrap: showFeatureForTemplate(template, 'wrap') && wrapAction }), selectedActionContent, createEditViewContent] }));
44
+ const Toolbar = template === REPEATING_STRUCTURE_TEMPLATES.MAP ? (_jsx(MapToolbar, { locationFieldId: mapFieldIds?.location, name: title, showName: showTitle, formControlProps: formControlProps, rows: rows, count: count, createNew: createNew, additionalActions: additionalActions })) : (_jsxs(_Fragment, { children: [_jsx(ListToolbar, { name: title, showName: showTitle, formControlProps: formControlProps, viewSelector: viewSelector, search: search, count: count, additionalActions: additionalActions, filter: filter, group: showFeatureForTemplate(template, 'group') && group, sort: sort, actions: actions, actionsButtonRef: actionsButtonRef, createNew: createNew, wrap: wrapAction }), selectedActionContent, createEditViewContent] }));
45
45
  return (_jsxs(AnnounceRowsCount, { state: state, count: count, isLoading: isLoading, announceCount: announceCount, children: [_jsx(ValidateMessage, { message: validatemessage, children: Toolbar }), refreshNotification && (_jsx(RefreshBanner, { refreshNotification: refreshNotification, forceRefresh: forceRefresh }))] }));
46
46
  }
47
47
  AdvanceToolbar.propTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"AdvanceToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,sBAAsB,MAAM,8BAA8B,CAAC;AAElE,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE;IAC7C,MAAM,EACJ,oBAAoB,EACpB,IAAI,EAAE,EACJ,SAAS,EACT,aAAa,EACb,KAAK,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,WAAW,EACZ,GAAG,EAAE,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,SAAS,E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AAC,IAAI,UAAU,GAC5D,EACD,qBAAqB,EACrB,qBAAqB,IACrB,CACJ,CAAC;IAEJ,OAAO,CACL,MAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,aAE5B,KAAC,eAAe,IAAC,OAAO,EAAE,eAAe,YACtC,OAAO,GAEQ,EACjB,mBAAmB,IAAI,CACtB,KAAC,aAAa,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,GAAI,CACxF,IACiB,CACrB,CAAC;AACJ,CAAC;AAED,cAAc,CAAC,SAAS,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\nimport { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\nimport { SELECTION_MODES } from '../../constants';\nimport showFeatureForTemplate from '../../templateFeatureSupport';\n\nimport ActionsMenu from './ActionsMenu';\nimport MapToolbar from './Map/MapToolbar';\nimport ToolbarActions from './ToolbarActions';\nimport useSearch from './hooks/useSearch';\nimport useFilter from './hooks/useFilter';\nimport usePersonalization from './hooks/usePersonalization';\nimport useMore from './hooks/useMore';\nimport useGroup from './hooks/useGroup/useGroup';\nimport useSort from './hooks/useSort/useSort';\nimport getCount from './utils/getCount';\nimport RefreshBanner from './RefreshBanner';\nimport AnnounceRowsCount from './AnnounceRowsCount';\nimport ValidateMessage from './ValidateMessage';\nimport useFormControlProps from './hooks/useFormControlProps';\nimport useWrapAction from './hooks/useWrapAction';\n\nexport default function AdvanceToolbar({ view }) {\n const {\n selectedRecordsCount,\n meta: {\n basicMode,\n selectionMode,\n title,\n showTitle,\n toolbarActions,\n allowBulkActions,\n mapFieldIds\n } = {},\n rows,\n state,\n getContext,\n isLoading,\n showCount,\n refreshNotification,\n type: { forceRefresh },\n announceCount,\n template\n } = view;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const { viewSelector, createEditViewContent } = usePersonalization({ view });\n const search = useSearch({ view });\n const count = showCount ? getCount({ view }) : undefined;\n const filter = useFilter({ view });\n const group = useGroup({ view });\n const sort = useSort({ view });\n const { actions, actionsButtonRef, selectedActionContent } = useMore({ view });\n const enableActionsMenu = selectionMode === SELECTION_MODES.multi && selectedRecordsCount !== 0;\n const formControlProps = useFormControlProps(view);\n const wrapAction = useWrapAction(view);\n\n const additionalActions = (\n <>\n {basicMode && (\n <ToolbarActions\n toolbarActions={toolbarActions?.filter(action => !action.id.startsWith('Add'))}\n />\n )}\n {allowBulkActions && template !== REPEATING_STRUCTURE_TEMPLATES.TIMELINE && (\n <ActionsMenu enableActionsMenu={enableActionsMenu} view={view} />\n )}\n </>\n );\n\n const createNewAction = toolbarActions?.find(action => action.id.startsWith('Add'));\n const createNew =\n createNewAction && basicMode\n ? {\n label: createNewAction?.text,\n onClick: createNewAction.onClick\n }\n : undefined;\n\n const Toolbar =\n template === REPEATING_STRUCTURE_TEMPLATES.MAP ? (\n <MapToolbar\n locationFieldId={mapFieldIds?.location}\n name={title}\n showName={showTitle}\n formControlProps={formControlProps}\n rows={rows}\n count={count}\n createNew={createNew}\n additionalActions={additionalActions}\n />\n ) : (\n <>\n <ListToolbar\n name={title}\n showName={showTitle}\n formControlProps={formControlProps}\n viewSelector={viewSelector}\n search={search}\n count={count}\n additionalActions={additionalActions}\n filter={filter}\n group={showFeatureForTemplate(template, 'group') && group}\n sort={sort}\n actions={actions}\n actionsButtonRef={actionsButtonRef}\n createNew={createNew}\n wrap={showFeatureForTemplate(template, 'wrap') && wrapAction}\n />\n {selectedActionContent}\n {createEditViewContent}\n </>\n );\n\n return (\n <AnnounceRowsCount\n state={state}\n count={count}\n isLoading={isLoading}\n announceCount={announceCount}\n >\n <ValidateMessage message={validatemessage}>\n {Toolbar}\n {/* FIXME: This implementation of error status should be considered temporary until an official, and properly accessible, spec is determined. */}\n </ValidateMessage>\n {refreshNotification && (\n <RefreshBanner refreshNotification={refreshNotification} forceRefresh={forceRefresh} />\n )}\n </AnnounceRowsCount>\n );\n}\n\nAdvanceToolbar.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
1
+ {"version":3,"file":"AdvanceToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,sBAAsB,MAAM,8BAA8B,CAAC;AAElE,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE;IAC7C,MAAM,EACJ,oBAAo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IAAI,KAAK,EACzD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,UAAU,GAChB,EACD,qBAAqB,EACrB,qBAAqB,IACrB,CACJ,CAAC;IAEJ,OAAO,CACL,MAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,aAE5B,KAAC,eAAe,IAAC,OAAO,EAAE,eAAe,YACtC,OAAO,GAEQ,EACjB,mBAAmB,IAAI,CACtB,KAAC,aAAa,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,GAAI,CACxF,IACiB,CACrB,CAAC;AACJ,CAAC;AAED,cAAc,CAAC,SAAS,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\nimport { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\nimport { SELECTION_MODES } from '../../constants';\nimport showFeatureForTemplate from '../../templateFeatureSupport';\n\nimport ActionsMenu from './ActionsMenu';\nimport MapToolbar from './Map/MapToolbar';\nimport ToolbarActions from './ToolbarActions';\nimport useSearch from './hooks/useSearch';\nimport useFilter from './hooks/useFilter';\nimport usePersonalization from './hooks/usePersonalization';\nimport useMore from './hooks/useMore';\nimport useGroup from './hooks/useGroup/useGroup';\nimport useSort from './hooks/useSort/useSort';\nimport getCount from './utils/getCount';\nimport RefreshBanner from './RefreshBanner';\nimport AnnounceRowsCount from './AnnounceRowsCount';\nimport ValidateMessage from './ValidateMessage';\nimport useFormControlProps from './hooks/useFormControlProps';\nimport useWrapAction from './hooks/useWrapAction';\n\nexport default function AdvanceToolbar({ view }) {\n const {\n selectedRecordsCount,\n meta: {\n basicMode,\n selectionMode,\n title,\n showTitle,\n toolbarActions,\n allowBulkActions,\n mapFieldIds\n } = {},\n rows,\n state,\n getContext,\n isLoading,\n showCount,\n refreshNotification,\n type: { forceRefresh },\n announceCount,\n template\n } = view;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const { viewSelector, createEditViewContent } = usePersonalization({ view });\n const search = useSearch({ view });\n const count = showCount ? getCount({ view }) : undefined;\n const filter = useFilter({ view });\n const group = useGroup({ view });\n const sort = useSort({ view });\n const { actions, actionsButtonRef, selectedActionContent } = useMore({ view });\n const enableActionsMenu = selectionMode === SELECTION_MODES.multi && selectedRecordsCount !== 0;\n const formControlProps = useFormControlProps(view);\n const wrapAction = useWrapAction(view);\n\n const additionalActions = (\n <>\n {basicMode && (\n <ToolbarActions\n toolbarActions={toolbarActions?.filter(action => !action.id.startsWith('Add'))}\n />\n )}\n {allowBulkActions && template !== REPEATING_STRUCTURE_TEMPLATES.TIMELINE && (\n <ActionsMenu enableActionsMenu={enableActionsMenu} view={view} />\n )}\n </>\n );\n\n const createNewAction = toolbarActions?.find(action => action.id.startsWith('Add'));\n const createNew =\n createNewAction && basicMode\n ? {\n label: createNewAction?.text,\n onClick: createNewAction.onClick\n }\n : undefined;\n\n const Toolbar =\n template === REPEATING_STRUCTURE_TEMPLATES.MAP ? (\n <MapToolbar\n locationFieldId={mapFieldIds?.location}\n name={title}\n showName={showTitle}\n formControlProps={formControlProps}\n rows={rows}\n count={count}\n createNew={createNew}\n additionalActions={additionalActions}\n />\n ) : (\n <>\n <ListToolbar\n name={title}\n showName={showTitle}\n formControlProps={formControlProps}\n viewSelector={viewSelector}\n search={search}\n count={count}\n additionalActions={additionalActions}\n filter={filter}\n group={showFeatureForTemplate(template, 'group') && group}\n sort={sort}\n actions={actions}\n actionsButtonRef={actionsButtonRef}\n createNew={createNew}\n wrap={wrapAction}\n />\n {selectedActionContent}\n {createEditViewContent}\n </>\n );\n\n return (\n <AnnounceRowsCount\n state={state}\n count={count}\n isLoading={isLoading}\n announceCount={announceCount}\n >\n <ValidateMessage message={validatemessage}>\n {Toolbar}\n {/* FIXME: This implementation of error status should be considered temporary until an official, and properly accessible, spec is determined. */}\n </ValidateMessage>\n {refreshNotification && (\n <RefreshBanner refreshNotification={refreshNotification} forceRefresh={forceRefresh} />\n )}\n </AnnounceRowsCount>\n );\n}\n\nAdvanceToolbar.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":"AAYA;;4CAgCC;;;;;;;;;sBA5CqB,YAAY"}
1
+ {"version":3,"file":"SimpleToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":"AAWA;;4CAgCC;;;;;;;;;sBA3CqB,YAAY"}
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import PropTypes from 'prop-types';
3
3
  import { ListToolbar } from '@pega/cosmos-react-core';
4
- import { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';
5
4
  import RefreshBanner from './RefreshBanner';
6
5
  import getCount from './utils/getCount';
7
6
  import AnnounceRowsCount from './AnnounceRowsCount';
@@ -9,13 +8,13 @@ import ValidateMessage from './ValidateMessage';
9
8
  import useFormControlProps from './hooks/useFormControlProps';
10
9
  import useWrapAction from './hooks/useWrapAction';
11
10
  export default function SimpleToolbar({ view }) {
12
- const { meta: { title, showTitle, template } = {}, state, getContext, showCount, refreshNotification, type: { forceRefresh } } = view;
11
+ const { meta: { title, showTitle } = {}, state, getContext, showCount, refreshNotification, type: { forceRefresh } } = view;
13
12
  const { getRequiredDef } = getContext();
14
13
  const { validatemessage } = getRequiredDef() || {};
15
14
  const count = showCount ? getCount({ view }) : undefined;
16
15
  const formControlProps = useFormControlProps(view);
17
16
  const wrapAction = useWrapAction(view);
18
- return (_jsxs(AnnounceRowsCount, { state: state, count: count, children: [_jsx(ValidateMessage, { message: validatemessage, children: _jsx(ListToolbar, { name: title, showName: showTitle, count: count, formControlProps: formControlProps, wrap: template === REPEATING_STRUCTURE_TEMPLATES.TABLE && wrapAction }) }), refreshNotification && (_jsx(RefreshBanner, { refreshNotification: refreshNotification, forceRefresh: forceRefresh }))] }));
17
+ return (_jsxs(AnnounceRowsCount, { state: state, count: count, children: [_jsx(ValidateMessage, { message: validatemessage, children: _jsx(ListToolbar, { name: title, showName: showTitle, count: count, formControlProps: formControlProps, wrap: wrapAction }) }), refreshNotification && (_jsx(RefreshBanner, { refreshNotification: refreshNotification, forceRefresh: forceRefresh }))] }));
19
18
  }
20
19
  SimpleToolbar.propTypes = {
21
20
  view: PropTypes.objectOf(PropTypes.any).isRequired
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,IAAI,EAAE;IAC5C,MAAM,EACJ,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,EACzC,KAAK,EACL,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,IAAI,EAAE,EAAE,YAAY,EAAE,EACvB,GAAG,IAAI,CAAC;IACT,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,EAAE,eAAe,EAAE,GAAG,cAAc,EAAE,IAAI,EAAE,CAAC;IACnD,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO,CACL,MAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,aAC3C,KAAC,eAAe,IAAC,OAAO,EAAE,eAAe,YACvC,KAAC,WAAW,IACV,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,QAAQ,KAAK,6BAA6B,CAAC,KAAK,IAAI,UAAU,GACpE,GAEc,EACjB,mBAAmB,IAAI,CACtB,KAAC,aAAa,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,GAAI,CACxF,IACiB,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,SAAS,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\nimport { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\nimport RefreshBanner from './RefreshBanner';\nimport getCount from './utils/getCount';\nimport AnnounceRowsCount from './AnnounceRowsCount';\nimport ValidateMessage from './ValidateMessage';\nimport useFormControlProps from './hooks/useFormControlProps';\nimport useWrapAction from './hooks/useWrapAction';\n\nexport default function SimpleToolbar({ view }) {\n const {\n meta: { title, showTitle, template } = {},\n state,\n getContext,\n showCount,\n refreshNotification,\n type: { forceRefresh }\n } = view;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const count = showCount ? getCount({ view }) : undefined;\n const formControlProps = useFormControlProps(view);\n const wrapAction = useWrapAction(view);\n\n return (\n <AnnounceRowsCount state={state} count={count}>\n <ValidateMessage message={validatemessage}>\n <ListToolbar\n name={title}\n showName={showTitle}\n count={count}\n formControlProps={formControlProps}\n wrap={template === REPEATING_STRUCTURE_TEMPLATES.TABLE && wrapAction}\n />\n {/* FIXME: This implementation of error status should be considered temporary until an official, and properly accessible, spec is determined. */}\n </ValidateMessage>\n {refreshNotification && (\n <RefreshBanner refreshNotification={refreshNotification} forceRefresh={forceRefresh} />\n )}\n </AnnounceRowsCount>\n );\n}\n\nSimpleToolbar.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
1
+ {"version":3,"file":"SimpleToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,IAAI,EAAE;IAC5C,MAAM,EACJ,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,EAC/B,KAAK,EACL,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,IAAI,EAAE,EAAE,YAAY,EAAE,EACvB,GAAG,IAAI,CAAC;IACT,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,EAAE,eAAe,EAAE,GAAG,cAAc,EAAE,IAAI,EAAE,CAAC;IACnD,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO,CACL,MAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,aAC3C,KAAC,eAAe,IAAC,OAAO,EAAE,eAAe,YACvC,KAAC,WAAW,IACV,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,UAAU,GAChB,GAEc,EACjB,mBAAmB,IAAI,CACtB,KAAC,aAAa,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,GAAI,CACxF,IACiB,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,SAAS,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\n\nimport RefreshBanner from './RefreshBanner';\nimport getCount from './utils/getCount';\nimport AnnounceRowsCount from './AnnounceRowsCount';\nimport ValidateMessage from './ValidateMessage';\nimport useFormControlProps from './hooks/useFormControlProps';\nimport useWrapAction from './hooks/useWrapAction';\n\nexport default function SimpleToolbar({ view }) {\n const {\n meta: { title, showTitle } = {},\n state,\n getContext,\n showCount,\n refreshNotification,\n type: { forceRefresh }\n } = view;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const count = showCount ? getCount({ view }) : undefined;\n const formControlProps = useFormControlProps(view);\n const wrapAction = useWrapAction(view);\n\n return (\n <AnnounceRowsCount state={state} count={count}>\n <ValidateMessage message={validatemessage}>\n <ListToolbar\n name={title}\n showName={showTitle}\n count={count}\n formControlProps={formControlProps}\n wrap={wrapAction}\n />\n {/* FIXME: This implementation of error status should be considered temporary until an official, and properly accessible, spec is determined. */}\n </ValidateMessage>\n {refreshNotification && (\n <RefreshBanner refreshNotification={refreshNotification} forceRefresh={forceRefresh} />\n )}\n </AnnounceRowsCount>\n );\n}\n\nSimpleToolbar.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
@@ -3,5 +3,5 @@ import type { RsCoreTypes } from 'pega-repeating-structures-core';
3
3
  export default function useWrapAction(view: RsCoreTypes.View): {
4
4
  enabled: boolean;
5
5
  onClick: () => void;
6
- };
6
+ } | undefined;
7
7
  //# sourceMappingURL=useWrapAction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWrapAction.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useWrapAction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE,sFAAsF;AACtF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI;;;EA+B3D"}
1
+ {"version":3,"file":"useWrapAction.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useWrapAction.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAIlE,sFAAsF;AACtF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI;;;cA6C3D"}
@@ -1,9 +1,14 @@
1
1
  import { useMemo, useRef } from 'react';
2
- import { ROW_DENSITY } from 'pega-repeating-structures-core/lib/types/Meta.types';
2
+ import { REPEATING_STRUCTURE_TEMPLATES, ROW_DENSITY } from 'pega-repeating-structures-core/lib/types/Meta.types';
3
+ import showFeatureForTemplate from '../../../templateFeatureSupport';
3
4
  /** Toggles word-wrap row density and restores the previous height when unwrapping. */
4
5
  export default function useWrapAction(view) {
5
6
  const { selectedHeightOption } = view.state;
6
- const { defaultRowHeight } = view.meta;
7
+ // TODO(TS): tighten rs-core types so Meta.template and Meta.showWrapAction are required.
8
+ // Then remove these fallback defaults and rely on the typed contract directly.
9
+ const { defaultRowHeight, showWrapAction = true, template: metaTemplate = REPEATING_STRUCTURE_TEMPLATES.TABLE } = view.meta;
10
+ const template = view.template ?? metaTemplate;
11
+ const isWrapActionEnabled = showWrapAction && showFeatureForTemplate(template, 'wrap');
7
12
  // Track the last non-wrap height so we can restore it when unwrapping.
8
13
  /* TODO: If wrap is persisted via personalization, the pre-wrap height is lost on reload
9
14
  and falls back to meta default. Needs a separate state slice in RsCore to fix. */
@@ -12,17 +17,25 @@ export default function useWrapAction(view) {
12
17
  if (selectedHeightOption && selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT) {
13
18
  lastNonWrapHeightRef.current = selectedHeightOption;
14
19
  }
15
- return useMemo(() => ({
16
- enabled: selectedHeightOption === ROW_DENSITY.WRAP_CONTENT,
17
- onClick: () => {
18
- if (selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT) {
19
- view.type.applyRowHeight(ROW_DENSITY.WRAP_CONTENT);
20
- }
21
- else {
22
- // Disable wrap: restore last non-wrap height, fall back to meta default
23
- view.type.applyRowHeight(lastNonWrapHeightRef.current ?? defaultRowHeight ?? ROW_DENSITY.SHORT);
24
- }
20
+ return useMemo(() => {
21
+ if (!isWrapActionEnabled) {
22
+ return undefined;
25
23
  }
26
- }), [selectedHeightOption, defaultRowHeight]);
24
+ return {
25
+ enabled: selectedHeightOption === ROW_DENSITY.WRAP_CONTENT,
26
+ onClick: () => {
27
+ if (selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT) {
28
+ view.type.applyRowHeight(ROW_DENSITY.WRAP_CONTENT);
29
+ }
30
+ else {
31
+ // Disable wrap: restore last non-wrap height, fall back to meta default, then fall back to SHORT
32
+ const fallbackHeight = defaultRowHeight && defaultRowHeight !== ROW_DENSITY.WRAP_CONTENT
33
+ ? defaultRowHeight
34
+ : ROW_DENSITY.SHORT;
35
+ view.type.applyRowHeight(lastNonWrapHeightRef.current ?? fallbackHeight);
36
+ }
37
+ }
38
+ };
39
+ }, [selectedHeightOption, defaultRowHeight, isWrapActionEnabled]);
27
40
  }
28
41
  //# sourceMappingURL=useWrapAction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWrapAction.js","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useWrapAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAGlF,sFAAsF;AACtF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAsB;IAC1D,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;IAC5C,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;IACvC,uEAAuE;IACvE;sFACkF;IAClF,MAAM,oBAAoB,GAAG,MAAM,CACjC,oBAAoB,KAAK,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CACrF,CAAC;IAEF,kDAAkD;IAClD,IAAI,oBAAoB,IAAI,oBAAoB,KAAK,WAAW,CAAC,YAAY,EAAE,CAAC;QAC9E,oBAAoB,CAAC,OAAO,GAAG,oBAAoB,CAAC;IACtD,CAAC;IAED,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,OAAO,EAAE,oBAAoB,KAAK,WAAW,CAAC,YAAY;QAC1D,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,oBAAoB,KAAK,WAAW,CAAC,YAAY,EAAE,CAAC;gBACtD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YACrD,CAAC;iBAAM,CAAC;gBACN,wEAAwE;gBACxE,IAAI,CAAC,IAAI,CAAC,cAAc,CACtB,oBAAoB,CAAC,OAAO,IAAI,gBAAgB,IAAI,WAAW,CAAC,KAAK,CACtE,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,EACF,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CACzC,CAAC;AACJ,CAAC","sourcesContent":["import { useMemo, useRef } from 'react';\n\nimport { ROW_DENSITY } from 'pega-repeating-structures-core/lib/types/Meta.types';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\n/** Toggles word-wrap row density and restores the previous height when unwrapping. */\nexport default function useWrapAction(view: RsCoreTypes.View) {\n const { selectedHeightOption } = view.state;\n const { defaultRowHeight } = view.meta;\n // Track the last non-wrap height so we can restore it when unwrapping.\n /* TODO: If wrap is persisted via personalization, the pre-wrap height is lost on reload\n and falls back to meta default. Needs a separate state slice in RsCore to fix. */\n const lastNonWrapHeightRef = useRef(\n selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT ? selectedHeightOption : undefined\n );\n\n // Update ref only when height is a non-wrap value\n if (selectedHeightOption && selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT) {\n lastNonWrapHeightRef.current = selectedHeightOption;\n }\n\n return useMemo(\n () => ({\n enabled: selectedHeightOption === ROW_DENSITY.WRAP_CONTENT,\n onClick: () => {\n if (selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT) {\n view.type.applyRowHeight(ROW_DENSITY.WRAP_CONTENT);\n } else {\n // Disable wrap: restore last non-wrap height, fall back to meta default\n view.type.applyRowHeight(\n lastNonWrapHeightRef.current ?? defaultRowHeight ?? ROW_DENSITY.SHORT\n );\n }\n }\n }),\n [selectedHeightOption, defaultRowHeight]\n );\n}\n"]}
1
+ {"version":3,"file":"useWrapAction.js","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useWrapAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EACL,6BAA6B,EAC7B,WAAW,EACZ,MAAM,qDAAqD,CAAC;AAG7D,OAAO,sBAAsB,MAAM,iCAAiC,CAAC;AAErE,sFAAsF;AACtF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAsB;IAC1D,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;IAC5C,yFAAyF;IACzF,+EAA+E;IAC/E,MAAM,EACJ,gBAAgB,EAChB,cAAc,GAAG,IAAI,EACrB,QAAQ,EAAE,YAAY,GAAG,6BAA6B,CAAC,KAAK,EAC7D,GAAG,IAAI,CAAC,IAAI,CAAC;IACd,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,YAAY,CAAC;IAC/C,MAAM,mBAAmB,GAAG,cAAc,IAAI,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEvF,uEAAuE;IACvE;sFACkF;IAClF,MAAM,oBAAoB,GAAG,MAAM,CACjC,oBAAoB,KAAK,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CACrF,CAAC;IAEF,kDAAkD;IAClD,IAAI,oBAAoB,IAAI,oBAAoB,KAAK,WAAW,CAAC,YAAY,EAAE,CAAC;QAC9E,oBAAoB,CAAC,OAAO,GAAG,oBAAoB,CAAC;IACtD,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO;YACL,OAAO,EAAE,oBAAoB,KAAK,WAAW,CAAC,YAAY;YAC1D,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,oBAAoB,KAAK,WAAW,CAAC,YAAY,EAAE,CAAC;oBACtD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;gBACrD,CAAC;qBAAM,CAAC;oBACN,iGAAiG;oBACjG,MAAM,cAAc,GAClB,gBAAgB,IAAI,gBAAgB,KAAK,WAAW,CAAC,YAAY;wBAC/D,CAAC,CAAC,gBAAgB;wBAClB,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC;oBACxB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC;gBAC3E,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,mBAAmB,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { useMemo, useRef } from 'react';\n\nimport {\n REPEATING_STRUCTURE_TEMPLATES,\n ROW_DENSITY\n} from 'pega-repeating-structures-core/lib/types/Meta.types';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport showFeatureForTemplate from '../../../templateFeatureSupport';\n\n/** Toggles word-wrap row density and restores the previous height when unwrapping. */\nexport default function useWrapAction(view: RsCoreTypes.View) {\n const { selectedHeightOption } = view.state;\n // TODO(TS): tighten rs-core types so Meta.template and Meta.showWrapAction are required.\n // Then remove these fallback defaults and rely on the typed contract directly.\n const {\n defaultRowHeight,\n showWrapAction = true,\n template: metaTemplate = REPEATING_STRUCTURE_TEMPLATES.TABLE\n } = view.meta;\n const template = view.template ?? metaTemplate;\n const isWrapActionEnabled = showWrapAction && showFeatureForTemplate(template, 'wrap');\n\n // Track the last non-wrap height so we can restore it when unwrapping.\n /* TODO: If wrap is persisted via personalization, the pre-wrap height is lost on reload\n and falls back to meta default. Needs a separate state slice in RsCore to fix. */\n const lastNonWrapHeightRef = useRef(\n selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT ? selectedHeightOption : undefined\n );\n\n // Update ref only when height is a non-wrap value\n if (selectedHeightOption && selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT) {\n lastNonWrapHeightRef.current = selectedHeightOption;\n }\n\n return useMemo(() => {\n if (!isWrapActionEnabled) {\n return undefined;\n }\n\n return {\n enabled: selectedHeightOption === ROW_DENSITY.WRAP_CONTENT,\n onClick: () => {\n if (selectedHeightOption !== ROW_DENSITY.WRAP_CONTENT) {\n view.type.applyRowHeight(ROW_DENSITY.WRAP_CONTENT);\n } else {\n // Disable wrap: restore last non-wrap height, fall back to meta default, then fall back to SHORT\n const fallbackHeight =\n defaultRowHeight && defaultRowHeight !== ROW_DENSITY.WRAP_CONTENT\n ? defaultRowHeight\n : ROW_DENSITY.SHORT;\n view.type.applyRowHeight(lastNonWrapHeightRef.current ?? fallbackHeight);\n }\n }\n };\n }, [selectedHeightOption, defaultRowHeight, isWrapActionEnabled]);\n}\n"]}
@@ -17,7 +17,7 @@ export default function useDebounce(value, delay) {
17
17
  return () => {
18
18
  clearTimeout(handler);
19
19
  };
20
- }, [value]);
20
+ }, [delay, value]);
21
21
  return debouncedValue;
22
22
  }
23
23
  //# sourceMappingURL=useDebounce.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDebounce.js","sourceRoot":"","sources":["../../../Core/Hooks/useDebounce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAI,KAAQ,EAAE,KAAa;IAC5D,wCAAwC;IACxC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import { useState, useEffect } from 'react';\n\n/**\n * A custom React hook that debounces a value by a specified delay.\n *\n * @param value - The value to debounce.\n * @param delay - The debounce delay in milliseconds.\n *\n * @returns The debounced value.\n */\nexport default function useDebounce<T>(value: T, delay: number): T {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value]);\n\n return debouncedValue;\n}\n"]}
1
+ {"version":3,"file":"useDebounce.js","sourceRoot":"","sources":["../../../Core/Hooks/useDebounce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAI,KAAQ,EAAE,KAAa;IAC5D,wCAAwC;IACxC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAEnB,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import { useState, useEffect } from 'react';\n\n/**\n * A custom React hook that debounces a value by a specified delay.\n *\n * @param value - The value to debounce.\n * @param delay - The debounce delay in milliseconds.\n *\n * @returns The debounced value.\n */\nexport default function useDebounce<T>(value: T, delay: number): T {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [delay, value]);\n\n return debouncedValue;\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import type { ChangeEvent } from 'react';
2
+ interface UseSelectAllCheckboxParams {
3
+ selectedRecordsCount?: number;
4
+ resultsCount?: number;
5
+ hasMoreResults?: boolean;
6
+ selectionMode?: string;
7
+ selectionCountThreshold?: number;
8
+ disableSelectionOnLoad?: boolean;
9
+ selectAllRows?: (checked: boolean) => Promise<void>;
10
+ getDisableSelection?: () => boolean | undefined;
11
+ }
12
+ interface UseSelectAllCheckboxResult {
13
+ showSelectAllCheckbox: boolean;
14
+ isChecked: boolean;
15
+ isIndeterminate: boolean;
16
+ isDisabled: boolean;
17
+ handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
18
+ }
19
+ export default function useSelectAllCheckbox({ selectedRecordsCount, resultsCount, hasMoreResults, selectionMode, selectionCountThreshold, disableSelectionOnLoad, selectAllRows, getDisableSelection }: UseSelectAllCheckboxParams): UseSelectAllCheckboxResult;
20
+ export {};
21
+ //# sourceMappingURL=useSelectAllCheckbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../Core/Hooks/useSelectAllCheckbox.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIzC,UAAU,0BAA0B;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,mBAAmB,CAAC,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;CACjD;AAED,UAAU,0BAA0B;IAClC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC9D;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,oBAAwB,EACxB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,aAAuC,EACvC,mBAAmB,EACpB,EAAE,0BAA0B,GAAG,0BAA0B,CA0BzD"}
@@ -0,0 +1,23 @@
1
+ import { useRef } from 'react';
2
+ const SUPPORTED_MODES_FOR_SELECTALL = ['multi', 'multi_on_hover'];
3
+ export default function useSelectAllCheckbox({ selectedRecordsCount = 0, resultsCount, hasMoreResults, selectionMode, selectionCountThreshold, disableSelectionOnLoad, selectAllRows = () => Promise.resolve(), getDisableSelection }) {
4
+ const isProcessingRef = useRef(false);
5
+ const isSupportedMode = !!selectionMode && SUPPORTED_MODES_FOR_SELECTALL.includes(selectionMode);
6
+ const showSelectAllCheckbox = isSupportedMode &&
7
+ (resultsCount ?? 0) > 0 &&
8
+ (resultsCount ?? 0) <= (selectionCountThreshold ?? 0) &&
9
+ !hasMoreResults;
10
+ const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;
11
+ const isChecked = (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;
12
+ const isDisabled = getDisableSelection?.() ?? disableSelectionOnLoad ?? false;
13
+ const handleChange = (event) => {
14
+ if (isDisabled || isProcessingRef.current)
15
+ return;
16
+ isProcessingRef.current = true;
17
+ selectAllRows(event.target.checked).finally(() => {
18
+ isProcessingRef.current = false;
19
+ });
20
+ };
21
+ return { showSelectAllCheckbox, isChecked, isIndeterminate, isDisabled, handleChange };
22
+ }
23
+ //# sourceMappingURL=useSelectAllCheckbox.js.map
@@ -0,0 +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,21 +1,12 @@
1
1
  export default GroupingHeaderCell;
2
- declare function GroupingHeaderCell(props: any): import("react/jsx-runtime").JSX.Element | null;
2
+ declare function GroupingHeaderCell({ view }: {
3
+ view: any;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
3
5
  declare namespace GroupingHeaderCell {
4
6
  namespace propTypes {
5
- let isExpanded: PropTypes.Requireable<boolean>;
6
- let enable: PropTypes.Requireable<boolean>;
7
- let handleChange: PropTypes.Requireable<(...args: any[]) => any>;
8
- let classList: PropTypes.Requireable<(string | null | undefined)[]>;
9
- }
10
- namespace defaultProps {
11
- let isExpanded_1: boolean;
12
- export { isExpanded_1 as isExpanded };
13
- let enable_1: boolean;
14
- export { enable_1 as enable };
15
- export function handleChange_1(): undefined;
16
- export { handleChange_1 as handleChange };
17
- let classList_1: never[];
18
- export { classList_1 as classList };
7
+ let view: PropTypes.Validator<{
8
+ [x: string]: any;
9
+ }>;
19
10
  }
20
11
  }
21
12
  import PropTypes from 'prop-types';
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingHeaderCell.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/GroupingHeaderCell.jsx"],"names":[],"mappings":";AAOA,gGAkBC;;;;;;;;;;;;;QAYe,4CAAe;;;;;;sBArCT,YAAY"}
1
+ {"version":3,"file":"GroupingHeaderCell.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/GroupingHeaderCell.jsx"],"names":[],"mappings":";AAQA;;mDAqCC;;;;;;;;sBA7CqB,YAAY"}
@@ -1,26 +1,28 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import PropTypes from 'prop-types';
3
3
  import { Icon, Button } from '@pega/cosmos-react-core';
4
- import { createClassName as cx } from '../../Utils';
4
+ import { createClassName as cx, isRowReorderFieldEnabled } from '../../Utils';
5
5
  import useTranslate from '../../Hooks/useTranslate';
6
- function GroupingHeaderCell(props) {
7
- const { enable, isExpanded, handleChange, classList } = props;
6
+ import useSelectAllCheckbox from '../../Hooks/useSelectAllCheckbox';
7
+ function GroupingHeaderCell({ view }) {
8
8
  const [translate] = useTranslate();
9
+ const { enable, isExpanded, handleChange } = view.groupingHeaderCellProps;
10
+ const { showSelectAllCheckbox } = useSelectAllCheckbox({
11
+ selectedRecordsCount: view.selectedRecordsCount,
12
+ resultsCount: view.resultsCount,
13
+ hasMoreResults: view.hasMoreResults,
14
+ selectionMode: view.meta?.selectionMode,
15
+ selectionCountThreshold: view.meta?.selectionCountThreshold
16
+ });
17
+ const hasOotbColumns = showSelectAllCheckbox ||
18
+ !!view.state?.errors?.dataErrors ||
19
+ isRowReorderFieldEnabled(view.meta ?? {});
9
20
  if (!enable)
10
21
  return null;
11
- return (_jsx("div", { className: cx('expand-collapse-all', { expanded: isExpanded }, ...classList), children: _jsx(Button, { onClick: () => handleChange(!isExpanded), variant: 'simple', icon: true, compact: true, "aria-live": 'polite', label: isExpanded ? translate('Collapse all groups') : translate('Expand all groups'), children: isExpanded ? _jsx(Icon, { name: 'caret-down' }) : _jsx(Icon, { name: 'caret-right' }) }) }));
22
+ return (_jsx("div", { className: cx('expand-collapse-all', { expanded: isExpanded }, hasOotbColumns && 'no-border-right'), children: _jsx(Button, { onClick: () => handleChange(!isExpanded), variant: 'simple', icon: true, compact: true, "aria-live": 'polite', label: isExpanded ? translate('Collapse all groups') : translate('Expand all groups'), children: isExpanded ? _jsx(Icon, { name: 'caret-down' }) : _jsx(Icon, { name: 'caret-right' }) }) }));
12
23
  }
13
24
  GroupingHeaderCell.propTypes = {
14
- isExpanded: PropTypes.bool,
15
- enable: PropTypes.bool,
16
- handleChange: PropTypes.func,
17
- classList: PropTypes.arrayOf(PropTypes.string)
18
- };
19
- GroupingHeaderCell.defaultProps = {
20
- isExpanded: false,
21
- enable: false,
22
- handleChange: () => undefined,
23
- classList: []
25
+ view: PropTypes.objectOf(PropTypes.any).isRequired
24
26
  };
25
27
  export default GroupingHeaderCell;
26
28
  //# sourceMappingURL=GroupingHeaderCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingHeaderCell.js","sourceRoot":"","sources":["../../../../Core/Views/Table/GroupingHeaderCell.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,SAAS,kBAAkB,CAAC,KAAK;IAC/B,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC9D,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,SAAS,CAAC,YAC/E,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,EACxC,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,qBACG,QAAQ,EAClB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,YAEpF,UAAU,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,GAC/D,GACL,CACP,CAAC;AACJ,CAAC;AAED,kBAAkB,CAAC,SAAS,GAAG;IAC7B,UAAU,EAAE,SAAS,CAAC,IAAI;IAC1B,MAAM,EAAE,SAAS,CAAC,IAAI;IACtB,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;CAC/C,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG;IAChC,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS;IAC7B,SAAS,EAAE,EAAE;CACd,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { Icon, Button } from '@pega/cosmos-react-core';\n\nimport { createClassName as cx } from '../../Utils';\nimport useTranslate from '../../Hooks/useTranslate';\n\nfunction GroupingHeaderCell(props) {\n const { enable, isExpanded, handleChange, classList } = props;\n const [translate] = useTranslate();\n if (!enable) return null;\n return (\n <div className={cx('expand-collapse-all', { expanded: isExpanded }, ...classList)}>\n <Button\n onClick={() => handleChange(!isExpanded)}\n variant='simple'\n icon\n compact\n aria-live='polite'\n label={isExpanded ? translate('Collapse all groups') : translate('Expand all groups')}\n >\n {isExpanded ? <Icon name='caret-down' /> : <Icon name='caret-right' />}\n </Button>\n </div>\n );\n}\n\nGroupingHeaderCell.propTypes = {\n isExpanded: PropTypes.bool,\n enable: PropTypes.bool,\n handleChange: PropTypes.func,\n classList: PropTypes.arrayOf(PropTypes.string)\n};\n\nGroupingHeaderCell.defaultProps = {\n isExpanded: false,\n enable: false,\n handleChange: () => undefined,\n classList: []\n};\n\nexport default GroupingHeaderCell;\n"]}
1
+ {"version":3,"file":"GroupingHeaderCell.js","sourceRoot":"","sources":["../../../../Core/Views/Table/GroupingHeaderCell.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AAEpE,SAAS,kBAAkB,CAAC,EAAE,IAAI,EAAE;IAClC,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,uBAAuB,CAAC;IAE1E,MAAM,EAAE,qBAAqB,EAAE,GAAG,oBAAoB,CAAC;QACrD,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;QAC/C,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,aAAa,EAAE,IAAI,CAAC,IAAI,EAAE,aAAa;QACvC,uBAAuB,EAAE,IAAI,CAAC,IAAI,EAAE,uBAAuB;KAC5D,CAAC,CAAC;IACH,MAAM,cAAc,GAClB,qBAAqB;QACrB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU;QAChC,wBAAwB,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAE5C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,qBAAqB,EACrB,EAAE,QAAQ,EAAE,UAAU,EAAE,EACxB,cAAc,IAAI,iBAAiB,CACpC,YAED,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,EACxC,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,qBACG,QAAQ,EAClB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,YAEpF,UAAU,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,GAC/D,GACL,CACP,CAAC;AACJ,CAAC;AAED,kBAAkB,CAAC,SAAS,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { Icon, Button } from '@pega/cosmos-react-core';\n\nimport { createClassName as cx, isRowReorderFieldEnabled } from '../../Utils';\nimport useTranslate from '../../Hooks/useTranslate';\nimport useSelectAllCheckbox from '../../Hooks/useSelectAllCheckbox';\n\nfunction GroupingHeaderCell({ view }) {\n const [translate] = useTranslate();\n const { enable, isExpanded, handleChange } = view.groupingHeaderCellProps;\n\n const { showSelectAllCheckbox } = useSelectAllCheckbox({\n selectedRecordsCount: view.selectedRecordsCount,\n resultsCount: view.resultsCount,\n hasMoreResults: view.hasMoreResults,\n selectionMode: view.meta?.selectionMode,\n selectionCountThreshold: view.meta?.selectionCountThreshold\n });\n const hasOotbColumns =\n showSelectAllCheckbox ||\n !!view.state?.errors?.dataErrors ||\n isRowReorderFieldEnabled(view.meta ?? {});\n\n if (!enable) return null;\n return (\n <div\n className={cx(\n 'expand-collapse-all',\n { expanded: isExpanded },\n hasOotbColumns && 'no-border-right'\n )}\n >\n <Button\n onClick={() => handleChange(!isExpanded)}\n variant='simple'\n icon\n compact\n aria-live='polite'\n label={isExpanded ? translate('Collapse all groups') : translate('Expand all groups')}\n >\n {isExpanded ? <Icon name='caret-down' /> : <Icon name='caret-right' />}\n </Button>\n </div>\n );\n}\n\nGroupingHeaderCell.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n\nexport default GroupingHeaderCell;\n"]}
@@ -92,7 +92,7 @@ function StyledTable({ view }) {
92
92
  'show-expand-collapse-all': view.showGroupingExpandCollapseAll
93
93
  }), theme: theme, view: view, isFullscreen: isFullscreen, children: [_jsx(WarningBanner, { warningMessages: view.warningMessages }), _jsx(Toolbar, { view: view }), _jsx(RenderView, { type: EXTERNAL_FILTERS, view: view }), _jsx(NotificationManager, { view: view }), _jsx(RepeatingStructureA11y, { view: view, a11yRef: a11yRef, children: _jsxs("div", { className: cx('container', view.className, {
94
94
  'small-screen-table': !isSmallOrAbove
95
- }), ref: containerRef, ...view.getUIProps(), onClick: onClickHandler, onFocusCapture: e => a11yRef.current.onFocusHandler(e), onBlurCapture: e => a11yRef.current.onBlurHandler(e), children: [view.state?.groups?.length ? (_jsxs(_Fragment, { children: [_jsx(GroupingHeaderCell, { ...view.groupingHeaderCellProps }), _jsx(Virtualiser, { id: 'rootVirtualiser', view: view, renderHeader: renderHeader, renderFooter: renderFooter, isFullscreen: isFullscreen, children: _jsx(Body, { groupHeaders: groupHeaders, columns: columns, hierarchicalGroupEnabled: view.hierarchicalGroupEnabled }) })] })) : (_jsx(Virtualiser, { id: 'rootVirtualiser', view: view, renderHeader: renderHeader, renderFooter: renderFooter, isFullscreen: isFullscreen, useVariableRowHeightVirtualization: true })), _jsx(LoadingIndicator, { view: view, show: !rows || !!view.isLoading }), _jsx(ContextMenuContainer, { view: view, selector: contextMenuSelector })] }) })] }) }));
95
+ }), ref: containerRef, ...view.getUIProps(), onClick: onClickHandler, onFocusCapture: e => a11yRef.current.onFocusHandler(e), onBlurCapture: e => a11yRef.current.onBlurHandler(e), children: [view.state?.groups?.length ? (_jsxs(_Fragment, { children: [_jsx(GroupingHeaderCell, { view: view }), _jsx(Virtualiser, { id: 'rootVirtualiser', view: view, renderHeader: renderHeader, renderFooter: renderFooter, isFullscreen: isFullscreen, children: _jsx(Body, { groupHeaders: groupHeaders, columns: columns, hierarchicalGroupEnabled: view.hierarchicalGroupEnabled }) })] })) : (_jsx(Virtualiser, { id: 'rootVirtualiser', view: view, renderHeader: renderHeader, renderFooter: renderFooter, isFullscreen: isFullscreen, useVariableRowHeightVirtualization: true })), _jsx(LoadingIndicator, { view: view, show: !rows || !!view.isLoading }), _jsx(ContextMenuContainer, { view: view, selector: contextMenuSelector })] }) })] }) }));
96
96
  }
97
97
  StyledTable.propTypes = {
98
98
  view: PropTypes.objectOf(PropTypes.any).isRequired
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Views/Table/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AACvE,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAC/C,OAAO,oBAAoB,MAAM,mDAAmD,CAAC;AACrF,OAAO,gBAAgB,MAAM,mCAAmC,CAAC;AACjE,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,sBAAsB,MAAM,8CAA8C,CAAC;AAClF,OAAO,UAAU,MAAM,6CAA6C,CAAC;AACrE,OAAO,E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,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,kCAAkC,SAClC,CACH,EACD,KAAC,gBAAgB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,GAAI,EACjE,KAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,mBAAmB,GAAI,IAC/D,GACiB,IACJ,GACT,CACjB,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,SAAS,GAAG;IACtB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useCallback, useRef, useEffect } from 'react';\n\nimport { useLiveLog } from '@pega/cosmos-react-core/lib/hooks';\nimport { useFullscreenContext, useTheme } from '@pega/cosmos-react-core';\nimport { expandCollapseAllMeta } from 'pega-repeating-structures-core';\n\nimport { createClassName as cx } from '../../Utils';\nimport NotificationManager from '../../Components/NotificationManager';\nimport WarningBanner from '../../Components/WarningBanner';\nimport Toolbar from '../../Components/Toolbar';\nimport ContextMenuContainer from '../../Components/ContextMenu/ContextMenuContainer';\nimport LoadingIndicator from '../../Components/LoadingIndicator';\nimport TableFooter from '../../Components/Footer';\nimport RepeatingStructureA11y from '../../Components/A11y/RepeatingStructureA11y';\nimport RenderView from '../../Components/RenderingEngine/RenderView';\nimport { EXTERNAL_FILTERS, FOCUSABLE_SELECTORS, ACTIONABLE_SELECTORS } from '../../constants';\nimport useTranslate from '../../Hooks/useTranslate';\nimport RsCardWrapper from '../RsCardWrapper';\n\nimport GroupingHeaderCell from './GroupingHeaderCell';\nimport StyledTableContainer from './StyledTableContainer';\nimport TableA11y from './TableA11y';\nimport Body from './Body';\nimport Virtualiser from './VirtualizeWrapper';\nimport Headers from './Headers';\n\nconst contextMenuSelector = { query: '.cell:not([role=\"columnheader\"])' };\n\nfunction StyledTable({ view }) {\n const isFullscreen = !!useFullscreenContext()?.[0];\n const { columns, rows, groupHeaders, meta: { toolbarActions } = {} } = view;\n const rowHeight = 40;\n const footerHeight = 57;\n const isSmallOrAbove = view?.state?.responsive?.sm;\n const expandCollapseAllWidth = view.showGroupingExpandCollapseAll\n ? expandCollapseAllMeta.width\n : 0;\n\n const containerStyles = {\n '--row-height': `${rowHeight}px`,\n '--footer-height': `${footerHeight}px`,\n '--expand-collapse-all-width': `${expandCollapseAllWidth}px`\n };\n const renderHeader = useCallback(\n () => <Headers ref={view.setItemElement} columns={columns} isVisible={!!rows} />,\n [columns, rows, view]\n );\n const renderFooter = useCallback(() => <TableFooter view={view} />, [view]);\n const addAction = toolbarActions?.find(action => action.id === 'Add_Record');\n const theme = useTheme();\n const containerRef = useRef(null);\n const { announcePolite } = useLiveLog();\n const [translate] = useTranslate();\n const a11yRef = useRef(\n new TableA11y(\n {\n topFocusRef: '.top',\n bottomFocusRef: '.bottom',\n focusElementSelector: '.cell',\n parentElementSelector: '.row',\n aboveLoader: '.above-loader',\n belowLoader: '.below-loader',\n expandCollpaseAll: '.expand-collapse-all',\n stickyGroupHeaderSelector: '.stickyGroupHeader',\n aggregateCell: '.aggregateCell',\n tableLoader: '.table-loader',\n footer: '.footer',\n addActionSelector: addAction ? `[aria-label=\"${addAction.text}\"]` : undefined\n },\n FOCUSABLE_SELECTORS,\n {\n TAB: 9,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n },\n null,\n announcePolite,\n translate,\n ACTIONABLE_SELECTORS,\n translate('Interactive content')\n )\n );\n\n useEffect(() => {\n a11yRef.current.setContainer(containerRef.current);\n\n return () => {\n containerRef.current = null;\n a11yRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n a11yRef.current.itemsLoadedCallback();\n });\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n const handler = e => a11yRef.current.a11yHandler(e);\n container.addEventListener('keydown', handler);\n return () => container.removeEventListener('keydown', handler);\n }, []);\n\n const onClickHandler = useCallback(e => {\n const pointerType = e.nativeEvent.pointerType;\n if (pointerType) {\n a11yRef.current.clickHandler(e);\n }\n }, []);\n\n return (\n <RsCardWrapper>\n <StyledTableContainer\n style={containerStyles}\n data-test-id='table'\n data-testid='table'\n className={cx('t-container', {\n 'show-expand-collapse-all': view.showGroupingExpandCollapseAll\n })}\n theme={theme}\n view={view}\n isFullscreen={isFullscreen}\n >\n <WarningBanner warningMessages={view.warningMessages} />\n <Toolbar view={view} />\n <RenderView type={EXTERNAL_FILTERS} view={view} />\n <NotificationManager view={view} />\n <RepeatingStructureA11y view={view} a11yRef={a11yRef}>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className={cx('container', view.className, {\n 'small-screen-table': !isSmallOrAbove\n })}\n ref={containerRef}\n {...view.getUIProps()}\n onClick={onClickHandler}\n onFocusCapture={e => a11yRef.current.onFocusHandler(e)}\n onBlurCapture={e => a11yRef.current.onBlurHandler(e)}\n >\n {view.state?.groups?.length ? (\n <>\n <GroupingHeaderCell {...view.groupingHeaderCellProps} />\n <Virtualiser\n id='rootVirtualiser'\n view={view}\n renderHeader={renderHeader}\n renderFooter={renderFooter}\n isFullscreen={isFullscreen}\n >\n <Body\n groupHeaders={groupHeaders}\n columns={columns}\n hierarchicalGroupEnabled={view.hierarchicalGroupEnabled}\n />\n </Virtualiser>\n </>\n ) : (\n <Virtualiser\n id='rootVirtualiser'\n view={view}\n renderHeader={renderHeader}\n renderFooter={renderFooter}\n isFullscreen={isFullscreen}\n useVariableRowHeightVirtualization\n />\n )}\n <LoadingIndicator view={view} show={!rows || !!view.isLoading} />\n <ContextMenuContainer view={view} selector={contextMenuSelector} />\n </div>\n </RepeatingStructureA11y>\n </StyledTableContainer>\n </RsCardWrapper>\n );\n}\n\nStyledTable.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired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AAEF,eAAe,WAAW,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useCallback, useRef, useEffect } from 'react';\n\nimport { useLiveLog } from '@pega/cosmos-react-core/lib/hooks';\nimport { useFullscreenContext, useTheme } from '@pega/cosmos-react-core';\nimport { expandCollapseAllMeta } from 'pega-repeating-structures-core';\n\nimport { createClassName as cx } from '../../Utils';\nimport NotificationManager from '../../Components/NotificationManager';\nimport WarningBanner from '../../Components/WarningBanner';\nimport Toolbar from '../../Components/Toolbar';\nimport ContextMenuContainer from '../../Components/ContextMenu/ContextMenuContainer';\nimport LoadingIndicator from '../../Components/LoadingIndicator';\nimport TableFooter from '../../Components/Footer';\nimport RepeatingStructureA11y from '../../Components/A11y/RepeatingStructureA11y';\nimport RenderView from '../../Components/RenderingEngine/RenderView';\nimport { EXTERNAL_FILTERS, FOCUSABLE_SELECTORS, ACTIONABLE_SELECTORS } from '../../constants';\nimport useTranslate from '../../Hooks/useTranslate';\nimport RsCardWrapper from '../RsCardWrapper';\n\nimport GroupingHeaderCell from './GroupingHeaderCell';\nimport StyledTableContainer from './StyledTableContainer';\nimport TableA11y from './TableA11y';\nimport Body from './Body';\nimport Virtualiser from './VirtualizeWrapper';\nimport Headers from './Headers';\n\nconst contextMenuSelector = { query: '.cell:not([role=\"columnheader\"])' };\n\nfunction StyledTable({ view }) {\n const isFullscreen = !!useFullscreenContext()?.[0];\n const { columns, rows, groupHeaders, meta: { toolbarActions } = {} } = view;\n const rowHeight = 40;\n const footerHeight = 57;\n const isSmallOrAbove = view?.state?.responsive?.sm;\n const expandCollapseAllWidth = view.showGroupingExpandCollapseAll\n ? expandCollapseAllMeta.width\n : 0;\n\n const containerStyles = {\n '--row-height': `${rowHeight}px`,\n '--footer-height': `${footerHeight}px`,\n '--expand-collapse-all-width': `${expandCollapseAllWidth}px`\n };\n const renderHeader = useCallback(\n () => <Headers ref={view.setItemElement} columns={columns} isVisible={!!rows} />,\n [columns, rows, view]\n );\n const renderFooter = useCallback(() => <TableFooter view={view} />, [view]);\n const addAction = toolbarActions?.find(action => action.id === 'Add_Record');\n const theme = useTheme();\n const containerRef = useRef(null);\n const { announcePolite } = useLiveLog();\n const [translate] = useTranslate();\n const a11yRef = useRef(\n new TableA11y(\n {\n topFocusRef: '.top',\n bottomFocusRef: '.bottom',\n focusElementSelector: '.cell',\n parentElementSelector: '.row',\n aboveLoader: '.above-loader',\n belowLoader: '.below-loader',\n expandCollpaseAll: '.expand-collapse-all',\n stickyGroupHeaderSelector: '.stickyGroupHeader',\n aggregateCell: '.aggregateCell',\n tableLoader: '.table-loader',\n footer: '.footer',\n addActionSelector: addAction ? `[aria-label=\"${addAction.text}\"]` : undefined\n },\n FOCUSABLE_SELECTORS,\n {\n TAB: 9,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n },\n null,\n announcePolite,\n translate,\n ACTIONABLE_SELECTORS,\n translate('Interactive content')\n )\n );\n\n useEffect(() => {\n a11yRef.current.setContainer(containerRef.current);\n\n return () => {\n containerRef.current = null;\n a11yRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n a11yRef.current.itemsLoadedCallback();\n });\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n const handler = e => a11yRef.current.a11yHandler(e);\n container.addEventListener('keydown', handler);\n return () => container.removeEventListener('keydown', handler);\n }, []);\n\n const onClickHandler = useCallback(e => {\n const pointerType = e.nativeEvent.pointerType;\n if (pointerType) {\n a11yRef.current.clickHandler(e);\n }\n }, []);\n\n return (\n <RsCardWrapper>\n <StyledTableContainer\n style={containerStyles}\n data-test-id='table'\n data-testid='table'\n className={cx('t-container', {\n 'show-expand-collapse-all': view.showGroupingExpandCollapseAll\n })}\n theme={theme}\n view={view}\n isFullscreen={isFullscreen}\n >\n <WarningBanner warningMessages={view.warningMessages} />\n <Toolbar view={view} />\n <RenderView type={EXTERNAL_FILTERS} view={view} />\n <NotificationManager view={view} />\n <RepeatingStructureA11y view={view} a11yRef={a11yRef}>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className={cx('container', view.className, {\n 'small-screen-table': !isSmallOrAbove\n })}\n ref={containerRef}\n {...view.getUIProps()}\n onClick={onClickHandler}\n onFocusCapture={e => a11yRef.current.onFocusHandler(e)}\n onBlurCapture={e => a11yRef.current.onBlurHandler(e)}\n >\n {view.state?.groups?.length ? (\n <>\n <GroupingHeaderCell view={view} />\n <Virtualiser\n id='rootVirtualiser'\n view={view}\n renderHeader={renderHeader}\n renderFooter={renderFooter}\n isFullscreen={isFullscreen}\n >\n <Body\n groupHeaders={groupHeaders}\n columns={columns}\n hierarchicalGroupEnabled={view.hierarchicalGroupEnabled}\n />\n </Virtualiser>\n </>\n ) : (\n <Virtualiser\n id='rootVirtualiser'\n view={view}\n renderHeader={renderHeader}\n renderFooter={renderFooter}\n isFullscreen={isFullscreen}\n useVariableRowHeightVirtualization\n />\n )}\n <LoadingIndicator view={view} show={!rows || !!view.isLoading} />\n <ContextMenuContainer view={view} selector={contextMenuSelector} />\n </div>\n </RepeatingStructureA11y>\n </StyledTableContainer>\n </RsCardWrapper>\n );\n}\n\nStyledTable.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n\nexport default StyledTable;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-react",
3
- "version": "9.0.0-build.29.25",
3
+ "version": "9.0.0-build.29.27",
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": "9.0.0-build.29.25",
18
- "@pega/cosmos-react-core": "9.0.0-build.29.25",
19
- "@pega/cosmos-react-rte": "9.0.0-build.29.25",
17
+ "@pega/cosmos-react-condition-builder": "9.0.0-build.29.27",
18
+ "@pega/cosmos-react-core": "9.0.0-build.29.27",
19
+ "@pega/cosmos-react-rte": "9.0.0-build.29.27",
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@9.0.0-build.29.25",
27
- "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.0.0-build.29.25",
26
+ "pega-repeating-structures-core": "npm:@pega/lists-core@9.0.0-build.29.27",
27
+ "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.0.0-build.29.27",
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": "9.0.0-build.29.25",
45
+ "srs-utils": "9.0.0-build.29.27",
46
46
  "typescript": "~5.9.3"
47
47
  }
48
48
  }