@pega/lists-react 8.0.0-build.58.0 → 8.0.0-build.58.1

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":"AdvanceToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":"AAwBA;;4CAuIC;;;;;;;;;sBA9JqB,YAAY"}
1
+ {"version":3,"file":"AdvanceToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":"AAwBA;;4CA6IC;;;;;;;;;sBApKqB,YAAY"}
@@ -20,7 +20,7 @@ import AnnounceRowsCount from './AnnounceRowsCount';
20
20
  import ValidateMessage from './ValidateMessage';
21
21
  import useFormControlProps from './hooks/useFormControlProps';
22
22
  export default function AdvanceToolbar({ view }) {
23
- const { selectedRecordsCount, meta: { basicMode, selectionMode, title, toolbarActions, template, allowBulkActions, mapFieldIds } = {}, rows, state, getContext, isLoading, showCount, refreshNotification, type: { forceRefresh } } = view;
23
+ const { selectedRecordsCount, meta: { basicMode, selectionMode, title, toolbarActions, template, allowBulkActions, mapFieldIds } = {}, rows, state, getContext, isLoading, showCount, refreshNotification, type: { forceRefresh }, announceCount } = view;
24
24
  const { selectedHeightOption } = state;
25
25
  const { getRequiredDef } = getContext();
26
26
  const { validatemessage } = getRequiredDef() || {};
@@ -65,7 +65,7 @@ export default function AdvanceToolbar({ view }) {
65
65
  default:
66
66
  Toolbar = (_jsxs(_Fragment, { children: [_jsx(ListToolbar, { name: title, formControlProps: formControlProps, viewSelector: viewSelector, search: search, count: count, additionalActions: additionalActions, filter: filter, group: group, sort: sort, actions: actions, actionsButtonRef: actionsButtonRef, createNew: createNew, wrap: template === 'Table' && wrapAction }), popover] }));
67
67
  }
68
- return (_jsxs(AnnounceRowsCount, { state: state, count: count, isLoading: isLoading, children: [_jsx(ValidateMessage, { message: validatemessage, children: Toolbar }), refreshNotification && (_jsx(RefreshBanner, { refreshNotification: refreshNotification, forceRefresh: forceRefresh }))] }));
68
+ 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 }))] }));
69
69
  }
