@progress/kendo-react-pivotgrid 6.1.1-dev.202311151536 → 7.0.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/LICENSE.md +1 -1
  2. package/{dist/npm/PivotGrid.d.ts → PivotGrid.d.ts} +4 -0
  3. package/{dist/es/components → components}/AxesEditor.d.ts +4 -6
  4. package/{dist/npm/components → components}/AxisEditor.d.ts +4 -0
  5. package/{dist/es/components → components}/AxisFilterFieldsEditor.d.ts +4 -0
  6. package/{dist/npm/components → components}/Cell.d.ts +4 -0
  7. package/{dist/es/components → components}/Column.d.ts +4 -0
  8. package/{dist/npm/components → components}/Configurator.d.ts +4 -0
  9. package/{dist/npm/components → components}/ConfiguratorButton.d.ts +4 -0
  10. package/{dist/es/components → components}/ConfiguratorEditor.d.ts +4 -0
  11. package/{dist/es/components → components}/Container.d.ts +4 -0
  12. package/components/EditorContext.d.ts +11 -0
  13. package/{dist/npm/components → components}/FieldsEditor.d.ts +4 -0
  14. package/{dist/es/components → components}/HeaderCell.d.ts +4 -0
  15. package/{dist/es/components → components}/Row.d.ts +4 -0
  16. package/dist/cdn/js/kendo-react-pivotgrid.js +5 -2
  17. package/hooks/index.d.ts +6 -0
  18. package/{dist/es/hooks → hooks}/useExpansion.d.ts +5 -1
  19. package/{dist/es/hooks → hooks}/useHeaders.d.ts +5 -1
  20. package/hooks/useHorizontalScrollSync.d.ts +9 -0
  21. package/{dist/es/hooks → hooks}/usePivotConfiguratorEditor.d.ts +5 -1
  22. package/{dist/npm/hooks → hooks}/usePivotLocalDataService.d.ts +4 -0
  23. package/{dist/npm/hooks → hooks}/usePivotOLAPService.d.ts +4 -0
  24. package/hooks/useVerticalScrollSync.d.ts +9 -0
  25. package/index.d.ts +22 -0
  26. package/index.js +5 -0
  27. package/index.mjs +1585 -0
  28. package/{dist/es/messages → messages}/index.d.ts +4 -0
  29. package/{dist/es/models → models}/index.d.ts +4 -1
  30. package/package-metadata.d.ts +9 -0
  31. package/package.json +36 -54
  32. package/{dist/es/shared → shared}/PivotGridConfiguratorEditorEventsContext.d.ts +4 -0
  33. package/{dist/npm/shared → shared}/PivotGridConfiguratorEditorStateContext.d.ts +4 -0
  34. package/shared/index.d.ts +6 -0
  35. package/{dist/es/utils → utils}/index.d.ts +4 -0
  36. package/about.md +0 -3
  37. package/dist/cdn/js/kendo-react-pivotgrid.js.LICENSE.txt +0 -14
  38. package/dist/es/PivotGrid.d.ts +0 -177
  39. package/dist/es/PivotGrid.js +0 -245
  40. package/dist/es/components/AxesEditor.js +0 -43
  41. package/dist/es/components/AxisEditor.d.ts +0 -52
  42. package/dist/es/components/AxisEditor.js +0 -138
  43. package/dist/es/components/AxisFilterFieldsEditor.js +0 -150
  44. package/dist/es/components/Cell.d.ts +0 -65
  45. package/dist/es/components/Cell.js +0 -31
  46. package/dist/es/components/Column.js +0 -33
  47. package/dist/es/components/Configurator.d.ts +0 -125
  48. package/dist/es/components/Configurator.js +0 -118
  49. package/dist/es/components/ConfiguratorButton.d.ts +0 -40
  50. package/dist/es/components/ConfiguratorButton.js +0 -39
  51. package/dist/es/components/ConfiguratorEditor.js +0 -191
  52. package/dist/es/components/Container.js +0 -22
  53. package/dist/es/components/FieldsEditor.d.ts +0 -74
  54. package/dist/es/components/FieldsEditor.js +0 -90
  55. package/dist/es/components/HeaderCell.js +0 -50
  56. package/dist/es/components/Row.js +0 -28
  57. package/dist/es/hooks/index.d.ts +0 -2
  58. package/dist/es/hooks/index.js +0 -2
  59. package/dist/es/hooks/useExpansion.js +0 -89
  60. package/dist/es/hooks/useHeaders.js +0 -25
  61. package/dist/es/hooks/useHorizontalScrollSync.d.ts +0 -5
  62. package/dist/es/hooks/useHorizontalScrollSync.js +0 -27
  63. package/dist/es/hooks/usePivotConfiguratorEditor.js +0 -103
  64. package/dist/es/hooks/usePivotLocalDataService.d.ts +0 -79
  65. package/dist/es/hooks/usePivotLocalDataService.js +0 -105
  66. package/dist/es/hooks/usePivotOLAPService.d.ts +0 -41
  67. package/dist/es/hooks/usePivotOLAPService.js +0 -371
  68. package/dist/es/hooks/useVerticalScrollSync.d.ts +0 -5
  69. package/dist/es/hooks/useVerticalScrollSync.js +0 -27
  70. package/dist/es/main.d.ts +0 -18
  71. package/dist/es/main.js +0 -17
  72. package/dist/es/messages/index.js +0 -71
  73. package/dist/es/models/index.js +0 -1
  74. package/dist/es/package-metadata.d.ts +0 -5
  75. package/dist/es/package-metadata.js +0 -11
  76. package/dist/es/shared/PivotGridConfiguratorEditorEventsContext.js +0 -5
  77. package/dist/es/shared/PivotGridConfiguratorEditorStateContext.d.ts +0 -6
  78. package/dist/es/shared/PivotGridConfiguratorEditorStateContext.js +0 -18
  79. package/dist/es/shared/index.d.ts +0 -2
  80. package/dist/es/shared/index.js +0 -2
  81. package/dist/es/utils/index.js +0 -118
  82. package/dist/npm/PivotGrid.js +0 -248
  83. package/dist/npm/components/AxesEditor.d.ts +0 -46
  84. package/dist/npm/components/AxesEditor.js +0 -46
  85. package/dist/npm/components/AxisEditor.js +0 -141
  86. package/dist/npm/components/AxisFilterFieldsEditor.d.ts +0 -114
  87. package/dist/npm/components/AxisFilterFieldsEditor.js +0 -153
  88. package/dist/npm/components/Cell.js +0 -34
  89. package/dist/npm/components/Column.d.ts +0 -42
  90. package/dist/npm/components/Column.js +0 -36
  91. package/dist/npm/components/Configurator.js +0 -121
  92. package/dist/npm/components/ConfiguratorButton.js +0 -42
  93. package/dist/npm/components/ConfiguratorEditor.d.ts +0 -126
  94. package/dist/npm/components/ConfiguratorEditor.js +0 -194
  95. package/dist/npm/components/Container.d.ts +0 -46
  96. package/dist/npm/components/Container.js +0 -25
  97. package/dist/npm/components/FieldsEditor.js +0 -93
  98. package/dist/npm/components/HeaderCell.d.ts +0 -96
  99. package/dist/npm/components/HeaderCell.js +0 -53
  100. package/dist/npm/components/Row.d.ts +0 -50
  101. package/dist/npm/components/Row.js +0 -31
  102. package/dist/npm/hooks/index.d.ts +0 -2
  103. package/dist/npm/hooks/index.js +0 -18
  104. package/dist/npm/hooks/useExpansion.d.ts +0 -19
  105. package/dist/npm/hooks/useExpansion.js +0 -93
  106. package/dist/npm/hooks/useHeaders.d.ts +0 -12
  107. package/dist/npm/hooks/useHeaders.js +0 -30
  108. package/dist/npm/hooks/useHorizontalScrollSync.d.ts +0 -5
  109. package/dist/npm/hooks/useHorizontalScrollSync.js +0 -31
  110. package/dist/npm/hooks/usePivotConfiguratorEditor.d.ts +0 -83
  111. package/dist/npm/hooks/usePivotConfiguratorEditor.js +0 -107
  112. package/dist/npm/hooks/usePivotLocalDataService.js +0 -110
  113. package/dist/npm/hooks/usePivotOLAPService.js +0 -376
  114. package/dist/npm/hooks/useVerticalScrollSync.d.ts +0 -5
  115. package/dist/npm/hooks/useVerticalScrollSync.js +0 -31
  116. package/dist/npm/main.d.ts +0 -18
  117. package/dist/npm/main.js +0 -43
  118. package/dist/npm/messages/index.d.ts +0 -70
  119. package/dist/npm/messages/index.js +0 -74
  120. package/dist/npm/models/index.d.ts +0 -45
  121. package/dist/npm/models/index.js +0 -2
  122. package/dist/npm/package-metadata.d.ts +0 -5
  123. package/dist/npm/package-metadata.js +0 -14
  124. package/dist/npm/shared/PivotGridConfiguratorEditorEventsContext.d.ts +0 -13
  125. package/dist/npm/shared/PivotGridConfiguratorEditorEventsContext.js +0 -8
  126. package/dist/npm/shared/PivotGridConfiguratorEditorStateContext.js +0 -21
  127. package/dist/npm/shared/index.d.ts +0 -2
  128. package/dist/npm/shared/index.js +0 -18
  129. package/dist/npm/utils/index.d.ts +0 -47
  130. package/dist/npm/utils/index.js +0 -130
  131. package/dist/systemjs/kendo-react-pivotgrid.js +0 -1
  132. package/e2e-next/basic.tests.ts +0 -24
