@progress/kendo-react-grid 5.19.0-dev.202309211709 → 5.19.0-dev.202309261220

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/dist/es/Grid.js CHANGED
@@ -634,6 +634,8 @@ var Grid = /** @class */ (function (_super) {
634
634
  });
635
635
  var noRecords = children.filter(function (child) { return child && child.type &&
636
636
  child.type.displayName === 'KendoReactGridNoRecords'; });
637
+ var statusBar = children.filter(function (child) { return child && child.type &&
638
+ child.type.displayName === 'KendoReactGridStatusBar'; });
637
639
  var leafColumns = this._columns.filter(function (c) { return c.children.length === 0; });
638
640
  var groupingPanel = groupable && (React.createElement(GroupPanel, { group: this.props.group || [], groupChange: this.groupChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, refCallback: this.dragLogic.refGroupPanelDiv, resolveTitle: this.resolveTitle, ariaControls: this._gridRoleElementId }));
639
641
  var _g = this.props, sort = _g.sort, sortable = _g.sortable, group = _g.group, filter = _g.filter, filterable = _g.filterable, _h = _g.filterOperators, filterOperators = _h === void 0 ? operators : _h, headerCellRender = _g.headerCellRender, columnMenu = _g.columnMenu;
@@ -779,6 +781,7 @@ var Grid = /** @class */ (function (_super) {
779
781
  enableDragClues && (React.createElement(React.Fragment, null,
780
782
  React.createElement(DropClue, { ref: this.dragLogic.refDropElementClue }),
781
783
  React.createElement(DragClue, { ref: this.dragLogic.refDragElementClue })))),
784
+ statusBar,
782
785
  this.props.pageable && pager));
783
786
  }
784
787
  var wrapperStyle = this.props.style || {};
@@ -816,12 +819,13 @@ var Grid = /** @class */ (function (_super) {
816
819
  React.createElement("tbody", __assign({ className: 'k-table-tbody', ref: this.tableBodyRef, role: 'rowgroup' }, tableKeyboardNavigationBodyAttributes), body)))),
817
820
  React.createElement("div", { className: "k-height-container", role: "presentation" },
818
821
  React.createElement("div", { style: this.props.scrollable === 'virtual' ?
819
- { 'height': (this.vs.containerHeight) + 'px' } : {} })),
820
- footer)),
822
+ { 'height': (this.vs.containerHeight) + 'px' } : {} })))),
823
+ footer,
821
824
  enableDragClues && (React.createElement(React.Fragment, null,
822
825
  React.createElement(DropClue, { ref: this.dragLogic.refDropElementClue }),
823
826
  React.createElement(DragClue, { ref: this.dragLogic.refDragElementClue }))),
824
827
  this.showLicenseWatermark && React.createElement(WatermarkOverlay, null)),
828
+ statusBar,
825
829
  this.props.pageable && pager)));
826
830
  };