70
70
  AdvanceToolbar.propTypes = {
71
71
  view: PropTypes.objectOf(PropTypes.any).isRequired
@@ -1 +1 @@
1
- {"version":3,"file":"AdvanceToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,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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AE,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 { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\nimport { ROW_DENSITY } from 'pega-repeating-structures-core/lib/types/Meta.types';\n\nimport { SELECTION_MODES } from '../../constants';\n\nimport ActionsMenu from './ActionsMenu';\nimport MapToolbar from './Map/MapToolbar';\nimport ToolbarActions from './ToolbarActions';\nimport TimelineToolbar from './Timeline/TimelineToolbar';\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';\n\nexport default function AdvanceToolbar({ view }) {\n const {\n selectedRecordsCount,\n meta: {\n basicMode,\n selectionMode,\n title,\n toolbarActions,\n template,\n allowBulkActions,\n mapFieldIds\n } = {},\n rows,\n state,\n getContext,\n isLoading,\n showCount,\n refreshNotification,\n type: { forceRefresh }\n } = view;\n const { selectedHeightOption } = state;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const { viewSelector } = usePersonalization({ view });\n const search = useSearch({ view });\n const count = showCount ? getCount({ view }) : {};\n const filter = useFilter({ view });\n const group = useGroup({ view });\n const sort = useSort({ view });\n const { actions, actionsButtonRef, popover } = useMore({ view });\n const enableActionsMenu = selectionMode === SELECTION_MODES.multi && selectedRecordsCount !== 0;\n const formControlProps = useFormControlProps(view);\n\n const additionalActions = (\n <>\n {basicMode && (\n <ToolbarActions\n toolbarActions={toolbarActions?.filter(action => !action.id.startsWith('Add'))}\n />\n )}\n {allowBulkActions && <ActionsMenu enableActionsMenu={enableActionsMenu} view={view} />}\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 wrapAction = useMemo(() => {\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 view.type.applyRowHeight(ROW_DENSITY.SHORT);\n }\n }\n };\n }, [selectedHeightOption]);\n\n let Toolbar;\n switch (template) {\n case 'Timeline':\n Toolbar = (\n <>\n <TimelineToolbar\n name={title}\n formControlProps={formControlProps}\n viewSelector={viewSelector}\n search={search}\n count={count}\n additionalActions={additionalActions}\n filter={filter}\n createNew={createNew}\n view={view}\n actions={actions}\n actionsButtonRef={actionsButtonRef}\n />\n {popover}\n </>\n );\n break;\n case 'Map':\n Toolbar = (\n <MapToolbar\n locationFieldId={mapFieldIds?.location}\n name={title}\n formControlProps={formControlProps}\n rows={rows}\n count={count}\n createNew={createNew}\n additionalActions={additionalActions}\n />\n );\n break;\n default:\n Toolbar = (\n <>\n <ListToolbar\n name={title}\n formControlProps={formControlProps}\n viewSelector={viewSelector}\n search={search}\n count={count}\n additionalActions={additionalActions}\n filter={filter}\n group={group}\n sort={sort}\n actions={actions}\n actionsButtonRef={actionsButtonRef}\n createNew={createNew}\n wrap={template === 'Table' && wrapAction}\n />\n {popover}\n </>\n );\n }\n\n return (\n <AnnounceRowsCount state={state} count={count} isLoading={isLoading}>\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,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,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;AAE9D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE;IAC7C,MAAM,EACJ,oBAAoB,EACpB,IAAI,EAAE,EACJ,SAAS,EACT,aAAa,EACb,KAAK,EACL,cAAc,EACd,QAAQ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AAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\nimport { ROW_DENSITY } from 'pega-repeating-structures-core/lib/types/Meta.types';\n\nimport { SELECTION_MODES } from '../../constants';\n\nimport ActionsMenu from './ActionsMenu';\nimport MapToolbar from './Map/MapToolbar';\nimport ToolbarActions from './ToolbarActions';\nimport TimelineToolbar from './Timeline/TimelineToolbar';\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';\n\nexport default function AdvanceToolbar({ view }) {\n const {\n selectedRecordsCount,\n meta: {\n basicMode,\n selectionMode,\n title,\n toolbarActions,\n template,\n allowBulkActions,\n mapFieldIds\n } = {},\n rows,\n state,\n getContext,\n isLoading,\n showCount,\n refreshNotification,\n type: { forceRefresh },\n announceCount\n } = view;\n const { selectedHeightOption } = state;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const { viewSelector } = usePersonalization({ view });\n const search = useSearch({ view });\n const count = showCount ? getCount({ view }) : {};\n const filter = useFilter({ view });\n const group = useGroup({ view });\n const sort = useSort({ view });\n const { actions, actionsButtonRef, popover } = useMore({ view });\n const enableActionsMenu = selectionMode === SELECTION_MODES.multi && selectedRecordsCount !== 0;\n const formControlProps = useFormControlProps(view);\n\n const additionalActions = (\n <>\n {basicMode && (\n <ToolbarActions\n toolbarActions={toolbarActions?.filter(action => !action.id.startsWith('Add'))}\n />\n )}\n {allowBulkActions && <ActionsMenu enableActionsMenu={enableActionsMenu} view={view} />}\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 wrapAction = useMemo(() => {\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 view.type.applyRowHeight(ROW_DENSITY.SHORT);\n }\n }\n };\n }, [selectedHeightOption]);\n\n let Toolbar;\n switch (template) {\n case 'Timeline':\n Toolbar = (\n <>\n <TimelineToolbar\n name={title}\n formControlProps={formControlProps}\n viewSelector={viewSelector}\n search={search}\n count={count}\n additionalActions={additionalActions}\n filter={filter}\n createNew={createNew}\n view={view}\n actions={actions}\n actionsButtonRef={actionsButtonRef}\n />\n {popover}\n </>\n );\n break;\n case 'Map':\n Toolbar = (\n <MapToolbar\n locationFieldId={mapFieldIds?.location}\n name={title}\n formControlProps={formControlProps}\n rows={rows}\n count={count}\n createNew={createNew}\n additionalActions={additionalActions}\n />\n );\n break;\n default:\n Toolbar = (\n <>\n <ListToolbar\n name={title}\n formControlProps={formControlProps}\n viewSelector={viewSelector}\n search={search}\n count={count}\n additionalActions={additionalActions}\n filter={filter}\n group={group}\n sort={sort}\n actions={actions}\n actionsButtonRef={actionsButtonRef}\n createNew={createNew}\n wrap={template === 'Table' && wrapAction}\n />\n {popover}\n </>\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,9 +1,10 @@
1
1
  export default AnnounceRowsCount;
2
- declare function AnnounceRowsCount({ state, count, isLoading, children }: {
2
+ declare function AnnounceRowsCount({ state, count, isLoading, children, announceCount }: {
3
3
  state: any;
4
4
  count: any;
5
5
  isLoading: any;
6
6
  children: any;
7
+ announceCount: any;
7
8
  }): import("react/jsx-runtime").JSX.Element;
8
9
  declare namespace AnnounceRowsCount {
9
10
  namespace propTypes {
@@ -1 +1 @@
1
- {"version":3,"file":"AnnounceRowsCount.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AnnounceRowsCount.jsx"],"names":[],"mappings":";AAIA;;;;;4CAGC;;;;;;;;;;;;sBAPqB,YAAY"}
1
+ {"version":3,"file":"AnnounceRowsCount.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AnnounceRowsCount.jsx"],"names":[],"mappings":";AAIA;;;;;;4CAGC;;;;;;;;;;;;sBAPqB,YAAY"}
@@ -1,8 +1,8 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import PropTypes from 'prop-types';
3
3
  import useAnnounceRowsCount from './hooks/useAnnounceRowsCount';
4
- const AnnounceRowsCount = ({ state, count, isLoading, children }) => {
5
- useAnnounceRowsCount(state, count, isLoading);
4
+ const AnnounceRowsCount = ({ state, count, isLoading, children, announceCount }) => {
5
+ useAnnounceRowsCount(state, count, isLoading, announceCount);
6
6
  return _jsx(_Fragment, { children: children });
7
7
  };
8
8
  AnnounceRowsCount.propTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"AnnounceRowsCount.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AnnounceRowsCount.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAEhE,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClE,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAC9C,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC,CAAC;AAEF,iBAAiB,CAAC,SAAS,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACnD,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACnD,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU;CAC9E,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport useAnnounceRowsCount from './hooks/useAnnounceRowsCount';\n\nconst AnnounceRowsCount = ({ state, count, isLoading, children }) => {\n useAnnounceRowsCount(state, count, isLoading);\n return <>{children}</>;\n};\n\nAnnounceRowsCount.propTypes = {\n state: PropTypes.objectOf(PropTypes.any).isRequired,\n count: PropTypes.objectOf(PropTypes.any).isRequired,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired\n};\n\nexport default AnnounceRowsCount;\n"]}
1
+ {"version":3,"file":"AnnounceRowsCount.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AnnounceRowsCount.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAEhE,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,EAAE;IACjF,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAC7D,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC,CAAC;AAEF,iBAAiB,CAAC,SAAS,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACnD,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACnD,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU;CAC9E,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport useAnnounceRowsCount from './hooks/useAnnounceRowsCount';\n\nconst AnnounceRowsCount = ({ state, count, isLoading, children, announceCount }) => {\n useAnnounceRowsCount(state, count, isLoading, announceCount);\n return <>{children}</>;\n};\n\nAnnounceRowsCount.propTypes = {\n state: PropTypes.objectOf(PropTypes.any).isRequired,\n count: PropTypes.objectOf(PropTypes.any).isRequired,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired\n};\n\nexport default AnnounceRowsCount;\n"]}
@@ -1,3 +1,3 @@
1
1
  export default useAnnounceRowsCount;
2
- declare function useAnnounceRowsCount(state: any, count: any, isLoading: any): void;
2
+ declare function useAnnounceRowsCount(state: any, count: any, isLoading: any, announceCount: any): void;
3
3
  //# sourceMappingURL=useAnnounceRowsCount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAnnounceRowsCount.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useAnnounceRowsCount.js"],"names":[],"mappings":";AAMA,oFAuCC"}
1
+ {"version":3,"file":"useAnnounceRowsCount.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useAnnounceRowsCount.js"],"names":[],"mappings":";AAMA,wGAmDC"}
@@ -1,37 +1,47 @@
1
1
  import { useEffect, useRef } from 'react';
2
2
  import { useI18n, useLiveLog } from '@pega/cosmos-react-core/lib/hooks';
3
3
  import cosmosTranslatedLiterals from '../../../Localization/translateCosmosLiteralsUtils';
4
- const useAnnounceRowsCount = (state, count, isLoading) => {
4
+ const useAnnounceRowsCount = (state, count, isLoading, announceCount) => {
5
5
  const { announcePolite } = useLiveLog();
6
6
  const { filterExpression, searchText, personalization: { active: activeView } = {} } = state || {};
7
7
  const translate = useI18n();
8
- const hasSelectionAvailable = count.selected !== undefined;
9
8
  const isFirstRender = useRef(true);
10
9
  useEffect(() => {
11
10
  if (isLoading || count.total === undefined)
12
11
  return;
13
- if (isFirstRender.current) {
14
- // for first render i.e. table load , skip announcing results count.
15
- isFirstRender.current = false;
12
+ /**
13
+ * If announceCount is present, it will override first render behavior.
14
+ * If not, skip the first count announcement and announce any subsequent count updates.
15
+ */
16
+ const canAnnounceRowsCount = announceCount ?? !isFirstRender.current;
17
+ // Capture first render regardless of announceCount value
18
+ isFirstRender.current = false;
19
+ if (!canAnnounceRowsCount) {
16
20
  return;
17
21
  }
18
22
  const timeout = setTimeout(() => {
23
+ const messageKey = count.selected
24
+ ? cosmosTranslatedLiterals.selectedCount
25
+ : cosmosTranslatedLiterals.resultsCount;
26
+ const countValue = count.selected || count.total;
27
+ const totalDisplay = count.totalHasMore ? `${count.total}+` : count.total;
19
28
  announcePolite({
20
- message: translate(hasSelectionAvailable
21
- ? cosmosTranslatedLiterals.selectedCount
22
- : cosmosTranslatedLiterals.resultsCount, [
23
- ...(hasSelectionAvailable ? [count.selected] : []),
24
- count.totalHasMore ? `${count.total}+` : count.total
25
- ], {
26
- count: hasSelectionAvailable ? count.selected : count.total
27
- }),
29
+ message: translate(messageKey, [countValue, totalDisplay], { count: countValue }),
28
30
  type: 'info'
29
31
  });
30
32
  }, 1000);
31
33
  return () => {
32
34
  clearTimeout(timeout);
33
35
  };
34
- }, [count.selected, count.total, filterExpression, searchText, activeView, isLoading]);
36
+ }, [
37
+ count.selected,
38
+ count.total,
39
+ filterExpression,
40
+ searchText,
41
+ activeView,
42
+ isLoading,
43
+ announceCount
44
+ ]);
35
45
  };
36
46
  export default useAnnounceRowsCount;
37
47
  //# sourceMappingURL=useAnnounceRowsCount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAnnounceRowsCount.js","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useAnnounceRowsCount.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,wBAAwB,MAAM,oDAAoD,CAAC;AAE1F,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;IACvD,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,EACJ,gBAAgB,EAChB,UAAU,EACV,eAAe,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,EAC7C,GAAG,KAAK,IAAI,EAAE,CAAC;IAChB,MAAM,SAAS,GAAG,OAAO,EAAE,CAAC;IAC5B,MAAM,qBAAqB,GAAG,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC;IAC3D,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;YAAE,OAAO;QACnD,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;YAC1B,oEAAoE;YACpE,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;YAC9B,OAAO;QACT,CAAC;QACD,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,cAAc,CAAC;gBACb,OAAO,EAAE,SAAS,CAChB,qBAAqB;oBACnB,CAAC,CAAC,wBAAwB,CAAC,aAAa;oBACxC,CAAC,CAAC,wBAAwB,CAAC,YAAY,EACzC;oBACE,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBAClD,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;iBACrD,EACD;oBACE,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;iBAC5D,CACF;gBACD,IAAI,EAAE,MAAM;aACb,CAAC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AACzF,CAAC,CAAC;AACF,eAAe,oBAAoB,CAAC","sourcesContent":["import { useEffect, useRef } from 'react';\n\nimport { useI18n, useLiveLog } from '@pega/cosmos-react-core/lib/hooks';\n\nimport cosmosTranslatedLiterals from '../../../Localization/translateCosmosLiteralsUtils';\n\nconst useAnnounceRowsCount = (state, count, isLoading) => {\n const { announcePolite } = useLiveLog();\n const {\n filterExpression,\n searchText,\n personalization: { active: activeView } = {}\n } = state || {};\n const translate = useI18n();\n const hasSelectionAvailable = count.selected !== undefined;\n const isFirstRender = useRef(true);\n useEffect(() => {\n if (isLoading || count.total === undefined) return;\n if (isFirstRender.current) {\n // for first render i.e. table load , skip announcing results count.\n isFirstRender.current = false;\n return;\n }\n const timeout = setTimeout(() => {\n announcePolite({\n message: translate(\n hasSelectionAvailable\n ? cosmosTranslatedLiterals.selectedCount\n : cosmosTranslatedLiterals.resultsCount,\n [\n ...(hasSelectionAvailable ? [count.selected] : []),\n count.totalHasMore ? `${count.total}+` : count.total\n ],\n {\n count: hasSelectionAvailable ? count.selected : count.total\n }\n ),\n type: 'info'\n });\n }, 1000);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [count.selected, count.total, filterExpression, searchText, activeView, isLoading]);\n};\nexport default useAnnounceRowsCount;\n"]}
1
+ {"version":3,"file":"useAnnounceRowsCount.js","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useAnnounceRowsCount.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,wBAAwB,MAAM,oDAAoD,CAAC;AAE1F,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE;IACtE,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,EACJ,gBAAgB,EAChB,UAAU,EACV,eAAe,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,EAC7C,GAAG,KAAK,IAAI,EAAE,CAAC;IAChB,MAAM,SAAS,GAAG,OAAO,EAAE,CAAC;IAC5B,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAEnC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;YAAE,OAAO;QAEnD;;;WAGG;QACH,MAAM,oBAAoB,GAAG,aAAa,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QAErE,yDAAyD;QACzD,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;QAE9B,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ;gBAC/B,CAAC,CAAC,wBAAwB,CAAC,aAAa;gBACxC,CAAC,CAAC,wBAAwB,CAAC,YAAY,CAAC;YAC1C,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC;YACjD,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;YAE1E,cAAc,CAAC;gBACb,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;gBACjF,IAAI,EAAE,MAAM;aACb,CAAC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE;QACD,KAAK,CAAC,QAAQ;QACd,KAAK,CAAC,KAAK;QACX,gBAAgB;QAChB,UAAU;QACV,UAAU;QACV,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import { useEffect, useRef } from 'react';\n\nimport { useI18n, useLiveLog } from '@pega/cosmos-react-core/lib/hooks';\n\nimport cosmosTranslatedLiterals from '../../../Localization/translateCosmosLiteralsUtils';\n\nconst useAnnounceRowsCount = (state, count, isLoading, announceCount) => {\n const { announcePolite } = useLiveLog();\n const {\n filterExpression,\n searchText,\n personalization: { active: activeView } = {}\n } = state || {};\n const translate = useI18n();\n const isFirstRender = useRef(true);\n\n useEffect(() => {\n if (isLoading || count.total === undefined) return;\n\n /**\n * If announceCount is present, it will override first render behavior.\n * If not, skip the first count announcement and announce any subsequent count updates.\n */\n const canAnnounceRowsCount = announceCount ?? !isFirstRender.current;\n\n // Capture first render regardless of announceCount value\n isFirstRender.current = false;\n\n if (!canAnnounceRowsCount) {\n return;\n }\n\n const timeout = setTimeout(() => {\n const messageKey = count.selected\n ? cosmosTranslatedLiterals.selectedCount\n : cosmosTranslatedLiterals.resultsCount;\n const countValue = count.selected || count.total;\n const totalDisplay = count.totalHasMore ? `${count.total}+` : count.total;\n\n announcePolite({\n message: translate(messageKey, [countValue, totalDisplay], { count: countValue }),\n type: 'info'\n });\n }, 1000);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [\n count.selected,\n count.total,\n filterExpression,\n searchText,\n activeView,\n isLoading,\n announceCount\n ]);\n};\n\nexport default useAnnounceRowsCount;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-react",
3
- "version": "8.0.0-build.58.0",
3
+ "version": "8.0.0-build.58.1",
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.58.0",
18
- "@pega/cosmos-react-core": "8.0.0-build.58.0",
19
- "@pega/cosmos-react-rte": "8.0.0-build.58.0",
20
- "@pega/cosmos-react-work": "8.0.0-build.58.0",
17
+ "@pega/cosmos-react-condition-builder": "8.0.0-build.58.1",
18
+ "@pega/cosmos-react-core": "8.0.0-build.58.1",
19
+ "@pega/cosmos-react-rte": "8.0.0-build.58.1",
20
+ "@pega/cosmos-react-work": "8.0.0-build.58.1",
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.13",
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.58.0",
29
- "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@8.0.0-build.58.0",
28
+ "pega-repeating-structures-core": "npm:@pega/lists-core@8.0.0-build.58.1",
29
+ "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@8.0.0-build.58.1",
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.6.1",
47
47
  "jest-axe": "^8.0.0",
48
- "srs-utils": "8.0.0-build.58.0",
48
+ "srs-utils": "8.0.0-build.58.1",
49
49
  "typescript": "~5.5.4"
50
50
  }
51
51
  }