@pega/lists-react 10.0.0-build.2.12 → 10.0.0-build.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js +2 -2
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +2 -2
- package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
- package/lib/Core/Views/Timeline/index.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/index.js +8 -4
- package/lib/Core/Views/Timeline/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvanceToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":"AAwBA;;
|
|
1
|
+
{"version":3,"file":"AdvanceToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":"AAwBA;;4CA+GC;;;;;;;;;sBAvIqB,YAAY"}
|
|
@@ -20,7 +20,7 @@ import ValidateMessage from './ValidateMessage';
|
|
|
20
20
|
import useFormControlProps from './hooks/useFormControlProps';
|
|
21
21
|
import useWrapAction from './hooks/useWrapAction';
|
|
22
22
|
export default function AdvanceToolbar({ view }) {
|
|
23
|
-
const { selectedRecordsCount, meta: { basicMode, selectionMode, title, showTitle, toolbarActions, allowBulkActions, mapFieldIds } = {}, rows, state, getContext, isLoading, showCount, refreshNotification, type: { forceRefresh }, announceCount, template } = view;
|
|
23
|
+
const { selectedRecordsCount, meta: { basicMode, selectionMode, title, showTitle, headingTag, toolbarActions, allowBulkActions, mapFieldIds } = {}, rows, state, getContext, isLoading, showCount, refreshNotification, type: { forceRefresh }, announceCount, template } = view;
|
|
24
24
|
const { getRequiredDef } = getContext();
|
|
25
25
|
const { validatemessage } = getRequiredDef() || {};
|
|
26
26
|
const { viewSelector, createEditViewContent } = usePersonalization({ view });
|
|
@@ -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: wrapAction }), selectedActionContent, createEditViewContent] }));
|
|
44
|
+
const Toolbar = template === REPEATING_STRUCTURE_TEMPLATES.MAP ? (_jsx(MapToolbar, { locationFieldId: mapFieldIds?.location, name: title, showName: showTitle, headingTag: headingTag, formControlProps: formControlProps, rows: rows, count: count, createNew: createNew, additionalActions: additionalActions })) : (_jsxs(_Fragment, { children: [_jsx(ListToolbar, { name: title, showName: showTitle, headingTag: headingTag, 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,EACT,SAAS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B,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
|
+
{"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,UA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ACzD,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 headingTag,\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 headingTag={headingTag}\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 headingTag={headingTag}\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":"AAWA;;
|
|
1
|
+
{"version":3,"file":"SimpleToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/SimpleToolbar.jsx"],"names":[],"mappings":"AAWA;;4CAiCC;;;;;;;;;sBA5CqB,YAAY"}
|
|
@@ -8,13 +8,13 @@ import ValidateMessage from './ValidateMessage';
|
|
|
8
8
|
import useFormControlProps from './hooks/useFormControlProps';
|
|
9
9
|
import useWrapAction from './hooks/useWrapAction';
|
|
10
10
|
export default function SimpleToolbar({ view }) {
|
|
11
|
-
const { meta: { title, showTitle } = {}, state, getContext, showCount, refreshNotification, type: { forceRefresh } } = view;
|
|
11
|
+
const { meta: { title, showTitle, headingTag } = {}, state, getContext, showCount, refreshNotification, type: { forceRefresh } } = view;
|
|
12
12
|
const { getRequiredDef } = getContext();
|
|
13
13
|
const { validatemessage } = getRequiredDef() || {};
|
|
14
14
|
const count = showCount ? getCount({ view }) : undefined;
|
|
15
15
|
const formControlProps = useFormControlProps(view);
|
|
16
16
|
const wrapAction = useWrapAction(view);
|
|
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 }))] }));
|
|
17
|
+
return (_jsxs(AnnounceRowsCount, { state: state, count: count, children: [_jsx(ValidateMessage, { message: validatemessage, children: _jsx(ListToolbar, { name: title, showName: showTitle, headingTag: headingTag, count: count, formControlProps: formControlProps, wrap: wrapAction }) }), refreshNotification && (_jsx(RefreshBanner, { refreshNotification: refreshNotification, forceRefresh: forceRefresh }))] }));
|
|
18
18
|
}
|
|
19
19
|
SimpleToolbar.propTypes = {
|
|
20
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;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,
|
|
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,M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,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, headingTag } = {},\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 headingTag={headingTag}\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Timeline/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAiGlE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;CACxB;AAED,QAAA,MAAM,QAAQ,GAAI,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Timeline/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAiGlE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;CACxB;AAED,QAAA,MAAM,QAAQ,GAAI,UAAU,iBAAiB,4CAwG5C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -94,11 +94,15 @@ const Timeline = ({ view }) => {
|
|
|
94
94
|
}
|
|
95
95
|
}, [loading, view.type, meta.numberOfRows, rows?.length, visibleGroupHeaders, groupHeaders]);
|
|
96
96
|
useEffect(() => {
|
|
97
|
-
|
|
97
|
+
const rowsLength = rows?.length ?? 0;
|
|
98
|
+
if (rowsLength !== 0 || rowsLength === count.total)
|
|
98
99
|
return;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
if (!loading) {
|
|
101
|
+
setLoading(true);
|
|
102
|
+
const endIndex = calculatePaginationEndIndex(groupHeaders, meta.numberOfRows || INITIAL_DEFAULT_CHUNK_SIZE);
|
|
103
|
+
view.type.onPaginate({ startIndex: 0, endIndex, id: 'rootVirtualiser' });
|
|
104
|
+
}
|
|
105
|
+
}, [view.type, meta.numberOfRows, rows, groupHeaders, count.total, loading]);
|
|
102
106
|
useEffect(() => {
|
|
103
107
|
setHasMore(rows.length !== count.total);
|
|
104
108
|
if (paginationEndIndex <= rows.length + visibleGroupHeaders || rows.length === count.total) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Views/Timeline/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,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OAAO,CACL,KAAC,aAAa,cACZ,MAAC,uBAAuB,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,aAC7D,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,GAAI,EACvB,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,GAAI,EAElD,MAAC,kBAAkB,IACjB,SAAS,EAAC,yBAAyB,EACnC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,aAEV,KAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,IAAI,IAAI,EAAE,EACvB,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EACpB,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,EAC7C,QAAQ,EAAE,QAAQ,EAClB,oBAAoB,EAAE,oBAAoB,kBAC7B,UAAU,EACvB,GAAG,EAAE,GAAG,GACR,EACD,YAAY,IAAI,YAAY,IAAI,CAC/B,KAAC,cAAc,IACb,OAAO,EACL,eAAe,CACb,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,EAC/C,IAAI,CAAC,eAAe,CACrB;gCACC,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC;gCAC/B,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,EAE7B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,KAAK,GACrB,CACH,IACkB,IACG,GACZ,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { useEffect, useCallback, useMemo, useState, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, useFullscreenContext } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\n// TODO remove ts-ignore once Toolbar migrated to TS\n// @ts-ignore\nimport Toolbar from '../../Components/Toolbar';\nimport RenderView from '../../Components/RenderingEngine/RenderView';\nimport getCount from '../../Components/Toolbar/utils/getCount';\nimport { EXTERNAL_FILTERS } from '../../constants';\nimport RsCardWrapper from '../RsCardWrapper';\nimport { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';\nimport EmptyContainer from '../../Components/DefaultComponents/EmptyContainer';\nimport { isFilterApplied } from '../../Utils';\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport TimelineInner from './Timeline';\nimport getActivities from './utils';\n\nconst StyledTimeline = styled(TimelineInner)(({ theme }) => {\n return css`\n flex: 1;\n padding-inline-end: ${theme.base.spacing};\n overflow: auto;\n `;\n});\n\nStyledTimeline.defaultProps = defaultThemeProp;\n\ninterface StyledTimelineContainerProps {\n view: RsCoreTypes.View;\n isFullscreen: boolean;\n}\n\nconst StyledTimelineContainer = styled.div<StyledTimelineContainerProps>(\n ({ view, isFullscreen }) => {\n return css`\n position: relative;\n ${() => generateRSHeightStyles({ view, isFullscreen })}\n `;\n }\n);\n\ninterface StyledRowContainerProps {\n isFullscreen: boolean;\n view: RsCoreTypes.View;\n}\n\nconst StyledRowContainer = styled.div<StyledRowContainerProps>(({ isFullscreen, view }) => {\n const { bodyHeight, totalItemCount } = view;\n return css`\n ${() => generateRSDataContainerHeightStyles()};\n position: relative;\n min-height: auto;\n flex-grow: 0;\n\n /* Adjust height based on number of rows configured */\n height: ${bodyHeight && !isFullscreen ? `${bodyHeight}px` : 'auto'};\n\n ${totalItemCount === 0 &&\n css`\n /* stylelint-disable-next-line unit-allowed-list */\n min-height: 100px;\n height: inherit;\n `}\n `;\n});\n\nconst INITIAL_DEFAULT_CHUNK_SIZE = 40;\nconst APPEND_DEFAULT_CHUNK_SIZE = 25;\n\n/**\n * Calculates the pagination endIndex by walking groups in order.\n * - Collapsed groups: their full row count is always added (rows are loaded but hidden).\n * - Expanded groups: group's row count added up to chunk size limit\n */\nconst calculatePaginationEndIndex = (\n groupHeaders: RsCoreTypes.GroupGenerator[] | undefined,\n chunkSize: number\n): number => {\n if (!groupHeaders?.length) return chunkSize;\n\n let endIndex = 0;\n let remainingBudget = chunkSize;\n\n for (const header of groupHeaders) {\n if (!header.isExpanded) {\n endIndex += header.count ?? 0;\n } else {\n const rowsToLoad = Math.min(remainingBudget, header.count ?? 0);\n endIndex += rowsToLoad;\n remainingBudget -= rowsToLoad;\n if (remainingBudget <= 0) break;\n }\n }\n\n return endIndex;\n};\n\nexport interface TimelineViewProps {\n view: RsCoreTypes.View;\n}\n\nconst Timeline = ({ view }: TimelineViewProps) => {\n const isFullscreen = !!useFullscreenContext()?.[0];\n const [translate] = useTranslate();\n const {\n rows,\n meta = { fieldDefs: [] as RsCoreTypes.FieldDef[], itemKey: '' } as RsCoreTypes.Meta,\n columns,\n groupHeaders,\n state,\n domContainer,\n hasNoRecords,\n type: { toggleGroupExpansion }\n } = view;\n const { filterExpression, externalState, searchText, paginationOptions, groups } = state;\n const ref = useRef<HTMLTableElement>(null);\n const [loading, setLoading] = useState(false);\n const [hasMore, setHasMore] = useState(true);\n\n const count = getCount({ view });\n const visibleGroupHeaders = groupHeaders?.filter(({ isVisible }) => isVisible)?.length ?? 0;\n const paginationEndIndex = paginationOptions?.rootVirtualiser?.endIndex ?? 0;\n\n const onLoadMore = useCallback(() => {\n if (!loading) {\n setLoading(true);\n const endIndex =\n visibleGroupHeaders +\n calculatePaginationEndIndex(\n groupHeaders,\n (rows?.length ?? 0) + (meta.numberOfRows || APPEND_DEFAULT_CHUNK_SIZE)\n );\n view.type.onPaginate({ startIndex: 0, endIndex, id: 'rootVirtualiser' });\n }\n }, [loading, view.type, meta.numberOfRows, rows?.length, visibleGroupHeaders, groupHeaders]);\n\n useEffect(() => {\n if (rows !== undefined && rows.length !== 0) return;\n const endIndex = calculatePaginationEndIndex(\n groupHeaders,\n meta.numberOfRows || INITIAL_DEFAULT_CHUNK_SIZE\n );\n view.type.onPaginate({ startIndex: 0, endIndex, id: 'rootVirtualiser' });\n }, [view.type, meta.numberOfRows, rows, groupHeaders]);\n\n useEffect(() => {\n setHasMore(rows!.length !== count.total);\n if (paginationEndIndex <= rows!.length + visibleGroupHeaders || rows!.length === count.total) {\n setLoading(false);\n }\n }, [count.total, rows!.length, paginationEndIndex, visibleGroupHeaders]);\n\n const activities = useMemo(\n () => getActivities(groupHeaders, columns, meta, groups?.[0]),\n [groupHeaders, columns, meta, groups?.[0]]\n );\n\n let loadMore;\n if (hasMore) {\n loadMore = onLoadMore;\n }\n\n return (\n <RsCardWrapper>\n <StyledTimelineContainer view={view} isFullscreen={isFullscreen}>\n <Toolbar view={view} />\n <RenderView view={view} type={EXTERNAL_FILTERS} />\n\n <StyledRowContainer\n className='container row-container'\n isFullscreen={isFullscreen}\n view={view}\n >\n <StyledTimeline\n activities={activities}\n currentTime={new Date()}\n groupBy={groups?.[0]}\n loading={loading || !rows || !!view.isLoading}\n loadMore={loadMore}\n toggleGroupExpansion={toggleGroupExpansion}\n data-test-id='Timeline'\n ref={ref}\n />\n {domContainer && hasNoRecords && (\n <EmptyContainer\n message={\n isFilterApplied(\n { filterExpression, searchText, externalState },\n meta.externalFilters\n )\n ? translate('No records found')\n : translate('No records')\n }\n domContainer={domContainer}\n shouldAnnounce={false}\n />\n )}\n </StyledRowContainer>\n </StyledTimelineContainer>\n </RsCardWrapper>\n );\n};\n\nexport default Timeline;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Views/Timeline/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAGjF,oDAAoD;AACpD,aAAa;AACb,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAC/C,OAAO,UAAU,MAAM,6CAA6C,CAAC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AU,CAAC;IACxB,CAAC;IAED,OAAO,CACL,KAAC,aAAa,cACZ,MAAC,uBAAuB,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,aAC7D,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,GAAI,EACvB,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,GAAI,EAElD,MAAC,kBAAkB,IACjB,SAAS,EAAC,yBAAyB,EACnC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,aAEV,KAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,IAAI,IAAI,EAAE,EACvB,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EACpB,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,EAC7C,QAAQ,EAAE,QAAQ,EAClB,oBAAoB,EAAE,oBAAoB,kBAC7B,UAAU,EACvB,GAAG,EAAE,GAAG,GACR,EACD,YAAY,IAAI,YAAY,IAAI,CAC/B,KAAC,cAAc,IACb,OAAO,EACL,eAAe,CACb,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,EAC/C,IAAI,CAAC,eAAe,CACrB;gCACC,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC;gCAC/B,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,EAE7B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,KAAK,GACrB,CACH,IACkB,IACG,GACZ,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { useEffect, useCallback, useMemo, useState, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, useFullscreenContext } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\n// TODO remove ts-ignore once Toolbar migrated to TS\n// @ts-ignore\nimport Toolbar from '../../Components/Toolbar';\nimport RenderView from '../../Components/RenderingEngine/RenderView';\nimport getCount from '../../Components/Toolbar/utils/getCount';\nimport { EXTERNAL_FILTERS } from '../../constants';\nimport RsCardWrapper from '../RsCardWrapper';\nimport { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';\nimport EmptyContainer from '../../Components/DefaultComponents/EmptyContainer';\nimport { isFilterApplied } from '../../Utils';\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport TimelineInner from './Timeline';\nimport getActivities from './utils';\n\nconst StyledTimeline = styled(TimelineInner)(({ theme }) => {\n return css`\n flex: 1;\n padding-inline-end: ${theme.base.spacing};\n overflow: auto;\n `;\n});\n\nStyledTimeline.defaultProps = defaultThemeProp;\n\ninterface StyledTimelineContainerProps {\n view: RsCoreTypes.View;\n isFullscreen: boolean;\n}\n\nconst StyledTimelineContainer = styled.div<StyledTimelineContainerProps>(\n ({ view, isFullscreen }) => {\n return css`\n position: relative;\n ${() => generateRSHeightStyles({ view, isFullscreen })}\n `;\n }\n);\n\ninterface StyledRowContainerProps {\n isFullscreen: boolean;\n view: RsCoreTypes.View;\n}\n\nconst StyledRowContainer = styled.div<StyledRowContainerProps>(({ isFullscreen, view }) => {\n const { bodyHeight, totalItemCount } = view;\n return css`\n ${() => generateRSDataContainerHeightStyles()};\n position: relative;\n min-height: auto;\n flex-grow: 0;\n\n /* Adjust height based on number of rows configured */\n height: ${bodyHeight && !isFullscreen ? `${bodyHeight}px` : 'auto'};\n\n ${totalItemCount === 0 &&\n css`\n /* stylelint-disable-next-line unit-allowed-list */\n min-height: 100px;\n height: inherit;\n `}\n `;\n});\n\nconst INITIAL_DEFAULT_CHUNK_SIZE = 40;\nconst APPEND_DEFAULT_CHUNK_SIZE = 25;\n\n/**\n * Calculates the pagination endIndex by walking groups in order.\n * - Collapsed groups: their full row count is always added (rows are loaded but hidden).\n * - Expanded groups: group's row count added up to chunk size limit\n */\nconst calculatePaginationEndIndex = (\n groupHeaders: RsCoreTypes.GroupGenerator[] | undefined,\n chunkSize: number\n): number => {\n if (!groupHeaders?.length) return chunkSize;\n\n let endIndex = 0;\n let remainingBudget = chunkSize;\n\n for (const header of groupHeaders) {\n if (!header.isExpanded) {\n endIndex += header.count ?? 0;\n } else {\n const rowsToLoad = Math.min(remainingBudget, header.count ?? 0);\n endIndex += rowsToLoad;\n remainingBudget -= rowsToLoad;\n if (remainingBudget <= 0) break;\n }\n }\n\n return endIndex;\n};\n\nexport interface TimelineViewProps {\n view: RsCoreTypes.View;\n}\n\nconst Timeline = ({ view }: TimelineViewProps) => {\n const isFullscreen = !!useFullscreenContext()?.[0];\n const [translate] = useTranslate();\n const {\n rows,\n meta = { fieldDefs: [] as RsCoreTypes.FieldDef[], itemKey: '' } as RsCoreTypes.Meta,\n columns,\n groupHeaders,\n state,\n domContainer,\n hasNoRecords,\n type: { toggleGroupExpansion }\n } = view;\n const { filterExpression, externalState, searchText, paginationOptions, groups } = state;\n const ref = useRef<HTMLTableElement>(null);\n const [loading, setLoading] = useState(false);\n const [hasMore, setHasMore] = useState(true);\n\n const count = getCount({ view });\n const visibleGroupHeaders = groupHeaders?.filter(({ isVisible }) => isVisible)?.length ?? 0;\n const paginationEndIndex = paginationOptions?.rootVirtualiser?.endIndex ?? 0;\n\n const onLoadMore = useCallback(() => {\n if (!loading) {\n setLoading(true);\n const endIndex =\n visibleGroupHeaders +\n calculatePaginationEndIndex(\n groupHeaders,\n (rows?.length ?? 0) + (meta.numberOfRows || APPEND_DEFAULT_CHUNK_SIZE)\n );\n view.type.onPaginate({ startIndex: 0, endIndex, id: 'rootVirtualiser' });\n }\n }, [loading, view.type, meta.numberOfRows, rows?.length, visibleGroupHeaders, groupHeaders]);\n\n useEffect(() => {\n const rowsLength = rows?.length ?? 0;\n if (rowsLength !== 0 || rowsLength === count.total) return;\n if (!loading) {\n setLoading(true);\n const endIndex = calculatePaginationEndIndex(\n groupHeaders,\n meta.numberOfRows || INITIAL_DEFAULT_CHUNK_SIZE\n );\n view.type.onPaginate({ startIndex: 0, endIndex, id: 'rootVirtualiser' });\n }\n }, [view.type, meta.numberOfRows, rows, groupHeaders, count.total, loading]);\n\n useEffect(() => {\n setHasMore(rows!.length !== count.total);\n if (paginationEndIndex <= rows!.length + visibleGroupHeaders || rows!.length === count.total) {\n setLoading(false);\n }\n }, [count.total, rows!.length, paginationEndIndex, visibleGroupHeaders]);\n\n const activities = useMemo(\n () => getActivities(groupHeaders, columns, meta, groups?.[0]),\n [groupHeaders, columns, meta, groups?.[0]]\n );\n\n let loadMore;\n if (hasMore) {\n loadMore = onLoadMore;\n }\n\n return (\n <RsCardWrapper>\n <StyledTimelineContainer view={view} isFullscreen={isFullscreen}>\n <Toolbar view={view} />\n <RenderView view={view} type={EXTERNAL_FILTERS} />\n\n <StyledRowContainer\n className='container row-container'\n isFullscreen={isFullscreen}\n view={view}\n >\n <StyledTimeline\n activities={activities}\n currentTime={new Date()}\n groupBy={groups?.[0]}\n loading={loading || !rows || !!view.isLoading}\n loadMore={loadMore}\n toggleGroupExpansion={toggleGroupExpansion}\n data-test-id='Timeline'\n ref={ref}\n />\n {domContainer && hasNoRecords && (\n <EmptyContainer\n message={\n isFilterApplied(\n { filterExpression, searchText, externalState },\n meta.externalFilters\n )\n ? translate('No records found')\n : translate('No records')\n }\n domContainer={domContainer}\n shouldAnnounce={false}\n />\n )}\n </StyledRowContainer>\n </StyledTimelineContainer>\n </RsCardWrapper>\n );\n};\n\nexport default Timeline;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-react",
|
|
3
|
-
"version": "10.0.0-build.2.
|
|
3
|
+
"version": "10.0.0-build.2.14",
|
|
4
4
|
"description": "Repeating view structures such as Table, Gallery(Repeating layouts), Kanban etc.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "10.0.0-build.2.
|
|
18
|
-
"@pega/cosmos-react-core": "10.0.0-build.2.
|
|
19
|
-
"@pega/cosmos-react-rte": "10.0.0-build.2.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "10.0.0-build.2.14",
|
|
18
|
+
"@pega/cosmos-react-core": "10.0.0-build.2.14",
|
|
19
|
+
"@pega/cosmos-react-rte": "10.0.0-build.2.14",
|
|
20
20
|
"@types/lodash-es": "^4.17.12",
|
|
21
21
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
22
22
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
23
23
|
"dayjs": "^1.11.13",
|
|
24
24
|
"fast-deep-equal": "^3.1.3",
|
|
25
25
|
"lodash-es": "^4.18.1",
|
|
26
|
-
"pega-repeating-structures-core": "npm:@pega/lists-core@10.0.0-build.2.
|
|
27
|
-
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@10.0.0-build.2.
|
|
26
|
+
"pega-repeating-structures-core": "npm:@pega/lists-core@10.0.0-build.2.14",
|
|
27
|
+
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@10.0.0-build.2.14",
|
|
28
28
|
"polished": "^4.1.0",
|
|
29
29
|
"prop-types": "^15.8.1",
|
|
30
30
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@testing-library/react": "^16.0.0",
|
|
43
43
|
"@testing-library/user-event": "^14.6.1",
|
|
44
44
|
"jest-axe": "^8.0.0",
|
|
45
|
-
"srs-utils": "10.0.0-build.2.
|
|
45
|
+
"srs-utils": "10.0.0-build.2.14",
|
|
46
46
|
"typescript": "~5.9.3"
|
|
47
47
|
}
|
|
48
48
|
}
|