827
831
  Grid.prototype.selectionChange = function (options) {
@@ -0,0 +1,47 @@
1
+ import * as React from 'react';
2
+ import { GridSelectionChangeEvent } from './interfaces/events';
3
+ import { GridColumnProps } from './interfaces/GridColumnProps';
4
+ /**
5
+ * Represents the KendoReact Grid's StatusItem object.
6
+ */
7
+ export interface StatusItem {
8
+ /**
9
+ * The type of the status item.
10
+ * Could be `sum`, `min`, `max`, `average`, `count`, `isTrue`, `isFalse`, `earliest` or `latest`.
11
+ */
12
+ type: string;
13
+ /**
14
+ * The calculated value of the status item.
15
+ */
16
+ value: number | boolean | Date;
17
+ /**
18
+ * The formatted value of the status item.
19
+ */
20
+ formattedValue: string;
21
+ }
22
+ /**
23
+ * Represents the props of the KendoReact Grid's StatusBar component.
24
+ */
25
+ export interface StatusBarProps {
26
+ data: StatusItem[];
27
+ }
28
+ /**
29
+ * Represents the KendoReact Grid's StatusBar component.
30
+ */
31
+ export declare const StatusBar: React.FunctionComponent<StatusBarProps>;
32
+ /**
33
+ * @hidden
34
+ */
35
+ export declare const leafColumns: (columns: GridColumnProps[]) => GridColumnProps[];
36
+ /**
37
+ * Represents the arguments of the getStatusData function.
38
+ */
39
+ export interface StatusDataArgs extends Pick<GridSelectionChangeEvent, 'dataItems' | 'target' | 'startColIndex' | 'endColIndex' | 'startRowIndex' | 'endRowIndex' | 'cell'> {
40
+ }
41
+ /**
42
+ * Calculates the status data.
43
+ *
44
+ * @param args StatusDataArgs
45
+ * @returns StatusItem[]
46
+ */
47
+ export declare const getStatusData: (args: StatusDataArgs) => StatusItem[];
@@ -0,0 +1,109 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
10
+ import * as React from 'react';
11
+ import { getter } from '@progress/kendo-react-common';
12
+ /**
13
+ * Represents the KendoReact Grid's StatusBar component.
14
+ */
15
+ export var StatusBar = function (props) {
16
+ var _a = props.data, data = _a === void 0 ? [] : _a;
17
+ return (React.createElement("div", { className: "k-selection-aggregates k-grid-selection-aggregates" }, data.map(function (item, index) { return (React.createElement("div", { key: index },
18
+ React.createElement("span", { className: "k-selection-aggregates-item-text" },
19
+ item.type,
20
+ ": "),
21
+ React.createElement("span", { className: "k-selection-aggregates-item-value" }, item.formattedValue))); })));
22
+ };
23
+ StatusBar.displayName = 'KendoReactGridStatusBar';
24
+ ;
25
+ ;
26
+ /**
27
+ * @hidden
28
+ */
29
+ export var leafColumns = function (columns) {
30
+ var _a;
31
+ var result = columns.slice();
32
+ for (var i = 0; i < result.length; i++) {
33
+ while (result[i] && ((_a = result[i].children) === null || _a === void 0 ? void 0 : _a.length)) {
34
+ result.splice.apply(result, __spreadArray([i, 1], result[i].children, false));
35
+ }
36
+ }
37
+ return result;
38
+ };
39
+ ;
40
+ /**
41
+ * Calculates the status data.
42
+ *
43
+ * @param args StatusDataArgs
44
+ * @returns StatusItem[]
45
+ */
46
+ export var getStatusData = function (args) {
47
+ var dataItems = args.dataItems, target = args.target, startColIndex = args.startColIndex, endColIndex = args.endColIndex, startRowIndex = args.startRowIndex, endRowIndex = args.endRowIndex;
48
+ var columns = leafColumns(target.columns);
49
+ if (args.cell) {
50
+ columns = columns.slice(startColIndex, endColIndex + 1);
51
+ }
52
+ var getters = columns.map(function (c) { return c.field; }).filter(function (f) { return f && typeof f === 'string'; }).map(function (f) { return getter(f); });
53
+ var data = dataItems.slice(startRowIndex, endRowIndex + 1);
54
+ var grouped = { dates: [], numbers: [], booleans: [], others: [] };
55
+ var add = function (value) {
56
+ if (typeof value === 'number') {
57
+ grouped.numbers.push(value);
58
+ }
59
+ else if (typeof value === 'boolean') {
60
+ grouped.booleans.push(value);
61
+ }
62
+ else if (value instanceof Date) {
63
+ grouped.dates.push(value);
64
+ }
65
+ else if (value) {
66
+ grouped.others.push(value);
67
+ }
68
+ };
69
+ data.forEach(function (item) {
70
+ getters.forEach(function (fieldGetter) {
71
+ add(fieldGetter(item));
72
+ });
73
+ });
74
+ var datesAsNumbers = grouped.dates.map(function (d) { return d.getTime(); });
75
+ var isTrueCount = grouped.booleans.filter(function (bool) { return bool; }).length;
76
+ var isFalseCount = grouped.booleans.filter(function (bool) { return !bool; }).length;
77
+ var sum = grouped.numbers.length ? grouped.numbers.reduce(function (acc, curr) { return acc += curr; }, 0) : undefined;
78
+ var aggregates = {
79
+ sum: sum,
80
+ average: typeof sum === 'number' ? sum / grouped.numbers.length : undefined,
81
+ min: grouped.numbers.length ? Math.min.apply(Math, grouped.numbers) : undefined,
82
+ max: grouped.numbers.length ? Math.max.apply(Math, grouped.numbers) : undefined,
83
+ count: grouped.numbers.length + grouped.booleans.length + grouped.dates.length + grouped.others.length,
84
+ isTrue: isTrueCount > 0 ? isTrueCount : undefined,
85
+ isFalse: isFalseCount > 0 ? isFalseCount : undefined,
86
+ earliest: grouped.dates.length ? new Date(Math.min.apply(Math, datesAsNumbers)) : undefined,
87
+ latest: grouped.dates.length ? new Date(Math.max.apply(Math, datesAsNumbers)) : undefined
88
+ };
89
+ var format = function (value, key) {
90
+ if ((key === 'sum' || key === 'average') && typeof value === 'number') {
91
+ return value.toFixed(2);
92
+ }
93
+ else if ((key === 'earliest' || key === 'latest') && value instanceof Date) {
94
+ return value.toLocaleDateString();
95
+ }
96
+ else {
97
+ return String(value);
98
+ }
99
+ };
100
+ var result = [];
101
+ Object.keys(aggregates).forEach(function (a) {
102
+ var type = a;
103
+ var value = aggregates[type];
104
+ if (value !== undefined) {
105
+ result.push({ type: type, value: value, formattedValue: format(value, type) });
106
+ }
107
+ });
108
+ return result;
109
+ };
package/dist/es/main.d.ts CHANGED
@@ -34,6 +34,7 @@ import { GridNoRecordsProps } from './interfaces/GridNoRecordsProps';
34
34
  export * from './interfaces/events';
35
35
  export * from './interfaces/GridCellsSettings';
36
36
  export { messages as gridMessages, pagerInfo, pagerFirstPage, pagerPreviousPage, pagerNextPage, pagerLastPage, pagerItemPerPage } from './messages';
37
+ export * from './StatusBar';
37
38
  import { GridSortSettings } from './interfaces/GridSortSettings';
38
39
  import { GridPagerSettings } from './paging/GridPagerSettings';
39
40
  import { GridGroupableSettings } from './interfaces/GridGroupableSettings';
@@ -41,10 +42,10 @@ import { GridColumnMenuItem } from './columnMenu/GridColumnMenuItem';
41
42
  import { GridColumnMenuItemContent } from './columnMenu/GridColumnMenuItemContent';
42
43
  import { GridColumnMenuItemGroup } from './columnMenu/GridColumnMenuItemGroup';
43
44
  import { GridFooterCellProps } from './interfaces/GridFooterCellProps';
44
- import { GridSelectableMode } from './interfaces/GridSelectableSettings';
45
+ import { GridSelectableMode, GridSelectableSettings } from './interfaces/GridSelectableSettings';
45
46
  import { GridColumnMenuFilterUIProps } from './interfaces/GridColumnMenuFilterUIProps';
46
47
  import { GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE } from './constants';
47
48
  import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-react-data-tools';
48
49
  import { CommonDragLogic as GridCommonDragLogic } from './drag/CommonDragLogic';
49
50
  import { booleanFilterValues, operators } from './filterCommon';
50
- export { Grid, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridSelectionCell, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuFilterCellProps, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridColumnMenuColumnsList, GridColumnMenuColumnsListProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridFilterOperators, GridFilterOperator, GridColumnMenuWrapper, GridColumnMenuWrapperProps, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE, GridCommonDragLogic, rootFilterOrDefault, filterGroupByField, GridColumnMenuFilterProps, booleanFilterValues, operators };
51
+ export { Grid, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridSelectionCell, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuFilterCellProps, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridColumnMenuColumnsList, GridColumnMenuColumnsListProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridSelectableSettings, GridFilterOperators, GridFilterOperator, GridColumnMenuWrapper, GridColumnMenuWrapperProps, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE, GridCommonDragLogic, rootFilterOrDefault, filterGroupByField, GridColumnMenuFilterProps, booleanFilterValues, operators };
package/dist/es/main.js CHANGED
@@ -22,6 +22,7 @@ import { GridNoRecords } from './GridNoRecords';
22
22
  export * from './interfaces/events';
23
23
  export * from './interfaces/GridCellsSettings';
24
24
  export { messages as gridMessages, pagerInfo, pagerFirstPage, pagerPreviousPage, pagerNextPage, pagerLastPage, pagerItemPerPage } from './messages';
25
+ export * from './StatusBar';
25
26
  import { GridColumnMenuItem } from './columnMenu/GridColumnMenuItem';
26
27
  import { GridColumnMenuItemContent } from './columnMenu/GridColumnMenuItemContent';
27
28
  import { GridColumnMenuItemGroup } from './columnMenu/GridColumnMenuItemGroup';
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-grid',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1695314861,
8
+ publishDate: 1695729304,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
package/dist/npm/Grid.js CHANGED
@@ -637,6 +637,8 @@ var Grid = /** @class */ (function (_super) {
637
637
  });
638
638
  var noRecords = children.filter(function (child) { return child && child.type &&
639
639
  child.type.displayName === 'KendoReactGridNoRecords'; });
640
+ var statusBar = children.filter(function (child) { return child && child.type &&
641
+ child.type.displayName === 'KendoReactGridStatusBar'; });
640
642
  var leafColumns = this._columns.filter(function (c) { return c.children.length === 0; });
641
643
  var groupingPanel = groupable && (React.createElement(GroupPanel_1.GroupPanel, { group: this.props.group || [], groupChange: this.groupChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, refCallback: this.dragLogic.refGroupPanelDiv, resolveTitle: this.resolveTitle, ariaControls: this._gridRoleElementId }));
642
644
  var _g = this.props, sort = _g.sort, sortable = _g.sortable, group = _g.group, filter = _g.filter, filterable = _g.filterable, _h = _g.filterOperators, filterOperators = _h === void 0 ? filterCommon_1.operators : _h, headerCellRender = _g.headerCellRender, columnMenu = _g.columnMenu;
@@ -782,6 +784,7 @@ var Grid = /** @class */ (function (_super) {
782
784
  enableDragClues && (React.createElement(React.Fragment, null,
783
785
  React.createElement(kendo_react_data_tools_1.DropClue, { ref: this.dragLogic.refDropElementClue }),
784
786
  React.createElement(kendo_react_data_tools_1.DragClue, { ref: this.dragLogic.refDragElementClue })))),
787
+ statusBar,
785
788
  this.props.pageable && pager));