@@ -1,118 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import * as React from 'react';
13
- import { Button } from '@progress/kendo-react-buttons';
14
- import { classNames, useCustomComponent, canUseRef } from '@progress/kendo-react-common';
15
- import { useLocalization } from '@progress/kendo-react-intl';
16
- import { Form as KendoForm, FormElement as KendoFormElement } from '@progress/kendo-react-form';
17
- import { PivotGridConfiguratorEditor } from './ConfiguratorEditor';
18
- import { messages, configuratorTitle, configuratorCancel, configuratorApply } from '../messages';
19
- /**
20
- * Represents the [KendoReact PivotGridConfigurator component]({% slug api_pivotgrid_pivotgridconfiguratorprops %}).
21
- */
22
- export var PivotGridConfigurator = React.forwardRef(function (props, ref) {
23
- var _a = __assign(__assign({}, defaultProps), props), horizontal = _a.horizontal, data = _a.data, rowAxes = _a.rowAxes, columnAxes = _a.columnAxes, measureAxes = _a.measureAxes;
24
- var element = React.useRef(null);
25
- var target = React.useRef(null);
26
- var form = React.useRef(null);
27
- var localization = useLocalization();
28
- var _b = useCustomComponent(props.editor || defaultProps.editor), EditorComponent = _b[0], EditorProps = _b[1];
29
- var _c = useCustomComponent(props.form || defaultProps.form), FormComponent = _c[0], FormProps = _c[1];
30
- var _d = useCustomComponent(props.formElement || defaultProps.formElement), FormElementComponent = _d[0], FormElementProps = _d[1];
31
- React.useImperativeHandle(target, function () { return ({ props: props, element: element.current }); });
32
- React.useImperativeHandle(ref, function () { return target.current; });
33
- var handleFormSubmit = function (newDataItem, syntheticEvent) {
34
- if (props.onRowAxesChange) {
35
- props.onRowAxesChange({
36
- target: target.current,
37
- value: newDataItem.rowAxes,
38
- syntheticEvent: syntheticEvent
39
- });
40
- }
41
- if (props.onColumnAxesChange) {
42
- props.onColumnAxesChange({
43
- target: target.current,
44
- value: newDataItem.columnAxes,
45
- syntheticEvent: syntheticEvent
46
- });
47
- }
48
- if (props.onMeasureAxesChange) {
49
- props.onMeasureAxesChange({
50
- target: target.current,
51
- value: newDataItem.measureAxes,
52
- syntheticEvent: syntheticEvent
53
- });
54
- }
55
- if (props.onSortChange) {
56
- props.onSortChange({
57
- target: target.current,
58
- value: newDataItem.sort,
59
- syntheticEvent: syntheticEvent
60
- });
61
- }
62
- if (props.onFilterChange) {
63
- props.onFilterChange({
64
- target: target.current,
65
- value: newDataItem.filter,
66
- syntheticEvent: syntheticEvent
67
- });
68
- }
69
- };
70
- var initialValues = {
71
- rowAxes: rowAxes,
72
- columnAxes: columnAxes,
73
- measureAxes: measureAxes,
74
- sort: props.sort,
75
- filter: props.filter
76
- };
77
- React.useEffect(function () { if (form.current) {
78
- form.current.onChange('rowAxes', { value: rowAxes });
79
- } }, [rowAxes]);
80
- React.useEffect(function () { if (form.current) {
81
- form.current.onChange('columnAxes', { value: columnAxes });
82
- } }, [columnAxes]);
83
- React.useEffect(function () { if (form.current) {
84
- form.current.onChange('measureAxes', { value: measureAxes });
85
- } }, [measureAxes]);
86
- React.useEffect(function () { if (form.current) {
87
- form.current.onChange('sort', { value: props.sort });
88
- } }, [props.sort]);
89
- React.useEffect(function () { if (form.current) {
90
- form.current.onChange('filter', { value: props.filter });
91
- } }, [props.filter]);
92
- return (React.createElement("div", { ref: element, id: props.id, tabIndex: props.tabIndex, style: props.style, className: classNames('k-pivotgrid-configurator', props.className) },
93
- React.createElement("div", { className: classNames('k-pivotgrid-configurator-panel', 'k-pivotgrid-configurator-push', {
94
- 'k-pivotgrid-configurator-horizontal': horizontal,
95
- 'k-pivotgrid-configurator-vertical': !horizontal
96
- }) },
97
- React.createElement("div", { className: "k-pivotgrid-configurator-header" },
98
- React.createElement("div", { className: "k-pivotgrid-configurator-header-text" }, localization.toLanguageString(configuratorTitle, messages[configuratorTitle]))),
99
- React.createElement(FormComponent, __assign({ ref: canUseRef(FormComponent) ? form : undefined, initialValues: initialValues, onSubmit: handleFormSubmit, render: function (renderProps) { return (React.createElement(React.Fragment, null,
100
- React.createElement("div", { className: "k-pivotgrid-configurator-content" },
101
- React.createElement(FormElementComponent, __assign({ horizontal: horizontal }, FormElementProps),
102
- React.createElement(EditorComponent, __assign({}, renderProps, { horizontal: props.horizontal, onFieldsEditorFieldExpand: props.onFieldsEditorFieldExpand, onFieldsEditorFieldCheck: props.onFieldsEditorFieldCheck, onAxisFilterFieldExpand: props.onAxisFilterFieldExpand, onAxisFilterFieldsExpandChange: props.onAxisFilterFieldsExpandChange, data: data }, EditorProps)))),
103
- React.createElement("div", { className: "k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end" },
104
- React.createElement(Button, { type: "submit", onClick: renderProps.onFormReset }, localization.toLanguageString(configuratorCancel, messages[configuratorCancel])),
105
- React.createElement(Button, { themeColor: 'primary', type: "submit", onClick: renderProps.onSubmit }, localization.toLanguageString(configuratorApply, messages[configuratorApply]))))); } }, FormProps)))));
106
- });
107
- var defaultProps = {
108
- form: KendoForm,
109
- formElement: KendoFormElement,
110
- editor: PivotGridConfiguratorEditor,
111
- horizontal: false,
112
- data: [],
113
- columnAxes: [],
114
- rowAxes: [],
115
- measureAxes: []
116
- };
117
- PivotGridConfigurator.defaultProps = defaultProps;
118
- PivotGridConfigurator.displayName = 'KendoReactPivotGridConfigurator';
@@ -1,40 +0,0 @@
1
- import * as React from 'react';
2
- import { CustomComponent, IconProps as KendoIconProps, KendoMouse, SvgIconProps } from '@progress/kendo-react-common';
3
- /**
4
- * Represents the props of the [KendoReact PivotGridConfiguratorButton component]({% slug api_pivotgrid_pivotgridconfiguratorbutton %}).
5
- */
6
- export interface PivotGridConfiguratorButtonProps extends KendoMouse<PivotGridConfiguratorButtonHandle, HTMLDivElement> {
7
- /**
8
- * Sets the `className` property of the top-most element of the PivotGridConfiguratorButton in addition to the default `k-pivotgrid-configurator-button` class.
9
- */
10
- className?: string;
11
- /**
12
- * Sets the `id` property of the top-most element of the PivotGridConfiguratorButton.
13
- */
14
- id?: string;
15
- /**
16
- * Sets the `tabIndex` property of the top-most element of the PivotGridConfiguratorButton.
17
- */
18
- tabIndex?: number;
19
- /**
20
- * Sets the `style` property of the top-most element of the PivotGridConfiguratorButton.
21
- */
22
- style?: React.CSSProperties;
23
- /**
24
- * Overrides the default `icon` component.
25
- *
26
- * The default component is: [KendoReactIcon]({% slug api_common_icon %}).
27
- */
28
- icon?: CustomComponent<KendoIconProps & SvgIconProps>;
29
- }
30
- /**
31
- * Represents the object which is passed to the [`ref`](https://reactjs.org/docs/refs-and-the-dom.html) callback of the PivotGridConfiguratorButton component.
32
- */
33
- export interface PivotGridConfiguratorButtonHandle {
34
- props: PivotGridConfiguratorButtonProps;
35
- element: HTMLDivElement | null;
36
- }
37
- /**
38
- * Represents the [KendoReact PivotGridConfiguratorButton component]({% slug api_pivotgrid_pivotgridconfiguratorbuttonprops %}).
39
- */
40
- export declare const PivotGridConfiguratorButton: React.ForwardRefExoticComponent<PivotGridConfiguratorButtonProps & React.RefAttributes<PivotGridConfiguratorButtonHandle | null>>;
@@ -1,39 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import * as React from 'react';
13
- import { classNames, useCustomComponent, IconWrap } from '@progress/kendo-react-common';
14
- import { useLocalization } from '@progress/kendo-react-intl';
15
- import { gearIcon } from '@progress/kendo-svg-icons';
16
- import { messages, configuratorButtonLabel } from '../messages';
17
- import { useMouse } from '@progress/kendo-react-common';
18
- /**
19
- * Represents the [KendoReact PivotGridConfiguratorButton component]({% slug api_pivotgrid_pivotgridconfiguratorbuttonprops %}).
20
- */
21
- export var PivotGridConfiguratorButton = React.forwardRef(function (props, ref) {
22
- var target = React.useRef(null);
23
- var element = React.useRef(null);
24
- var localization = useLocalization();
25
- React.useImperativeHandle(target, function () { return ({ props: props, element: element.current }); });
26
- React.useImperativeHandle(ref, function () { return target.current; });
27
- var _a = useCustomComponent(props.icon || defaultProps.icon), IconComponent = _a[0], IconProps = _a[1];
28
- var className = React.useMemo(function () { return classNames('k-pivotgrid-configurator-button', props.className); }, [props.className]);
29
- var mouseProps = useMouse(props, target);
30
- return (React.createElement("div", __assign({ ref: element, id: props.id, className: className, tabIndex: props.tabIndex }, mouseProps),
31
- React.createElement("span", null,
32
- localization.toLanguageString(configuratorButtonLabel, messages[configuratorButtonLabel]),
33
- React.createElement(IconComponent, __assign({ name: "gear", icon: gearIcon }, IconProps)))));
34
- });
35
- var defaultProps = {
36
- icon: IconWrap
37
- };
38
- PivotGridConfiguratorButton.defaultProps = defaultProps;
39
- PivotGridConfiguratorButton.displayName = 'KendoReactPivotGridConfiguratorButton';
@@ -1,191 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import * as React from 'react';
13
- import { Field } from '@progress/kendo-react-form';
14
- import { Label } from '@progress/kendo-react-labels';
15
- import { useLocalization } from '@progress/kendo-react-intl';
16
- import { useCustomComponent } from '@progress/kendo-react-common';
17
- import { PivotGridAxesEditor } from './AxesEditor';
18
- import { PivotGridFieldsEditor } from './FieldsEditor';
19
- import { usePivotConfiguratorEditor, PIVOT_CONFIGURATOR_ACTION } from '../hooks';
20
- import { PivotGridConfiguratorEditorEventsContext, PivotGridConfiguratorEditorStateContext } from '../shared';
21
- import { messages, configuratorEditorSearchTitle, configuratorColumnsTitle, configuratorRowsTitle, configuratorMissingFields, configuratorMeasuresTitle } from '../messages';
22
- /**
23
- * Represents the [KendoReact PivotGridConfiguratorEditor component]({% slug api_pivotgrid_pivotgridconfiguratoreditorprops %}).
24
- */
25
- export var PivotGridConfiguratorEditor = React.forwardRef(function (props, ref) {
26
- var onFieldsEditorFieldCheck = props.onFieldsEditorFieldCheck, onFieldsEditorFieldCheckAction = props.onFieldsEditorFieldCheckAction, onFieldsEditorFieldExpand = props.onFieldsEditorFieldExpand, onFieldsEditorFieldExpandAction = props.onFieldsEditorFieldExpandAction, onAxisFilterFieldExpand = props.onAxisFilterFieldExpand, onAxisFilterFieldsExpandChange = props.onAxisFilterFieldsExpandChange;
27
- var _a = useCustomComponent(props.fieldsLabel || defaultProps.fieldsLabel), FieldsLabelComponent = _a[0], FieldsLabelProps = _a[1];
28
- var _b = useCustomComponent(props.fieldsEditor || defaultProps.fieldsEditor), FieldsEditorComponent = _b[0], FieldsEditorProps = _b[1];
29
- var _c = useCustomComponent(props.columnAxesLabel || defaultProps.columnAxesLabel), ColumnAxesLabelComponent = _c[0], ColumnAxesLabelProps = _c[1];
30
- var _d = useCustomComponent((props.columnAxesEditor || defaultProps.columnAxesEditor)), ColumnAxesEditorComponent = _d[0], ColumnAxesEditorProps = _d[1];
31
- var _e = useCustomComponent(props.rowAxesLabel || defaultProps.rowAxesLabel), RowAxesLabelComponent = _e[0], RowAxesLabelProps = _e[1];
32
- var _f = useCustomComponent((props.rowAxesEditor || defaultProps.rowAxesEditor)), RowAxesEditorComponent = _f[0], RowAxesEditorProps = _f[1];
33
- var _g = useCustomComponent(props.measureAxesLabel || defaultProps.measureAxesLabel), MeasureAxesLabelComponent = _g[0], MeasureAxesLabelProps = _g[1];
34
- var _h = useCustomComponent((props.measureAxesEditor || defaultProps.measureAxesEditor)), MeasureAxesEditorComponent = _h[0], MeasureAxesEditorProps = _h[1];
35
- var element = React.useRef(null);
36
- var target = React.useRef(null);
37
- var localization = useLocalization();
38
- var _j = usePivotConfiguratorEditor(props, target), state = _j[0], dispatchState = _j[1];
39
- React.useImperativeHandle(target, function () { return ({
40
- element: element.current,
41
- props: props,
42
- state: state
43
- }); });
44
- React.useImperativeHandle(ref, function () { return target.current; });
45
- var handleColumnsMouseEnter = function () {
46
- if (state.dragItem) {
47
- dispatchState({ type: PIVOT_CONFIGURATOR_ACTION.setDropZone, payload: 'columnAxes' });
48
- }
49
- };
50
- var handleColumnsMouseLeave = function () {
51
- if (state.dragItem) {
52
- dispatchState({ type: PIVOT_CONFIGURATOR_ACTION.setDropZone, payload: null });
53
- }
54
- };
55
- var handleRowsMouseEnter = function () {
56
- if (state.dragItem) {
57
- dispatchState({ type: PIVOT_CONFIGURATOR_ACTION.setDropZone, payload: 'rowAxes' });
58
- }
59
- };
60
- var handleRowsMouseLeave = function () {
61
- if (state.dragItem) {
62
- dispatchState({ type: PIVOT_CONFIGURATOR_ACTION.setDropZone, payload: null });
63
- }
64
- };
65
- var handleMeasuresMouseEnter = function () {
66
- if (state.dragItem) {
67
- dispatchState({ type: PIVOT_CONFIGURATOR_ACTION.setDropZone, payload: 'measureAxes' });
68
- }
69
- };
70
- var handleMeasuresMouseLeave = function () {
71
- if (state.dragItem) {
72
- dispatchState({ type: PIVOT_CONFIGURATOR_ACTION.setDropZone, payload: null });
73
- }
74
- };
75
- var handleFieldsEditorFieldExpand = function (event) {
76
- var eventArgs = {
77
- target: event.target,
78
- currentTarget: target.current,
79
- value: event.value,
80
- syntheticEvent: event.syntheticEvent
81
- };
82
- if (onFieldsEditorFieldExpandAction) {
83
- var actions = onFieldsEditorFieldExpandAction(eventArgs, props, state);
84
- if (actions) {
85
- Array.isArray(actions)
86
- ? actions.filter(Boolean).map(function (action) { return action && dispatchState(__assign({}, action), event.syntheticEvent); })
87
- : dispatchState(__assign({}, actions), event.syntheticEvent);
88
- }
89
- }
90
- if (onFieldsEditorFieldExpand) {
91
- onFieldsEditorFieldExpand({
92
- target: event.target,
93
- currentTarget: target.current,
94
- value: event.value,
95
- syntheticEvent: event.syntheticEvent
96
- });
97
- }
98
- };
99
- var handleFieldsEditorFieldCheck = function (event) {
100
- var eventArgs = {
101
- target: event.target,
102
- currentTarget: target.current,
103
- value: event.value,
104
- syntheticEvent: event.syntheticEvent
105
- };
106
- if (onFieldsEditorFieldCheckAction) {
107
- var actions = onFieldsEditorFieldCheckAction(eventArgs, props, state);
108
- if (actions) {
109
- Array.isArray(actions)
110
- ? actions.filter(Boolean).map(function (action) { return action && dispatchState(__assign({}, action), event.syntheticEvent); })
111
- : dispatchState(__assign({}, actions), event.syntheticEvent);
112
- }
113
- }
114
- if (onFieldsEditorFieldCheck) {
115
- onFieldsEditorFieldCheck(eventArgs);
116
- }
117
- };
118
- var handleAxisFilterFieldExpand = function (event) {
119
- var eventArgs = {
120
- target: event.target,
121
- currentTarget: target.current,
122
- value: event.value,
123
- syntheticEvent: event.syntheticEvent
124
- };
125
- if (onAxisFilterFieldExpand) {
126
- onAxisFilterFieldExpand(eventArgs);
127
- }
128
- };
129
- var handleAxisFilterFieldsExpandChange = function (event) {
130
- var eventArgs = {
131
- target: event.target,
132
- currentTarget: target.current,
133
- value: event.value,
134
- syntheticEvent: event.syntheticEvent
135
- };
136
- if (onAxisFilterFieldsExpandChange) {
137
- onAxisFilterFieldsExpandChange(eventArgs);
138
- }
139
- };
140
- var Container = props.horizontal ? 'div' : React.Fragment;
141
- var ContainerProps = props.horizontal ? { className: 'k-form-field-wrapper' } : {};
142
- return (React.createElement(PivotGridConfiguratorEditorEventsContext.Provider, { value: {
143
- onAxisFilterFieldExpand: handleAxisFilterFieldExpand,
144
- onAxisFilterFieldsExpandChange: handleAxisFilterFieldsExpandChange
145
- } },
146
- React.createElement(PivotGridConfiguratorEditorStateContext.Provider, { value: [state, dispatchState] },
147
- React.createElement(Container, __assign({}, ContainerProps),
148
- React.createElement("div", { className: "k-form-field" },
149
- React.createElement(FieldsLabelComponent, __assign({ name: "", component: Label }, FieldsLabelProps), localization.toLanguageString(configuratorEditorSearchTitle, messages[configuratorEditorSearchTitle]))),
150
- React.createElement("div", { className: "k-form-field" },
151
- React.createElement("div", { className: "k-fields-list-wrapper" },
152
- React.createElement(FieldsEditorComponent, __assign({ data: props.data, onExpand: handleFieldsEditorFieldExpand, onCheck: handleFieldsEditorFieldCheck, columnAxes: state.columnAxes, rowAxes: state.rowAxes, measureAxes: state.measureAxes }, FieldsEditorProps))))),
153
- React.createElement(Container, __assign({}, ContainerProps),
154
- React.createElement("div", { className: "k-form-field", onMouseEnter: handleColumnsMouseEnter, onMouseLeave: handleColumnsMouseLeave },
155
- React.createElement(Field, __assign({ name: "columnAxes", field: "columnAxes", component: ColumnAxesLabelComponent }, ColumnAxesLabelProps), localization.toLanguageString(configuratorColumnsTitle, messages[configuratorColumnsTitle]))),
156
- props.valueGetter('columnAxes').length
157
- ? (React.createElement(Field, __assign({ name: "columnAxes", field: "columnAxes", component: ColumnAxesEditorComponent, onMouseEnter: handleColumnsMouseEnter, onMouseLeave: handleColumnsMouseLeave, className: "k-column-fields" }, ColumnAxesEditorProps)))
158
- : (React.createElement("div", { className: "k-settings-description", onMouseEnter: handleColumnsMouseEnter, onMouseLeave: handleColumnsMouseLeave }, localization.toLanguageString(configuratorMissingFields, messages[configuratorMissingFields]))),
159
- React.createElement("div", { className: "k-form-field", onMouseEnter: handleRowsMouseEnter, onMouseLeave: handleRowsMouseLeave },
160
- React.createElement(Field, __assign({ name: "rowAxes", field: "rowAxes", component: RowAxesLabelComponent }, RowAxesLabelProps), localization.toLanguageString(configuratorRowsTitle, messages[configuratorRowsTitle]))),
161
- props.valueGetter('rowAxes').length
162
- ? (React.createElement(Field, __assign({ name: "rowAxes", field: "rowAxes", component: RowAxesEditorComponent, onMouseEnter: handleRowsMouseEnter, onMouseLeave: handleRowsMouseLeave, className: "k-column-fields" }, RowAxesEditorProps)))
163
- : (React.createElement("div", { className: "k-settings-description", onMouseEnter: handleRowsMouseEnter, onMouseLeave: handleRowsMouseLeave }, localization.toLanguageString(configuratorMissingFields, messages[configuratorMissingFields])))),
164
- React.createElement(Container, __assign({}, ContainerProps),
165
- React.createElement("div", { className: "k-form-field", onMouseEnter: handleMeasuresMouseEnter, onMouseLeave: handleMeasuresMouseLeave },
166
- React.createElement(Field, __assign({ name: "measureAxes", field: "measureAxes", component: MeasureAxesLabelComponent }, MeasureAxesLabelProps), localization.toLanguageString(configuratorMeasuresTitle, messages[configuratorMeasuresTitle]))),
167
- props.valueGetter('measureAxes').length
168
- ? (React.createElement(Field, __assign({ name: "measureAxes", field: "measureAxes", component: MeasureAxesEditorComponent, onMouseEnter: handleMeasuresMouseEnter, onMouseLeave: handleMeasuresMouseLeave, className: "k-column-fields" }, MeasureAxesEditorProps)))
169
- : (React.createElement("div", { className: "k-settings-description", onMouseEnter: handleMeasuresMouseEnter, onMouseLeave: handleMeasuresMouseLeave }, localization.toLanguageString(configuratorMissingFields, messages[configuratorMissingFields])))))));
170
- });
171
- var defaultProps = {
172
- data: [],
173
- horizontal: false,
174
- fieldsLabel: Label,
175
- fieldsEditor: PivotGridFieldsEditor,
176
- columnAxesLabel: Label,
177
- columnAxesEditor: PivotGridAxesEditor,
178
- rowAxesLabel: Label,
179
- rowAxesEditor: PivotGridAxesEditor,
180
- measureAxesLabel: Label,
181
- measureAxesEditor: PivotGridAxesEditor,
182
- axesEditor: PivotGridAxesEditor,
183
- onFieldsEditorFieldCheckAction: function (event) {
184
- return ({ type: PIVOT_CONFIGURATOR_ACTION.toggleSelection, payload: event.value });
185
- },
186
- onFieldsEditorFieldExpandAction: function (event) {
187
- return ({ type: PIVOT_CONFIGURATOR_ACTION.toggleExpansion, payload: event.value });
188
- }
189
- };
190
- PivotGridConfiguratorEditor.defaultProps = defaultProps;
191
- PivotGridConfiguratorEditor.displayName = 'KendoReactPivotGridConfiguratorEditor';
@@ -1,22 +0,0 @@
1
- import * as React from 'react';
2
- import { classNames } from '@progress/kendo-react-common';
3
- /**
4
- * Represents the [KendoReact PivotGridContainer component]({% slug api_pivotgrid_pivotgridcontainerprops %}).
5
- */
6
- export var PivotGridContainer = React.forwardRef(function (props, ref) {
7
- var element = React.useRef(null);
8
- var target = React.useRef(null);
9
- React.useImperativeHandle(target, function () { return ({ props: props, element: element.current }); });
10
- React.useImperativeHandle(ref, function () { return target.current; });
11
- return (React.createElement("div", { ref: element, id: props.id, style: props.style, tabIndex: props.tabIndex, className: classNames('k-d-flex k-pos-relative', {
12
- 'k-flex-row': props.configuratorPosition === 'right',
13
- 'k-flex-row-reverse': props.configuratorPosition === 'left',
14
- 'k-flex-column': props.configuratorPosition === 'bottom',
15
- 'k-flex-column-reverse': props.configuratorPosition === 'top'
16
- }, props.className) }, props.children));
17
- });
18
- var defaultProps = {
19
- configuratorPosition: 'right'
20
- };
21
- PivotGridContainer.defaultProps = defaultProps;
22
- PivotGridContainer.displayName = 'KendoReactPivotGridContainer';
@@ -1,74 +0,0 @@
1
- import * as React from 'react';
2
- import { TreeViewProps as KendoReactTreeViewProps } from '@progress/kendo-react-treeview';
3
- import { PivotGridField, PivotGridAxis } from '@progress/kendo-pivotgrid-common';
4
- import { CustomComponent } from '@progress/kendo-react-common';
5
- /**
6
- * @hidden
7
- */
8
- export interface PivotGridFieldsEditorFieldExpandEvent {
9
- target: PivotGridFieldsEditorHandle;
10
- value: PivotGridField;
11
- syntheticEvent: React.SyntheticEvent;
12
- }
13
- /**
14
- * @hidden
15
- */
16
- export interface PivotGridFieldsEditorFieldCheckEvent {
17
- target: PivotGridFieldsEditorHandle;
18
- value: PivotGridField;
19
- syntheticEvent: React.SyntheticEvent;
20
- }
21
- /**
22
- * Represents the props of the [KendoReact PivotGridFieldsEditor component]({% slug api_pivotgrid_pivotgridfieldseditor %}).
23
- */
24
- export interface PivotGridFieldsEditorProps {
25
- /**
26
- * Sets the `data` of the PivotGridConfiguratorEditor.
27
- *
28
- * The `data` represents all fields available in the configurator.
29
- */
30
- data?: PivotGridField[];
31
- /**
32
- * The configuration of the `row` axes.
33
- */
34
- rowAxes?: PivotGridAxis[];
35
- /**
36
- * The configuration of the `column` axes.
37
- */
38
- columnAxes?: PivotGridAxis[];
39
- /**
40
- * The configuration of the `measure` axes.
41
- */
42
- measureAxes?: PivotGridAxis[];
43
- /**
44
- * A callback, fired whenever an `expand` is triggered.
45
- */
46
- onExpand?: (args: PivotGridFieldsEditorFieldExpandEvent) => void;
47
- /**
48
- * A callback, fired whenever a `check` is triggered.
49
- */
50
- onCheck?: (args: PivotGridFieldsEditorFieldCheckEvent) => void;
51
- /**
52
- * Overrides the default `treeView` component.
53
- *
54
- * The default component is: [KendoReactTreeView]({% slug api_treeview_treeview %}).
55
- */
56
- treeView?: CustomComponent<KendoReactTreeViewProps>;
57
- /**
58
- * Overrides the default `noData` component.
59
- *
60
- * The default component is: `() => <div>NO DATA</div>`
61
- */
62
- noData?: CustomComponent<any>;
63
- }
64
- /**
65
- * Represents the object which is passed to the [`ref`](https://reactjs.org/docs/refs-and-the-dom.html) callback of the PivotGridFieldsEditor component.
66
- */
67
- export interface PivotGridFieldsEditorHandle {
68
- props: PivotGridFieldsEditorProps;
69
- element: HTMLDivElement | null;
70
- }
71
- /**
72
- * Represents the [KendoReact PivotGridFieldsEditor component]({% slug api_pivotgrid_pivotgridfieldseditorprops %}).
73
- */
74
- export declare const PivotGridFieldsEditor: React.ForwardRefExoticComponent<PivotGridFieldsEditorProps & React.RefAttributes<PivotGridFieldsEditorHandle | null>>;
@@ -1,90 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
- if (ar || !(i in from)) {
15
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
- ar[i] = from[i];
17
- }
18
- }
19
- return to.concat(ar || Array.prototype.slice.call(from));
20
- };
21
- import * as React from 'react';
22
- import { TreeView as KendoReactTreeView, TreeViewItemPropsContext } from '@progress/kendo-react-treeview';
23
- import { useCustomComponent, canUseRef } from '@progress/kendo-react-common';
24
- import { PivotGridConfiguratorEditorStateContext } from '../shared';
25
- import { recursiveMap, flatMap, extractDefaultFields } from '../utils';
26
- /**
27
- * Represents the [KendoReact PivotGridFieldsEditor component]({% slug api_pivotgrid_pivotgridfieldseditorprops %}).
28
- */
29
- export var PivotGridFieldsEditor = React.forwardRef(function (props, ref) {
30
- var _a = __assign(__assign({}, defaultProps), props), data = _a.data, rowAxes = _a.rowAxes, columnAxes = _a.columnAxes, measureAxes = _a.measureAxes, onExpand = _a.onExpand, onCheck = _a.onCheck;
31
- var treeView = React.useRef(null);
32
- var target = React.useRef(null);
33
- var _b = useCustomComponent(props.treeView || defaultProps.treeView), TreeViewComponent = _b[0], TreeViewProps = _b[1];
34
- var _c = useCustomComponent(props.noData || defaultProps.noData), NoDataComponent = _c[0], NoDataProps = _c[1];
35
- React.useImperativeHandle(target, function () { return ({ props: props, element: treeView.current && treeView.current.element }); });
36
- React.useImperativeHandle(ref, function () { return target.current; });
37
- var state = React.useContext(PivotGridConfiguratorEditorStateContext)[0];
38
- var columnHierarchies = extractDefaultFields(columnAxes);
39
- var rowHierarchies = extractDefaultFields(rowAxes);
40
- var measureHierarchies = extractDefaultFields(measureAxes);
41
- var fieldsFlatMap = flatMap(data);
42
- var checked = fieldsFlatMap.filter(function (f) { return __spreadArray(__spreadArray(__spreadArray([], columnHierarchies, true), rowHierarchies, true), measureHierarchies, true).some(function (h) { return (h === f.uniqueName || h === f.defaultHierarchy); }); });
43
- var map = {
44
- caption: function (node) { return node.dataItem.caption; },
45
- id: function (node) { return node.dataItem.uniqueName; },
46
- value: function (node) { return (node.dataItem.defaultHierarchy || node.dataItem.uniqueName); },
47
- expanded: function (node) { return state.expanded.some(function (e) { return e.uniqueName === node.dataItem.uniqueName; }); },
48
- hasChildren: function (node) { return !('hierarchyUniqueName' in node.dataItem) && !('aggregator' in node.dataItem); },
49
- selectable: function (node) { return !Boolean((!node.hasChildren && !node.dataItem.aggregator && !node.dataItem.measure)
50
- || (node.dataItem.type === 2)
51
- || node.dataItem.uniqueName === '[KPIs]'); },
52
- children: function (node) { return recursiveMap(node.dataItem.children, map, node); },
53
- checked: function (node) { return checked.some(function (s) { return node.dataItem.defaultHierarchy
54
- ? s.defaultHierarchy === node.dataItem.defaultHierarchy
55
- : s.uniqueName === node.dataItem.uniqueName; })
56
- || (node.children.length && node.children.every(function (c) { return c.checked; })); }
57
- };
58
- var handleExpand = function (event) {
59
- if (onExpand) {
60
- onExpand({
61
- value: event.item.dataItem,
62
- target: target.current,
63
- syntheticEvent: event.syntheticEvent
64
- });
65
- }
66
- };
67
- var handleCheck = function (event) {
68
- if (onCheck) {
69
- onCheck({
70
- value: event.item.dataItem,
71
- target: target.current,
72
- syntheticEvent: event.syntheticEvent
73
- });
74
- }
75
- };
76
- var fields = recursiveMap(props.data, map);
77
- return (React.createElement(TreeViewItemPropsContext.Provider, { value: function (p) { return (__assign(__assign({}, p), { checkboxes: p.item.selectable })); } }, (fields && fields.length)
78
- ? React.createElement(TreeViewComponent, __assign({ ref: canUseRef(TreeViewComponent) ? treeView : undefined, data: fields, checkboxes: true, onExpandChange: handleExpand, onCheckChange: handleCheck, textField: 'caption', expandIcons: true, hasChildrenField: "hasChildren", checkIndeterminateField: "checkIndeterminate", childrenField: "children" }, TreeViewProps))
79
- : (React.createElement(NoDataComponent, __assign({}, NoDataProps)))));
80
- });
81
- var defaultProps = {
82
- data: [],
83
- rowAxes: [],
84
- columnAxes: [],
85
- measureAxes: [],
86
- treeView: KendoReactTreeView,
87
- noData: function () { return React.createElement("div", null, "NO DATA"); }
88
- };
89
- PivotGridFieldsEditor.defaultProps = defaultProps;
90
- PivotGridFieldsEditor.displayName = 'KendoReactPivotGridFieldsEditor';
@@ -1,50 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import * as React from 'react';
13
- import { classNames, useMouse, useCustomComponent, IconWrap } from '@progress/kendo-react-common';
14
- import { chevronUpIcon, chevronDownIcon } from '@progress/kendo-svg-icons';
15
- ;
16
- /**
17
- * Represents the [KendoReact PivotGridHeaderCell component]({% slug api_pivotgrid_pivotgridheadercellprops %}).
18
- */
19
- export var PivotGridHeaderCell = React.forwardRef(function (props, ref) {
20
- var target = React.useRef(null);
21
- var element = React.useRef(null);
22
- React.useImperativeHandle(target, function () { return ({
23
- element: element.current,
24
- props: props
25
- }); });
26
- React.useImperativeHandle(ref, function () { return target.current; });
27
- var _a = useCustomComponent(props.icon || defaultProps.icon), IconComponent = _a[0], IconProps = _a[1];
28
- var mouseProps = useMouse(props, target);
29
- var handleIconClick = function (event) {
30
- if (props.onIconClick) {
31
- props.onIconClick.call(undefined, {
32
- syntheticEvent: event.syntheticEvent,
33
- target: target.current
34
- });
35
- }
36
- };
37
- return (React.createElement("th", __assign({ ref: element }, mouseProps, { colSpan: props.colSpan, rowSpan: props.rowSpan, id: props.id, style: props.style, tabIndex: props.tabIndex, role: props.role }, (props.expandable ? { 'aria-expanded': props.expanded } : {}), { className: classNames('k-pivotgrid-cell', {
38
- 'k-pivotgrid-header-total': props.total,
39
- 'k-pivotgrid-header-root': props.root,
40
- 'k-pivotgrid-expanded': props.expanded,
41
- 'k-first': props.first
42
- }, props.className) }),
43
- props.expandable && (React.createElement(IconComponent, __assign({}, IconProps, { onClick: handleIconClick, name: "chevron-".concat(props.expanded ? 'up' : 'down'), "aria-hidden": true, icon: props.expanded ? chevronUpIcon : chevronDownIcon }))),
44
- props.children));
45
- });
46
- var defaultProps = {
47
- icon: IconWrap
48
- };
49
- PivotGridHeaderCell.defaultProps = defaultProps;
50
- PivotGridHeaderCell.displayName = 'KendoReactPivotGridHeaderCell';
@@ -1,28 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import * as React from 'react';
13
- import { classNames, useMouse } from '@progress/kendo-react-common';
14
- /**
15
- * Represents the [KendoReact PivotGridRow component]({% slug api_pivotgrid_pivotgridrowprops %}).
16
- */
17
- export var PivotGridRow = React.forwardRef(function (props, ref) {
18
- var target = React.useRef(null);
19
- var element = React.useRef(null);
20
- React.useImperativeHandle(target, function () { return ({
21
- element: element.current,
22
- props: props
23
- }); });
24
- React.useImperativeHandle(ref, function () { return target.current; });
25
- var mouseProps = useMouse(props, target);
26
- return (React.createElement("tr", __assign({ ref: element }, mouseProps, { id: props.id, style: props.style, tabIndex: props.tabIndex, children: props.children, role: props.role, "aria-owns": props.ariaOwns, className: classNames('k-pivotgrid-row', props.className) })));
27
- });
28
- PivotGridRow.displayName = 'KendoReactPivotGridRow';