@pega/lists-core 10.0.0-build.2.13 → 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/src/core/actions/actions.types.d.ts +2 -3
- package/lib/src/core/actions/actions.types.d.ts.map +1 -1
- package/lib/src/core/actions/actions.types.js.map +1 -1
- package/lib/src/core/constants.js +2 -2
- package/lib/src/core/constants.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts +2 -0
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js +5 -1
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.d.ts +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.js +47 -29
- package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.js.map +1 -1
- package/lib/src/core/features/uIFeatures/index.d.ts +1 -1
- package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -61,8 +61,6 @@ export interface ExpandCollapsePayload {
|
|
|
61
61
|
groups?: Group[];
|
|
62
62
|
}
|
|
63
63
|
export interface MoveRecordKeysUpdatePayload {
|
|
64
|
-
sourceID?: string;
|
|
65
|
-
destinationID?: string;
|
|
66
64
|
sourceKey?: string;
|
|
67
65
|
destinationKey?: string;
|
|
68
66
|
}
|
|
@@ -201,7 +199,8 @@ declare const objectActions: {
|
|
|
201
199
|
type: "columnResize";
|
|
202
200
|
payload: {
|
|
203
201
|
data: {
|
|
204
|
-
[column.field.
|
|
202
|
+
[column.field.
|
|
203
|
+
id]: number;
|
|
205
204
|
};
|
|
206
205
|
};
|
|
207
206
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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B,GAC3B,2BAA2B,GAC3B,yBAAyB,GACzB,8BAA8B,GAC9B,kCAAkC,GAClC,+BAA+B,GAC/B,2BAA2B,GAC3B,6BAA6B,GAC7B,mCAAmC,GACnC,yBAAyB,CAAC;AAI9B,MAAM,MAAM,gBAAgB,GAAG,4BAA4B,CAAC;AAG5D,QAAA,MAA+B,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA1DxB,CAAM,MAAM,CAAC,KAAK;oBACtC,EAAC,CACD;;;;;;;;;;;;;;;kBAsBa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAwCwxD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAN/uD,CAAC;AACzD,MAAM,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,aAAa,CAAC,GAAG,kBAAkB,CAAC;AAInF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.types.js","sourceRoot":"","sources":["../../../../src/core/actions/actions.types.ts"],"names":[],"mappings":"AAQA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.types.js","sourceRoot":"","sources":["../../../../src/core/actions/actions.types.ts"],"names":[],"mappings":"AAQA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AA6LrC,2EAA2E;AAC3E,MAAM,EAAE,kBAAkB,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC","sourcesContent":["import type { FieldDef, Meta } from '../../../types/Meta.types';\nimport type { AggregationType, Group, Sort, State } from '../../../types/State.types';\nimport type { STATE } from '../constants';\nimport type { FeatureProps } from '../features/featureFactory';\nimport type Column from '../generators/ColumnGenerator';\nimport type { RowData } from '../generators/RowGenerator.types';\nimport type View from '../generators/ViewGenerator';\n\nimport ActionTypes from './actionConstants';\nimport * as Actions from './actions';\n\n/** A Type function utility that accepts an object of methods and returns a union of return type of all the methods. Used in case of actions functions. */\ntype GenerateActionType<T extends { [key: string]: (...args: any[]) => any }> = {\n [K in keyof T]: ReturnType<T[K]>;\n}[keyof T];\n\nexport interface ActionMeta {\n /**\n * Instantly dispatches a render by calling the external store reference's dispatch method.\n * This action bypasses the usual waiting for actions, features, or side effects to complete.\n */\n instantRender?: boolean;\n /** Indicates to skip the action queue and directly call reducer. */\n skipActionQueue?: boolean;\n /** Indicates to take latest action from the action queue if multiple actions of same type are present. */\n takeLatestAction?: boolean;\n}\n\nexport interface ColumnFilteringActionPayload {\n filterExp: NonNullable<State['filterExpression']>;\n}\n\nexport interface ApplyAliasesActionPayload {\n aliases: NonNullable<State['columnAlias']>;\n}\nexport interface ColumnSortPayload {\n id: FieldDef['id'];\n flushState: boolean;\n sortOrderId: Sort['order'];\n}\n\nexport interface PaginationPayload {\n id: string;\n startIndex: number;\n endIndex: number;\n}\n\nexport interface PaginateAction extends ActionMeta {\n payload: PaginationPayload;\n type: typeof ActionTypes.PAGINATE;\n}\n\nexport interface ColumnResizePayload {\n data: { [fieldId: string]: number };\n}\n\nexport interface ColumnDragDropAction {\n payload: {\n sourceColId: string;\n targetColId: string;\n };\n type: typeof ActionTypes.COLUMN_DRAG_DROP;\n}\n\nexport interface ExpandCollapsePayload {\n groupHeader?: NonNullable<View['groupHeaders']>[number];\n groups?: Group[];\n}\n\nexport interface MoveRecordKeysUpdatePayload {\n sourceKey?: string;\n destinationKey?: string;\n}\n\nexport interface RowSelectionUpdatePayload {\n key: string;\n selected: boolean;\n data: RowData;\n status: typeof STATE.NOT_STARTED;\n mode: Meta['selectionMode'];\n}\n\nexport interface RowSelectionItemsUpdatePayload {\n selectedRows: string[];\n mode: NonNullable<Meta['selectionMode']>;\n}\n\nexport interface UpdateRowSelectionStatusPayload {\n keys: string[];\n status: typeof STATE.IN_PROGRESS;\n mode: NonNullable<Meta['selectionMode']>;\n}\n\nexport type SearchGlobalActionAsFunction = (\n dispatch: FeatureProps['dispatch'],\n getState: FeatureProps['getState'],\n meta: Meta\n) => void;\n\nexport interface SearchGlobalAction {\n type: typeof ActionTypes.SEARCH;\n payload: { query: string; fields: string[] };\n}\n\nexport interface MergeColumnsPayload {\n sourceId: string;\n targetId: string;\n title: string;\n templateName: string;\n bHideColumns: boolean;\n uniqueID: string;\n hideColumns?: [string, string];\n}\n\nexport interface DeleteCustomColumnPayload {\n columnId: FieldDef['id'] | FieldDef['id'][];\n}\n\n// cSpell:disable-next-line\nexport type SanitizableProperties = Pick<\n State,\n | 'sortingOrder'\n | 'freezeColumns'\n | 'hiddenColumns'\n | 'columnWidths'\n | 'colOrder'\n | 'aggregationInfo'\n | 'groups'\n | 'customFields'\n | 'filterExpression'\n | 'hierarchicalGroup'\n | 'renderFormatter'\n | 'visibleColumns'\n>;\nexport interface UpdateAggregationPayload {\n columnId: FieldDef['id'];\n type: AggregationType;\n}\n\nexport interface UpdateRenderFormatterPayload {\n columnId: FieldDef['id'];\n formatter: Column['formatterConfig'];\n}\n\nexport interface RemoveRenderFormatterPayload {\n columnId: FieldDef['id'];\n}\n\nexport interface ChangeLabelActionPayload {\n columnId: FieldDef['id'];\n label: Column['label'];\n}\n\nexport interface SubmitChangeSetPayload {\n key: string;\n name: string;\n newValue: string | number | Date | boolean;\n oldValue: string | number | Date | boolean;\n status: string;\n}\n\n// Personalization Actions.\nexport type PersonalizationCreateAction = ReturnType<typeof Actions.actionPersonalizationCreate>;\nexport type PersonalizationDeleteAction = ReturnType<typeof Actions.actionPersonalizationDelete>;\nexport type PersonalizationEditAction = ReturnType<typeof Actions.actionPersonalizationEdit>;\nexport type PersonalizationSetActiveAction = ReturnType<\n typeof Actions.actionPersonalizationSetActive\n>;\nexport type PersonalizationSetAppDefaultAction = ReturnType<\n typeof Actions.actionPersonalizationSetAppDefault\n>;\nexport type PersonalizationSetDefaultAction = ReturnType<\n typeof Actions.actionPersonalizationSetDefault\n>;\nexport type PersonalizationUpdateAction = ReturnType<typeof Actions.actionPersonalizationUpdate>;\nexport type PersonalizationUpdateIdAction = ReturnType<\n typeof Actions.actionPersonalizationUpdateId\n>;\nexport type PersonalizationUpdatePresetIdAction = ReturnType<\n typeof Actions.actionPersonalizationUpdatePresetId\n>;\nexport type GetPersonalizationsAction = ReturnType<typeof Actions.actionGetPersonalizations>;\nexport type PersonalizationActions =\n | PersonalizationCreateAction\n | PersonalizationDeleteAction\n | PersonalizationEditAction\n | PersonalizationSetActiveAction\n | PersonalizationSetAppDefaultAction\n | PersonalizationSetDefaultAction\n | PersonalizationUpdateAction\n | PersonalizationUpdateIdAction\n | PersonalizationUpdatePresetIdAction\n | GetPersonalizationsAction;\n\n// TODO: Remove Action as function.The logic for Search global action function can be move to reducer.\n// Needs further refactor, but it is required to remove the Actions as function usecase in reducer.\nexport type ActionAsFunction = SearchGlobalActionAsFunction;\n\n// All Actions of type object with signature {type: TYPE: payload: PAYLOAD}\nconst { actionSearchGlobal, ...objectActions } = Actions;\nexport type Action = GenerateActionType<typeof objectActions> | SearchGlobalAction;\n\n// Generic Action that represents Actions as object and Action as function.\n// TODO Action as function should be removed, only one use case is present as of today which can be migrated to Action as object.\nexport type BaseAction = Action | ActionAsFunction;\n"]}
|
|
@@ -110,8 +110,8 @@ export const SUPPORTED_FLUSH_KEYS = [
|
|
|
110
110
|
'filterExpression',
|
|
111
111
|
'search',
|
|
112
112
|
'selectedRows',
|
|
113
|
-
'
|
|
114
|
-
'
|
|
113
|
+
'sourceKey',
|
|
114
|
+
'destinationKey'
|
|
115
115
|
];
|
|
116
116
|
export const SUPPORTED_AVOIDABLE_FEATURES = ['rowAnimation', 'columnAnimation'];
|
|
117
117
|
// FIXME: this should be injectable in core
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAiB,MAAM,wBAAwB,CAAC;AAIrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,MAAM,aAAa,GAAsB;IACvC,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,KAAK;IACf,oEAAoE;IACpE,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,KAAK;IAClB,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,KAAK;IACf,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,KAAK;IAClB,aAAa,EAAE,KAAK;IACpB,kBAAkB,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC;CAC3D,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAG5B;IACF,KAAK,EAAE;QACL,IAAI,EAAE,SAAS,CAAC,iBAAiB;QACjC,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,eAAe;QAC7B,EAAE,EAAE,eAAe;QACnB,GAAG,aAAa;QAChB,MAAM,EAAE,KAAK;KACd;IACD,OA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EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,EAAE;IACxD,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,EAAE;IACzD,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE;IAC1D,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,EAAE;IACT,sLAAsL;IACtL,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB,CAAC,KAAK,CAAC,EAAE;IAC5B,qBAAqB,CAAC,KAAK,CAAC,EAAE;IAC9B,mBAAmB,CAAC,KAAK,CAAC,EAAE;IAC5B,mBAAmB,CAAC,KAAK,CAAC,EAAE;CAC7B,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport { cellUpdateTrigger, FieldType, type FieldDef } from '../../types/Meta.types';\n\nimport type { ColumnConfig } from './generators/ColumnGenerator.types';\n\nexport const nonPersonalizationViewKey = 'nonPersonalizationViewKey';\nexport const defaultPresetIdIndex = 0;\nexport const EXTERNAL_FILTERS = 'externalFilters';\nexport const ACTION_FIELD_TYPE = 'action';\n\nconst ootbFieldMeta: Partial<FieldDef> = {\n resize: false,\n filter: false,\n sort: false,\n autosize: false,\n // Added freeze: true for OOTB columns to ensure state sanitization.\n freeze: true,\n aggregation: false,\n toggle: false,\n grouping: false,\n customizeColumn: false,\n combineColumn: false,\n showMenu: false,\n noContextMenu: true,\n showTooltip: false,\n reorderFields: false,\n cellUpdateTriggers: [cellUpdateTrigger.ROW_DENSITY_CHANGE]\n};\n\nexport const rowActionColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowActionMenu',\n label: 'Actions',\n cellRenderer: 'RowActionMenu',\n id: 'RowActionMenu',\n ...ootbFieldMeta,\n freeze: false\n },\n options: {\n classList: ['cell-action']\n }\n};\n\nexport const rowSelectColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowSelect',\n label: 'Select',\n cellRenderer: 'RowSelectHandle',\n id: 'RowSelect',\n headerCellRenderer: 'selectAllCheckboxRenderer',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-select-handle'],\n label: 'Select'\n }\n};\n\nexport const rowDragDropColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowDragDrop',\n label: 'Reorder',\n cellRenderer: 'RowDragDropHandle',\n id: 'RowDragDrop',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-reorder-handle']\n }\n};\n\nexport const rowErrorColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowError',\n label: 'Error',\n cellRenderer: 'RowError',\n id: 'RowError',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-error-column']\n }\n};\n\nexport const rowDeleteColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowDeleteAction',\n label: 'Delete',\n cellRenderer: 'RowDeleteAction',\n id: 'RowDeleteAction',\n ...ootbFieldMeta,\n freeze: false\n },\n options: {\n classList: ['cell-action']\n }\n};\n\nexport const UNSUPPORTED_HEADER_ICON_FIELD_TYPES = [ACTION_FIELD_TYPE];\n\nexport const RICH_TEXT = 'RichText';\n\nexport const STATE = {\n NOT_STARTED: 'NOT_STARTED',\n IN_PROGRESS: 'IN_PROGRESS',\n FAILED: 'FAILED'\n};\n\nexport const SELECTION_MODES = {\n single: 'single',\n multi: 'multi',\n multi_on_hover: 'multi_on_hover'\n};\nexport const SUPPORTED_MODES_FOR_SELECTALL = [\n SELECTION_MODES.multi_on_hover,\n SELECTION_MODES.multi\n];\n\nexport const SUPPORTED_FLUSH_KEYS = [\n 'filterExpression',\n 'search',\n 'selectedRows',\n 'sourceKey',\n 'destinationKey'\n];\nexport const SUPPORTED_AVOIDABLE_FEATURES = ['rowAnimation', 'columnAnimation'];\n\n// FIXME: this should be injectable in core\nexport const rowDensityClasses: {\n [key: number]: { id: string; className: string; rowHeight?: number };\n} = {\n 1: { id: '1', className: 'short-height', rowHeight: 25 },\n 2: { id: '2', className: 'medium-height', rowHeight: 35 },\n 3: { id: '3', className: 'tall-height', rowHeight: 45.04 },\n 4: { id: '4', className: 'wrap-content-height' }\n};\n\nexport const TEMPLATES = {\n GALLERY: 'Gallery',\n TABLE: 'Table',\n TIMELINE: 'Timeline'\n};\n\nexport const DEFAULT_FORMAT = 'Default';\nexport const expandCollapseAllMeta = {\n width: 32,\n // TODO: RsCore should take this as part of contract. It wil be fixed, after setting up css classes contract OR go with some other approach if accepting CSS classes is not an option.\n selector: '.expand-collapse-all'\n};\nexport const NON_DRAGGABLE_COLUMNS = [\n rowSelectColumnMeta.field.id,\n rowDragDropColumnMeta.field.id,\n rowActionColumnMeta.field.id,\n rowDeleteColumnMeta.field.id\n];\n"]}
|
|
@@ -11,6 +11,8 @@ import type { BeforeRenderFeatureProps } from '../../featureFactory';
|
|
|
11
11
|
* - {@link State.aggregationInfo}
|
|
12
12
|
* - {@link State.refresh}
|
|
13
13
|
* - {@link State.visibleColumns}
|
|
14
|
+
* - {@link State.sourceKey}
|
|
15
|
+
* - {@link State.destinationKey}
|
|
14
16
|
*
|
|
15
17
|
* `isLoading` is reset on publish of `AFTER_FETCH` event.
|
|
16
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"busyIndicator.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/busyIndicator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA+BrE
|
|
1
|
+
{"version":3,"file":"busyIndicator.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/busyIndicator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA+BrE;;;;;;;;;;;;;;;GAeG;yBACa,YAAY,UAAU,MAGZ,cAAc,wBAAwB;AAHhE,wBAqBE"}
|
|
@@ -35,6 +35,8 @@ const busyIndicator = ([{ getRsStore, getView, dispatch }]) => {
|
|
|
35
35
|
* - {@link State.aggregationInfo}
|
|
36
36
|
* - {@link State.refresh}
|
|
37
37
|
* - {@link State.visibleColumns}
|
|
38
|
+
* - {@link State.sourceKey}
|
|
39
|
+
* - {@link State.destinationKey}
|
|
38
40
|
*
|
|
39
41
|
* `isLoading` is reset on publish of `AFTER_FETCH` event.
|
|
40
42
|
*/
|
|
@@ -51,7 +53,9 @@ export default (rsInternal) => {
|
|
|
51
53
|
state.groups,
|
|
52
54
|
state.aggregationInfo,
|
|
53
55
|
state.refresh,
|
|
54
|
-
state.visibleColumns
|
|
56
|
+
state.visibleColumns,
|
|
57
|
+
state.sourceKey,
|
|
58
|
+
state.destinationKey
|
|
55
59
|
]);
|
|
56
60
|
};
|
|
57
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"busyIndicator.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/busyIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAM7D,SAAS,kBAAkB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAc;IACjF,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC1C,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC/B,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QACzC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAClC,IAAI,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YACtC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,CAExD,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,mIAAmI;IACnI,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACzC,OAAO,CAAC,kBAAkB,GAAG,UAAU,CAAC,GAAG,EAAE;QAC3C,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YACrC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"busyIndicator.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/busyIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAM7D,SAAS,kBAAkB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAc;IACjF,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC1C,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC/B,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QACzC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAClC,IAAI,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YACtC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,CAExD,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,mIAAmI;IACnI,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACzC,OAAO,CAAC,kBAAkB,GAAG,UAAU,CAAC,GAAG,EAAE;QAC3C,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YACrC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAe,CAAC,UAAsB,EAAE,EAAE;IACxC,MAAM,qBAAqB,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;IAC7D,UAAU,CAAC,cAAc,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;IAC9F,OAAO,SAAS,OAAO,CAAC,YAAsC;QAC5D,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACtC,qBAAqB,CACnB,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM,EAAE,KAAK;YACnB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,WAAW;YACjB,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,eAAe;YACrB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,cAAc;YACpB,KAAK,CAAC,SAAS;YACf,KAAK,CAAC,cAAc;SACrB,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { withMemoization } from '../../../utils/util';\nimport { AFTER_FETCH } from '../../../pubSub/events';\nimport { actionForceUpdate } from '../../../actions/actions';\nimport type RsInternal from '../../../RsInternal';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../../../types/State.types';\n\nfunction closeBusyIndicator({ getRsStore, getView, getRsStateResolver }: RsInternal) {\n const rsStore = getRsStore();\n const { dispatch } = getRsStateResolver();\n if (rsStore.busyIndicatorTimer) {\n clearTimeout(rsStore.busyIndicatorTimer);\n rsStore.busyIndicatorTimer = null;\n if (getView().isLoading) {\n getView().setProp('isLoading', false);\n dispatch(actionForceUpdate());\n }\n }\n}\n\nconst busyIndicator = ([{ getRsStore, getView, dispatch }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const rsStore = getRsStore();\n // @ts-expect-error clearTimeout expects either number or undefined but `rsStore.busyIndicatorTimer` is set to null too on line 12.\n clearTimeout(rsStore.busyIndicatorTimer);\n rsStore.busyIndicatorTimer = setTimeout(() => {\n if (!getView().isLoading) {\n getView().setProp('isLoading', true);\n dispatch(actionForceUpdate());\n }\n }, 1000);\n};\n\n/**\n * Toggles {@link View.isLoading isLoading} flag in the `View`.\n *\n * `isLoading` is set to true(if not already), when any of the following properties is changed:\n * - {@link State.filterExpression}\n * - `query` in {@link State.search}\n * - {@link State.groupToggle}\n * - {@link State.groups}\n * - {@link State.aggregationInfo}\n * - {@link State.refresh}\n * - {@link State.visibleColumns}\n * - {@link State.sourceKey}\n * - {@link State.destinationKey}\n *\n * `isLoading` is reset on publish of `AFTER_FETCH` event.\n */\nexport default (rsInternal: RsInternal) => {\n const memoizedBusyIndicator = withMemoization(busyIndicator);\n rsInternal.getPubSubUtils().subscribe(AFTER_FETCH, closeBusyIndicator.bind(null, rsInternal));\n return function execute(featureProps: BeforeRenderFeatureProps) {\n const state = featureProps.getState();\n memoizedBusyIndicator(\n [featureProps],\n [\n state.filterExpression,\n state.search?.query,\n state.sortingOrder,\n state.groupToggle,\n state.groups,\n state.aggregationInfo,\n state.refresh,\n state.visibleColumns,\n state.sourceKey,\n state.destinationKey\n ]\n );\n };\n};\n"]}
|
|
@@ -2,6 +2,6 @@ import type { BeforeRenderFeatureProps } from '../../featureFactory';
|
|
|
2
2
|
/**
|
|
3
3
|
* Moves the rows within view {@link View.data data} and calls {@link ApiContext.moveListRecords moveListRecords} api when {@link State.sourceKey sourceKey} or {@link State.destinationKey destinationKey} is changed in the `State`.
|
|
4
4
|
*/
|
|
5
|
-
declare const _default: () => (featureProps: BeforeRenderFeatureProps) =>
|
|
5
|
+
declare const _default: () => (featureProps: BeforeRenderFeatureProps) => Promise<void>;
|
|
6
6
|
export default _default;
|
|
7
7
|
//# sourceMappingURL=moveListRecords.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moveListRecords.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/moveListRecords.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"moveListRecords.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/moveListRecords.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA2FrE;;GAEG;+BAG6B,cAAc,wBAAwB;AAFtE,wBAME"}
|
|
@@ -1,48 +1,55 @@
|
|
|
1
1
|
import { withMemoization } from '../../../utils/util';
|
|
2
|
-
import { actionMoveRecordKeysUpdate } from '../../../actions/actions';
|
|
2
|
+
import { actionForceUpdate, actionMoveRecordKeysUpdate } from '../../../actions/actions';
|
|
3
3
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
4
|
-
function
|
|
5
|
-
let
|
|
4
|
+
function moveRecordsLocally(records, source, destination) {
|
|
5
|
+
let reorderedRecords;
|
|
6
6
|
if (source < destination) {
|
|
7
|
-
|
|
8
|
-
...
|
|
9
|
-
...
|
|
10
|
-
|
|
11
|
-
...
|
|
7
|
+
reorderedRecords = [
|
|
8
|
+
...records.slice(0, source),
|
|
9
|
+
...records.slice(source + 1, destination + 1),
|
|
10
|
+
records[source],
|
|
11
|
+
...records.slice(destination + 1, records.length)
|
|
12
12
|
];
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
|
-
|
|
16
|
-
...
|
|
17
|
-
|
|
18
|
-
...
|
|
19
|
-
...
|
|
15
|
+
reorderedRecords = [
|
|
16
|
+
...records.slice(0, destination),
|
|
17
|
+
records[source],
|
|
18
|
+
...records.slice(destination, source),
|
|
19
|
+
...records.slice(source + 1, records.length)
|
|
20
20
|
];
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
return reorderedRecords;
|
|
23
23
|
}
|
|
24
24
|
async function moveRecords([{ getView, getState, getRsProps, dispatch }]) {
|
|
25
25
|
if (!getView().meta.moveListRecords) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const { sourceKey
|
|
28
|
+
const { sourceKey, destinationKey } = getState();
|
|
29
29
|
const { apiContext } = getRsProps();
|
|
30
|
+
const currentData = getView().data;
|
|
31
|
+
const previousData = currentData;
|
|
32
|
+
const previousRows = getView().rows;
|
|
30
33
|
try {
|
|
31
|
-
if (!
|
|
34
|
+
if (!sourceKey || !destinationKey || !currentData) {
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
37
|
// FIXME: why there is a dependency on pzInskey?
|
|
35
|
-
const sourceIndex =
|
|
36
|
-
const destinationIndex =
|
|
38
|
+
const sourceIndex = currentData.findIndex(row => row.pzInsKey === sourceKey);
|
|
39
|
+
const destinationIndex = currentData.findIndex(row => row.pzInsKey === destinationKey);
|
|
37
40
|
// check if source & destination records are from current view's list data.
|
|
38
41
|
if (sourceIndex === -1 || destinationIndex === -1) {
|
|
39
42
|
return;
|
|
40
43
|
}
|
|
41
|
-
//
|
|
42
|
-
|
|
44
|
+
// Optimistically move data and rows, then render immediately so the user sees the reorder while the api runs.
|
|
45
|
+
getView().setProp({
|
|
46
|
+
data: moveRecordsLocally(currentData, sourceIndex, destinationIndex),
|
|
47
|
+
...(previousRows && { rows: moveRecordsLocally(previousRows, sourceIndex, destinationIndex) })
|
|
48
|
+
});
|
|
49
|
+
dispatch(actionForceUpdate());
|
|
43
50
|
const dataToSubmit = {
|
|
44
|
-
sourceID,
|
|
45
|
-
destinationID
|
|
51
|
+
sourceID: sourceKey,
|
|
52
|
+
destinationID: destinationKey
|
|
46
53
|
};
|
|
47
54
|
// invoke moveListRecords context api
|
|
48
55
|
if (!apiContext.moveListRecords) {
|
|
@@ -50,16 +57,28 @@ async function moveRecords([{ getView, getState, getRsProps, dispatch }]) {
|
|
|
50
57
|
}
|
|
51
58
|
const { refresh = false } = await apiContext.moveListRecords(dataToSubmit);
|
|
52
59
|
if (refresh) {
|
|
53
|
-
getView().type.forceRefresh({
|
|
60
|
+
getView().type.forceRefresh({ sourceKey: true, destinationKey: true });
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
// Restore the shared View; the key-reset action in finally publishes this rollback.
|
|
64
|
+
getView().setProp({
|
|
65
|
+
data: previousData,
|
|
66
|
+
...(previousRows && { rows: previousRows })
|
|
67
|
+
});
|
|
54
68
|
}
|
|
55
69
|
}
|
|
56
70
|
catch (err) {
|
|
71
|
+
// Restore the shared View; the key-reset action in finally publishes this rollback.
|
|
72
|
+
getView().setProp({
|
|
73
|
+
data: previousData,
|
|
74
|
+
...(previousRows && { rows: previousRows })
|
|
75
|
+
});
|
|
57
76
|
// eslint-disable-next-line no-console
|
|
58
77
|
console.log('Move list error:', err);
|
|
59
78
|
}
|
|
60
79
|
finally {
|
|
61
|
-
// clean
|
|
62
|
-
dispatch(actionMoveRecordKeysUpdate({
|
|
80
|
+
// clean sourceKey and destinationKey state
|
|
81
|
+
dispatch(actionMoveRecordKeysUpdate({ sourceKey: '', destinationKey: '' }));
|
|
63
82
|
}
|
|
64
83
|
}
|
|
65
84
|
/**
|
|
@@ -67,10 +86,9 @@ async function moveRecords([{ getView, getState, getRsProps, dispatch }]) {
|
|
|
67
86
|
*/
|
|
68
87
|
export default () => {
|
|
69
88
|
const memoizedMoveRecords = withMemoization(moveRecords);
|
|
70
|
-
return function execute(featureProps) {
|
|
71
|
-
const { sourceKey
|
|
72
|
-
memoizedMoveRecords([featureProps], [
|
|
73
|
-
return undefined;
|
|
89
|
+
return async function execute(featureProps) {
|
|
90
|
+
const { sourceKey, destinationKey } = featureProps.getState();
|
|
91
|
+
await memoizedMoveRecords([featureProps], [sourceKey, destinationKey]);
|
|
74
92
|
};
|
|
75
93
|
};
|
|
76
94
|
//# sourceMappingURL=moveListRecords.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moveListRecords.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/moveListRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"moveListRecords.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/moveListRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAMzF,qDAAqD;AAErD,SAAS,kBAAkB,CAAI,OAAY,EAAE,MAAc,EAAE,WAAmB;IAC9E,IAAI,gBAAqB,CAAC;IAC1B,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;QACzB,gBAAgB,GAAG;YACjB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC;YAC3B,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC;YAC7C,OAAO,CAAC,MAAM,CAAC;YACf,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;SAClD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,gBAAgB,GAAG;YACjB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC;YAChC,OAAO,CAAC,MAAM,CAAC;YACf,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC;YACrC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;SAC7C,CAAC;IACJ,CAAC;IAC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AU,OAAO,CAAC,YAAsC;QAClE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC9D,MAAM,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { withMemoization } from '../../../utils/util';\nimport { actionForceUpdate, actionMoveRecordKeysUpdate } from '../../../actions/actions';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { State } from '../../../../../types/State.types';\nimport type View from '../../../generators/ViewGenerator';\nimport type { ApiContext } from '../../../../../types/ApiContext.types';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nfunction moveRecordsLocally<T>(records: T[], source: number, destination: number): T[] {\n let reorderedRecords: T[];\n if (source < destination) {\n reorderedRecords = [\n ...records.slice(0, source),\n ...records.slice(source + 1, destination + 1),\n records[source],\n ...records.slice(destination + 1, records.length)\n ];\n } else {\n reorderedRecords = [\n ...records.slice(0, destination),\n records[source],\n ...records.slice(destination, source),\n ...records.slice(source + 1, records.length)\n ];\n }\n return reorderedRecords;\n}\n\nasync function moveRecords([{ getView, getState, getRsProps, dispatch }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n if (!getView().meta.moveListRecords) {\n return;\n }\n const { sourceKey, destinationKey } = getState();\n const { apiContext } = getRsProps();\n const currentData = getView().data;\n const previousData = currentData;\n const previousRows = getView().rows;\n try {\n if (!sourceKey || !destinationKey || !currentData) {\n return;\n }\n // FIXME: why there is a dependency on pzInskey?\n const sourceIndex = currentData.findIndex(row => row.pzInsKey === sourceKey);\n const destinationIndex = currentData.findIndex(row => row.pzInsKey === destinationKey);\n\n // check if source & destination records are from current view's list data.\n if (sourceIndex === -1 || destinationIndex === -1) {\n return;\n }\n\n // Optimistically move data and rows, then render immediately so the user sees the reorder while the api runs.\n getView().setProp({\n data: moveRecordsLocally(currentData, sourceIndex, destinationIndex),\n ...(previousRows && { rows: moveRecordsLocally(previousRows, sourceIndex, destinationIndex) })\n });\n dispatch(actionForceUpdate());\n\n const dataToSubmit = {\n sourceID: sourceKey,\n destinationID: destinationKey\n };\n // invoke moveListRecords context api\n if (!apiContext.moveListRecords) {\n throw Error('moveListRecords api is not defined in the apiContext prop passed.');\n }\n const { refresh = false } = await apiContext.moveListRecords(dataToSubmit);\n\n if (refresh) {\n getView().type.forceRefresh({ sourceKey: true, destinationKey: true });\n } else {\n // Restore the shared View; the key-reset action in finally publishes this rollback.\n getView().setProp({\n data: previousData,\n ...(previousRows && { rows: previousRows })\n });\n }\n } catch (err) {\n // Restore the shared View; the key-reset action in finally publishes this rollback.\n getView().setProp({\n data: previousData,\n ...(previousRows && { rows: previousRows })\n });\n // eslint-disable-next-line no-console\n console.log('Move list error:', err);\n } finally {\n // clean sourceKey and destinationKey state\n dispatch(actionMoveRecordKeysUpdate({ sourceKey: '', destinationKey: '' }));\n }\n}\n\n/**\n * Moves the rows within view {@link View.data data} and calls {@link ApiContext.moveListRecords moveListRecords} api when {@link State.sourceKey sourceKey} or {@link State.destinationKey destinationKey} is changed in the `State`.\n */\nexport default () => {\n const memoizedMoveRecords = withMemoization(moveRecords);\n return async function execute(featureProps: BeforeRenderFeatureProps) {\n const { sourceKey, destinationKey } = featureProps.getState();\n await memoizedMoveRecords([featureProps], [sourceKey, destinationKey]);\n };\n};\n"]}
|
|
@@ -31,7 +31,7 @@ declare const _default: {
|
|
|
31
31
|
changeTemplate: () => (featureProps: import("../featureFactory").BeforeRenderFeatureProps) => void;
|
|
32
32
|
rowDragDrop: (rsInternal: import("../../RsInternal").default) => (featureProps: import("../featureFactory").BeforeRenderFeatureProps) => void;
|
|
33
33
|
rowSelect: (rsInternal: import("../../RsInternal").default) => (featureProps: import("../featureFactory").BeforeRenderFeatureProps) => Promise<void>;
|
|
34
|
-
moveRecords: () => (featureProps: import("../featureFactory").BeforeRenderFeatureProps) =>
|
|
34
|
+
moveRecords: () => (featureProps: import("../featureFactory").BeforeRenderFeatureProps) => Promise<void>;
|
|
35
35
|
renderHeader: () => (featureProps: import("../featureFactory").BeforeRenderFeatureProps) => void;
|
|
36
36
|
refresh: (rsInternal: import("../../RsInternal").default) => (featureProps: import("../featureFactory").BeforeRenderFeatureProps) => void;
|
|
37
37
|
resetFetch: () => (featureProps: import("../featureFactory").BeforeRenderFeatureProps) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/features/uIFeatures/index.ts"],"names":[],"mappings":"AAsCA,OAAO,WAAW,MAAM,4BAA4B,CAAC;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/features/uIFeatures/index.ts"],"names":[],"mappings":"AAsCA,OAAO,WAAW,MAAM,4BAA4B,CAAC;;;4EAFnD,kEAAsC;6BApBnC,kEAAsC;6BAuE01G,kEAAsC;uBARr6G,kEAEM;;0BA3DwC,kEAChB;;uBAYF,kEACR;6BAmD2mC,kEAAsC;;4BAzDvnC,kEACpC;8BAwD4wM,kEAAsC;kCAzB9zM,kEAEH;6BAvCgC,kEAChB;2BAGgB,kEAC5B;2EAyDu0D,kEAAsC;yCA9Cn2D,kEAEG;+BA4C+qL,kEAAsC;4BAnDrsL,kEACd;kCAkD+4T,kEAAsC;;6EAA/1L,kEAAsC;gCA7D9mI,kEACpB;kCAR2C,kEAC1C;4BAmEmF,kEAAsC;kCAlEjH,kEAAsC;sCAQ/B,kEAC7B;+BADwD,kEAC5B;0EAyDg1P,kEAAsC;wEAA78I,kEAAsC;4BAA13F,kEAAsC;6BA5E1lB,kEAC5B;sEAwBU,kEACd;2BAkDsF,kEAAsC;4BA7DnI,kEACpB;;uCA4D86B,kEAAsC;;;0BAAotD,sDAA0B;iCAAkjB,sDAA0B;yCA3DzuG,sDAC5B;;;AAYZ,wBA6CE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-core",
|
|
3
|
-
"version": "10.0.0-build.2.
|
|
3
|
+
"version": "10.0.0-build.2.14",
|
|
4
4
|
"description": "Core headless UI library that the users can use to write their own UI and create repeating structures like table, gallery, timeline etc.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -14,8 +14,8 @@
|
|
|
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.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "10.0.0-build.2.14",
|
|
18
|
+
"@pega/cosmos-react-core": "10.0.0-build.2.14",
|
|
19
19
|
"@types/lodash-es": "^4.17.12",
|
|
20
20
|
"dayjs": "^1.11.13",
|
|
21
21
|
"fast-deep-equal": "^3.1.3",
|