786
789
  }
787
790
  var wrapperStyle = this.props.style || {};
@@ -819,12 +822,13 @@ var Grid = /** @class */ (function (_super) {
819
822
  React.createElement("tbody", __assign({ className: 'k-table-tbody', ref: this.tableBodyRef, role: 'rowgroup' }, kendo_react_data_tools_1.tableKeyboardNavigationBodyAttributes), body)))),
820
823
  React.createElement("div", { className: "k-height-container", role: "presentation" },
821
824
  React.createElement("div", { style: this.props.scrollable === 'virtual' ?
822
- { 'height': (this.vs.containerHeight) + 'px' } : {} })),
823
- footer)),
825
+ { 'height': (this.vs.containerHeight) + 'px' } : {} })))),
826
+ footer,
824
827
  enableDragClues && (React.createElement(React.Fragment, null,
825
828
  React.createElement(kendo_react_data_tools_1.DropClue, { ref: this.dragLogic.refDropElementClue }),
826
829
  React.createElement(kendo_react_data_tools_1.DragClue, { ref: this.dragLogic.refDragElementClue }))),
827
830
  this.showLicenseWatermark && React.createElement(kendo_react_common_2.WatermarkOverlay, null)),
831
+ statusBar,
828
832
  this.props.pageable && pager)));
829
833
  };
830
834
  Grid.prototype.selectionChange = function (options) {
@@ -0,0 +1,47 @@
1
+ import * as React from 'react';
2
+ import { GridSelectionChangeEvent } from './interfaces/events';
3
+ import { GridColumnProps } from './interfaces/GridColumnProps';
4
+ /**
5
+ * Represents the KendoReact Grid's StatusItem object.
6
+ */
7
+ export interface StatusItem {
8
+ /**
9
+ * The type of the status item.
10
+ * Could be `sum`, `min`, `max`, `average`, `count`, `isTrue`, `isFalse`, `earliest` or `latest`.
11
+ */
12
+ type: string;
13
+ /**
14
+ * The calculated value of the status item.
15
+ */
16
+ value: number | boolean | Date;
17
+ /**
18
+ * The formatted value of the status item.
19
+ */
20
+ formattedValue: string;
21
+ }
22
+ /**
23
+ * Represents the props of the KendoReact Grid's StatusBar component.
24
+ */
25
+ export interface StatusBarProps {
26
+ data: StatusItem[];
27
+ }
28
+ /**
29
+ * Represents the KendoReact Grid's StatusBar component.
30
+ */
31
+ export declare const StatusBar: React.FunctionComponent<StatusBarProps>;
32
+ /**
33
+ * @hidden
34
+ */
35
+ export declare const leafColumns: (columns: GridColumnProps[]) => GridColumnProps[];
36
+ /**
37
+ * Represents the arguments of the getStatusData function.
38
+ */
39
+ export interface StatusDataArgs extends Pick<GridSelectionChangeEvent, 'dataItems' | 'target' | 'startColIndex' | 'endColIndex' | 'startRowIndex' | 'endRowIndex' | 'cell'> {
40
+ }
41
+ /**
42
+ * Calculates the status data.
43
+ *
44
+ * @param args StatusDataArgs
45
+ * @returns StatusItem[]
46
+ */
47
+ export declare const getStatusData: (args: StatusDataArgs) => StatusItem[];
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getStatusData = exports.leafColumns = exports.StatusBar = void 0;
13
+ var React = require("react");
14
+ var kendo_react_common_1 = require("@progress/kendo-react-common");
15
+ /**
16
+ * Represents the KendoReact Grid's StatusBar component.
17
+ */
18
+ var StatusBar = function (props) {
19
+ var _a = props.data, data = _a === void 0 ? [] : _a;
20
+ return (React.createElement("div", { className: "k-selection-aggregates k-grid-selection-aggregates" }, data.map(function (item, index) { return (React.createElement("div", { key: index },
21
+ React.createElement("span", { className: "k-selection-aggregates-item-text" },
22
+ item.type,
23
+ ": "),
24
+ React.createElement("span", { className: "k-selection-aggregates-item-value" }, item.formattedValue))); })));
25
+ };
26
+ exports.StatusBar = StatusBar;
27
+ exports.StatusBar.displayName = 'KendoReactGridStatusBar';
28
+ ;
29
+ ;
30
+ /**
31
+ * @hidden
32
+ */
33
+ var leafColumns = function (columns) {
34
+ var _a;
35
+ var result = columns.slice();
36
+ for (var i = 0; i < result.length; i++) {
37
+ while (result[i] && ((_a = result[i].children) === null || _a === void 0 ? void 0 : _a.length)) {
38
+ result.splice.apply(result, __spreadArray([i, 1], result[i].children, false));
39
+ }
40
+ }
41
+ return result;
42
+ };
43
+ exports.leafColumns = leafColumns;
44
+ ;
45
+ /**
46
+ * Calculates the status data.
47
+ *
48
+ * @param args StatusDataArgs
49
+ * @returns StatusItem[]
50
+ */
51
+ var getStatusData = function (args) {
52
+ var dataItems = args.dataItems, target = args.target, startColIndex = args.startColIndex, endColIndex = args.endColIndex, startRowIndex = args.startRowIndex, endRowIndex = args.endRowIndex;
53
+ var columns = (0, exports.leafColumns)(target.columns);
54
+ if (args.cell) {
55
+ columns = columns.slice(startColIndex, endColIndex + 1);
56
+ }
57
+ var getters = columns.map(function (c) { return c.field; }).filter(function (f) { return f && typeof f === 'string'; }).map(function (f) { return (0, kendo_react_common_1.getter)(f); });
58
+ var data = dataItems.slice(startRowIndex, endRowIndex + 1);
59
+ var grouped = { dates: [], numbers: [], booleans: [], others: [] };
60
+ var add = function (value) {
61
+ if (typeof value === 'number') {
62
+ grouped.numbers.push(value);
63
+ }
64
+ else if (typeof value === 'boolean') {
65
+ grouped.booleans.push(value);
66
+ }
67
+ else if (value instanceof Date) {
68
+ grouped.dates.push(value);
69
+ }
70
+ else if (value) {
71
+ grouped.others.push(value);
72
+ }
73
+ };
74
+ data.forEach(function (item) {
75
+ getters.forEach(function (fieldGetter) {
76
+ add(fieldGetter(item));
77
+ });
78
+ });
79
+ var datesAsNumbers = grouped.dates.map(function (d) { return d.getTime(); });
80
+ var isTrueCount = grouped.booleans.filter(function (bool) { return bool; }).length;
81
+ var isFalseCount = grouped.booleans.filter(function (bool) { return !bool; }).length;
82
+ var sum = grouped.numbers.length ? grouped.numbers.reduce(function (acc, curr) { return acc += curr; }, 0) : undefined;
83
+ var aggregates = {
84
+ sum: sum,
85
+ average: typeof sum === 'number' ? sum / grouped.numbers.length : undefined,
86
+ min: grouped.numbers.length ? Math.min.apply(Math, grouped.numbers) : undefined,
87
+ max: grouped.numbers.length ? Math.max.apply(Math, grouped.numbers) : undefined,
88
+ count: grouped.numbers.length + grouped.booleans.length + grouped.dates.length + grouped.others.length,
89
+ isTrue: isTrueCount > 0 ? isTrueCount : undefined,
90
+ isFalse: isFalseCount > 0 ? isFalseCount : undefined,
91
+ earliest: grouped.dates.length ? new Date(Math.min.apply(Math, datesAsNumbers)) : undefined,
92
+ latest: grouped.dates.length ? new Date(Math.max.apply(Math, datesAsNumbers)) : undefined
93
+ };
94
+ var format = function (value, key) {
95
+ if ((key === 'sum' || key === 'average') && typeof value === 'number') {
96
+ return value.toFixed(2);
97
+ }
98
+ else if ((key === 'earliest' || key === 'latest') && value instanceof Date) {
99
+ return value.toLocaleDateString();
100
+ }
101
+ else {
102
+ return String(value);
103
+ }
104
+ };
105
+ var result = [];
106
+ Object.keys(aggregates).forEach(function (a) {
107
+ var type = a;
108
+ var value = aggregates[type];
109
+ if (value !== undefined) {
110
+ result.push({ type: type, value: value, formattedValue: format(value, type) });
111
+ }
112
+ });
113
+ return result;
114
+ };
115
+ exports.getStatusData = getStatusData;
@@ -34,6 +34,7 @@ import { GridNoRecordsProps } from './interfaces/GridNoRecordsProps';
34
34
  export * from './interfaces/events';
35
35
  export * from './interfaces/GridCellsSettings';
36
36
  export { messages as gridMessages, pagerInfo, pagerFirstPage, pagerPreviousPage, pagerNextPage, pagerLastPage, pagerItemPerPage } from './messages';
37
+ export * from './StatusBar';
37
38
  import { GridSortSettings } from './interfaces/GridSortSettings';
38
39
  import { GridPagerSettings } from './paging/GridPagerSettings';
39
40
  import { GridGroupableSettings } from './interfaces/GridGroupableSettings';
@@ -41,10 +42,10 @@ import { GridColumnMenuItem } from './columnMenu/GridColumnMenuItem';
41
42
  import { GridColumnMenuItemContent } from './columnMenu/GridColumnMenuItemContent';
42
43
  import { GridColumnMenuItemGroup } from './columnMenu/GridColumnMenuItemGroup';
43
44
  import { GridFooterCellProps } from './interfaces/GridFooterCellProps';
44
- import { GridSelectableMode } from './interfaces/GridSelectableSettings';
45
+ import { GridSelectableMode, GridSelectableSettings } from './interfaces/GridSelectableSettings';
45
46
  import { GridColumnMenuFilterUIProps } from './interfaces/GridColumnMenuFilterUIProps';
46
47
  import { GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE } from './constants';
47
48
  import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-react-data-tools';
48
49
  import { CommonDragLogic as GridCommonDragLogic } from './drag/CommonDragLogic';
49
50
  import { booleanFilterValues, operators } from './filterCommon';
50
- export { Grid, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridSelectionCell, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuFilterCellProps, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridColumnMenuColumnsList, GridColumnMenuColumnsListProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridFilterOperators, GridFilterOperator, GridColumnMenuWrapper, GridColumnMenuWrapperProps, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE, GridCommonDragLogic, rootFilterOrDefault, filterGroupByField, GridColumnMenuFilterProps, booleanFilterValues, operators };
51
+ export { Grid, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridSelectionCell, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuFilterCellProps, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridColumnMenuColumnsList, GridColumnMenuColumnsListProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridSelectableSettings, GridFilterOperators, GridFilterOperator, GridColumnMenuWrapper, GridColumnMenuWrapperProps, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE, GridCommonDragLogic, rootFilterOrDefault, filterGroupByField, GridColumnMenuFilterProps, booleanFilterValues, operators };
package/dist/npm/main.js CHANGED
@@ -69,6 +69,7 @@ Object.defineProperty(exports, "pagerPreviousPage", { enumerable: true, get: fun
69
69
  Object.defineProperty(exports, "pagerNextPage", { enumerable: true, get: function () { return messages_1.pagerNextPage; } });
70
70
  Object.defineProperty(exports, "pagerLastPage", { enumerable: true, get: function () { return messages_1.pagerLastPage; } });
71
71
  Object.defineProperty(exports, "pagerItemPerPage", { enumerable: true, get: function () { return messages_1.pagerItemPerPage; } });
72
+ __exportStar(require("./StatusBar"), exports);
72
73
  var GridColumnMenuItem_1 = require("./columnMenu/GridColumnMenuItem");
73
74
  Object.defineProperty(exports, "GridColumnMenuItem", { enumerable: true, get: function () { return GridColumnMenuItem_1.GridColumnMenuItem; } });
74
75
  var GridColumnMenuItemContent_1 = require("./columnMenu/GridColumnMenuItemContent");
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-grid',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1695314861,
11
+ publishDate: 1695729304,
12
12
  version: '',
13
13
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
14
14
  };