@progress/kendo-react-orgchart 5.20.0-dev.202310061256
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/LICENSE.md +11 -0
- package/NOTICE.txt +117 -0
- package/README.md +50 -0
- package/about.md +3 -0
- package/dist/cdn/js/kendo-react-orgchart.js +1 -0
- package/dist/es/OrgChart.d.ts +6 -0
- package/dist/es/OrgChart.js +67 -0
- package/dist/es/OrgChartOperationDescriptors.d.ts +76 -0
- package/dist/es/OrgChartOperationDescriptors.js +2 -0
- package/dist/es/client/ClientOrgChart.d.ts +94 -0
- package/dist/es/client/ClientOrgChart.js +287 -0
- package/dist/es/client/ExpandButton.d.ts +13 -0
- package/dist/es/client/ExpandButton.js +23 -0
- package/dist/es/client/OrgChartCard.d.ts +19 -0
- package/dist/es/client/OrgChartCard.js +68 -0
- package/dist/es/client/OrgChartCardBody.d.ts +12 -0
- package/dist/es/client/OrgChartCardBody.js +13 -0
- package/dist/es/client/OrgChartGroupContainer.d.ts +19 -0
- package/dist/es/client/OrgChartGroupContainer.js +71 -0
- package/dist/es/interfaces/ChildGroup.d.ts +16 -0
- package/dist/es/interfaces/ChildGroup.js +1 -0
- package/dist/es/interfaces/OrgChartActionEvent.d.ts +22 -0
- package/dist/es/interfaces/OrgChartActionEvent.js +1 -0
- package/dist/es/interfaces/OrgChartExpandChangeEvent.d.ts +22 -0
- package/dist/es/interfaces/OrgChartExpandChangeEvent.js +1 -0
- package/dist/es/interfaces/SeverOrgChartProps.d.ts +106 -0
- package/dist/es/interfaces/SeverOrgChartProps.js +1 -0
- package/dist/es/main.d.ts +6 -0
- package/dist/es/main.js +3 -0
- package/dist/es/package-metadata.d.ts +5 -0
- package/dist/es/package-metadata.js +11 -0
- package/dist/es/processOrgChartItems.d.ts +51 -0
- package/dist/es/processOrgChartItems.js +163 -0
- package/dist/es/server/ServerGroupedOrgChart.d.ts +9 -0
- package/dist/es/server/ServerGroupedOrgChart.js +235 -0
- package/dist/es/server/ServerOrgChart.d.ts +9 -0
- package/dist/es/server/ServerOrgChart.js +192 -0
- package/dist/es/server/ServerOrgChartGroup.d.ts +96 -0
- package/dist/es/server/ServerOrgChartGroup.js +59 -0
- package/dist/es/server/ServerOrgChartNode.d.ts +75 -0
- package/dist/es/server/ServerOrgChartNode.js +57 -0
- package/dist/es/theming/theme-service.d.ts +5 -0
- package/dist/es/theming/theme-service.js +62 -0
- package/dist/es/utils/consts.d.ts +72 -0
- package/dist/es/utils/consts.js +72 -0
- package/dist/npm/OrgChart.d.ts +6 -0
- package/dist/npm/OrgChart.js +71 -0
- package/dist/npm/OrgChartOperationDescriptors.d.ts +76 -0
- package/dist/npm/OrgChartOperationDescriptors.js +3 -0
- package/dist/npm/client/ClientOrgChart.d.ts +94 -0
- package/dist/npm/client/ClientOrgChart.js +291 -0
- package/dist/npm/client/ExpandButton.d.ts +13 -0
- package/dist/npm/client/ExpandButton.js +27 -0
- package/dist/npm/client/OrgChartCard.d.ts +19 -0
- package/dist/npm/client/OrgChartCard.js +72 -0
- package/dist/npm/client/OrgChartCardBody.d.ts +12 -0
- package/dist/npm/client/OrgChartCardBody.js +17 -0
- package/dist/npm/client/OrgChartGroupContainer.d.ts +19 -0
- package/dist/npm/client/OrgChartGroupContainer.js +75 -0
- package/dist/npm/interfaces/ChildGroup.d.ts +16 -0
- package/dist/npm/interfaces/ChildGroup.js +2 -0
- package/dist/npm/interfaces/OrgChartActionEvent.d.ts +22 -0
- package/dist/npm/interfaces/OrgChartActionEvent.js +2 -0
- package/dist/npm/interfaces/OrgChartExpandChangeEvent.d.ts +22 -0
- package/dist/npm/interfaces/OrgChartExpandChangeEvent.js +2 -0
- package/dist/npm/interfaces/SeverOrgChartProps.d.ts +106 -0
- package/dist/npm/interfaces/SeverOrgChartProps.js +2 -0
- package/dist/npm/main.d.ts +6 -0
- package/dist/npm/main.js +21 -0
- package/dist/npm/package-metadata.d.ts +5 -0
- package/dist/npm/package-metadata.js +14 -0
- package/dist/npm/processOrgChartItems.d.ts +51 -0
- package/dist/npm/processOrgChartItems.js +167 -0
- package/dist/npm/server/ServerGroupedOrgChart.d.ts +9 -0
- package/dist/npm/server/ServerGroupedOrgChart.js +239 -0
- package/dist/npm/server/ServerOrgChart.d.ts +9 -0
- package/dist/npm/server/ServerOrgChart.js +196 -0
- package/dist/npm/server/ServerOrgChartGroup.d.ts +96 -0
- package/dist/npm/server/ServerOrgChartGroup.js +63 -0
- package/dist/npm/server/ServerOrgChartNode.d.ts +75 -0
- package/dist/npm/server/ServerOrgChartNode.js +61 -0
- package/dist/npm/theming/theme-service.d.ts +5 -0
- package/dist/npm/theming/theme-service.js +65 -0
- package/dist/npm/utils/consts.d.ts +72 -0
- package/dist/npm/utils/consts.js +75 -0
- package/dist/systemjs/kendo-react-orgchart.js +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,57 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
import { classNames } from '@progress/kendo-react-common';
|
|
25
|
+
import { Avatar, CardTitle, CardSubtitle } from '@progress/kendo-react-layout';
|
|
26
|
+
import { ExpandButton } from '../client/ExpandButton';
|
|
27
|
+
import { OrgChartCard } from '../client/OrgChartCard';
|
|
28
|
+
import { OrgChartCardBody } from '../client/OrgChartCardBody';
|
|
29
|
+
var ORGCHARTNODE_CLASSNAME = 'k-orgchart-node';
|
|
30
|
+
;
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
export var ServerOrgChartNode = function (props) {
|
|
35
|
+
var defaultProps = {
|
|
36
|
+
avatarType: 'image'
|
|
37
|
+
};
|
|
38
|
+
var _a = __assign(__assign({}, props), defaultProps), id = _a.id, title = _a.title, subtitle = _a.subtitle, level = _a.level, childLineWidth = _a.childLineWidth, cardWidth = _a.cardWidth, cardHeight = _a.cardHeight, verticalLine = _a.verticalLine, color = _a.color, line = _a.line, plus = _a.plus, expanded = _a.expanded, node = _a.node, avatar = _a.avatar, avatarType = _a.avatarType, itemRender = _a.itemRender, other = __rest(_a, ["id", "title", "subtitle", "level", "childLineWidth", "cardWidth", "cardHeight", "verticalLine", "color", "line", "plus", "expanded", "node", "avatar", "avatarType", "itemRender"]);
|
|
39
|
+
var ItemRender = itemRender;
|
|
40
|
+
return (React.createElement("div", __assign({}, other, { className: classNames(props.className, ORGCHARTNODE_CLASSNAME, 'k-vstack', 'k-align-items-center') }),
|
|
41
|
+
level !== 0 && React.createElement("div", { className: "k-orgchart-line k-orgchart-line-v k-orgchart-line-v-top", style: { height: verticalLine } }),
|
|
42
|
+
React.createElement(OrgChartCard, { node: node, style: { width: cardWidth, height: cardHeight }, "aria-level": level + 1, "aria-expanded": !!expanded, "aria-owns": id },
|
|
43
|
+
React.createElement(OrgChartCardBody, { level: level }, ItemRender
|
|
44
|
+
? React.createElement(ItemRender, { item: node, title: title, subtitle: subtitle, level: level, expanded: expanded, color: color })
|
|
45
|
+
: React.createElement(React.Fragment, null,
|
|
46
|
+
React.createElement(Avatar, { type: avatarType, themeColor: "secondary" }, avatarType === 'image'
|
|
47
|
+
? React.createElement("img", { src: avatar, alt: "KendoReact Avatar Customer Image" })
|
|
48
|
+
: avatar),
|
|
49
|
+
React.createElement("div", { className: "k-card-title-wrap k-vstack" },
|
|
50
|
+
React.createElement(CardTitle, { className: "k-text-ellipsis" }, title),
|
|
51
|
+
React.createElement("span", { className: "k-spacer" }),
|
|
52
|
+
React.createElement(CardSubtitle, { className: "k-text-ellipsis" }, subtitle)),
|
|
53
|
+
React.createElement("span", { className: "k-spacer" })))),
|
|
54
|
+
line && React.createElement("div", { className: "k-orgchart-line k-orgchart-line-v" }),
|
|
55
|
+
plus && React.createElement(ExpandButton, { expanded: expanded, node: node }),
|
|
56
|
+
plus && !!childLineWidth && React.createElement("div", { className: "k-orgchart-line k-orgchart-line-h", style: { width: childLineWidth, marginTop: -15 } })));
|
|
57
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var computedBackgroundColor = function (element) { return window.getComputedStyle(element).backgroundColor; };
|
|
2
|
+
var letterPos = function (letter) { return letter.toLowerCase().charCodeAt(0) - 'a'.charCodeAt(0); };
|
|
3
|
+
var seriesPos = function (name) {
|
|
4
|
+
var alpha = name.match(/series-([a-z])$/);
|
|
5
|
+
if (alpha !== null) {
|
|
6
|
+
return letterPos(alpha[1]);
|
|
7
|
+
}
|
|
8
|
+
var num = name.split('--series-')[1];
|
|
9
|
+
return parseInt(num, 10) - 1;
|
|
10
|
+
};
|
|
11
|
+
var SERIES_COLORS = 30;
|
|
12
|
+
var seriesTemplate = function () {
|
|
13
|
+
var result = "\n <div class=\"k-var--series-a\"></div>\n <div class=\"k-var--series-b\"></div>\n <div class=\"k-var--series-c\"></div>\n <div class=\"k-var--series-d\"></div>\n <div class=\"k-var--series-e\"></div>\n <div class=\"k-var--series-f\"></div>\n";
|
|
14
|
+
for (var i = 0; i < SERIES_COLORS; i++) {
|
|
15
|
+
result += "\n <div class=\"k-var--series-".concat(i + 1, "\"></div>");
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
var template = "\n <div class=\"k-var--series-unset\"></div>\n <div class=\"k-var--series\">\n ".concat(seriesTemplate(), "\n </div>\n");
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
var ThemeService = /** @class */ (function () {
|
|
24
|
+
function ThemeService() {
|
|
25
|
+
}
|
|
26
|
+
ThemeService.prototype.getSeriesColors = function () {
|
|
27
|
+
var element = this.element;
|
|
28
|
+
var series = [].slice.call(element.querySelectorAll('.k-var--series div'));
|
|
29
|
+
var unsetColor = computedBackgroundColor(element.querySelector('.k-var--series-unset'));
|
|
30
|
+
var seriesColors = series.reduce(function (arr, el) {
|
|
31
|
+
var pos = seriesPos(el.className);
|
|
32
|
+
var color = computedBackgroundColor(el);
|
|
33
|
+
if (color !== unsetColor) {
|
|
34
|
+
arr[pos] = color;
|
|
35
|
+
}
|
|
36
|
+
return arr;
|
|
37
|
+
}, [] // Will populate the series colors in this array
|
|
38
|
+
);
|
|
39
|
+
return seriesColors;
|
|
40
|
+
};
|
|
41
|
+
return ThemeService;
|
|
42
|
+
}());
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
var loadTheme = function (done, doc) {
|
|
47
|
+
var service = new ThemeService();
|
|
48
|
+
var container = service.element = doc.createElement('div');
|
|
49
|
+
container.style.display = 'none';
|
|
50
|
+
container.innerHTML = template;
|
|
51
|
+
doc.body.appendChild(container);
|
|
52
|
+
var seriesColors;
|
|
53
|
+
try {
|
|
54
|
+
seriesColors = service.getSeriesColors();
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
doc.body.removeChild(service.element);
|
|
58
|
+
delete service.element;
|
|
59
|
+
done(seriesColors);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export { loadTheme };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export declare const EXPAND_FIELD = "expanded";
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export declare const TEXT_FIELD = "text";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const DISABLED_FIELD = "disabled";
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export declare const CHILDREN_FIELD = "items";
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export declare const HAS_CHILDREN_FIELD = "hasChildren";
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export declare const SELECT_FIELD = "selected";
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export declare const CHECK_FIELD = "checked";
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export declare const CHECK_INDETERMINATE_FIELD = "checkIndeterminate";
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export declare const DOM_KENDO_ITEM_ID_FIELD = "_kendoItemId";
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
export declare const DOM_KENDO_TREEVIEW_GUID_FIELD = "_kendoOrgChartGuid";
|
|
41
|
+
/**
|
|
42
|
+
* @hidden
|
|
43
|
+
*/
|
|
44
|
+
export declare const ORGCHART_CLASSNAME = "k-orgchart";
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
48
|
+
export declare const NODE_HEIGHT = 80;
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export declare const NODE_WIDTH = 300;
|
|
53
|
+
/**
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
export declare const HORIZONTAL_GAP = 25;
|
|
57
|
+
/**
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
export declare const VERTICAL_LINE = 40;
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
export declare const GROUP_TITLE_HEIGHT = 20;
|
|
65
|
+
/**
|
|
66
|
+
* @hidden
|
|
67
|
+
*/
|
|
68
|
+
export declare const GROUP_SUBTITLE_HEIGHT = 20;
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
export declare const GROUP_PADDINGS = 82;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export var EXPAND_FIELD = 'expanded';
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export var TEXT_FIELD = 'text';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export var DISABLED_FIELD = 'disabled';
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export var CHILDREN_FIELD = 'items';
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export var HAS_CHILDREN_FIELD = 'hasChildren';
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export var SELECT_FIELD = 'selected';
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export var CHECK_FIELD = 'checked';
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export var CHECK_INDETERMINATE_FIELD = 'checkIndeterminate';
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export var DOM_KENDO_ITEM_ID_FIELD = '_kendoItemId';
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
export var DOM_KENDO_TREEVIEW_GUID_FIELD = '_kendoOrgChartGuid';
|
|
41
|
+
/**
|
|
42
|
+
* @hidden
|
|
43
|
+
*/
|
|
44
|
+
export var ORGCHART_CLASSNAME = 'k-orgchart';
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
48
|
+
export var NODE_HEIGHT = 80;
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export var NODE_WIDTH = 300;
|
|
53
|
+
/**
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
export var HORIZONTAL_GAP = 25;
|
|
57
|
+
/**
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
export var VERTICAL_LINE = 40;
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
export var GROUP_TITLE_HEIGHT = 20;
|
|
65
|
+
/**
|
|
66
|
+
* @hidden
|
|
67
|
+
*/
|
|
68
|
+
export var GROUP_SUBTITLE_HEIGHT = 20;
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
export var GROUP_PADDINGS = 82;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.OrgChart = void 0;
|
|
26
|
+
var React = require("react");
|
|
27
|
+
var PropTypes = require("prop-types");
|
|
28
|
+
var package_metadata_1 = require("./package-metadata");
|
|
29
|
+
var ServerOrgChart_1 = require("./server/ServerOrgChart");
|
|
30
|
+
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
31
|
+
var ServerGroupedOrgChart_1 = require("./server/ServerGroupedOrgChart");
|
|
32
|
+
var ClientOrgChart_1 = require("./client/ClientOrgChart");
|
|
33
|
+
/**
|
|
34
|
+
* Represents the OrgChart component.
|
|
35
|
+
*/
|
|
36
|
+
var OrgChart = function (props) {
|
|
37
|
+
var combinedProps = __assign({ tabIndex: 0, navigatable: true, expandField: 'expanded', ariaLabel: 'Org Chart', idField: 'id', childrenField: 'items', avatarField: 'avatar', titleField: 'title', subTitleField: 'subtitle' }, props);
|
|
38
|
+
var cardsColors = combinedProps.cardsColors, onExpandChange = combinedProps.onExpandChange, onKeyDown = combinedProps.onKeyDown, onItemAction = combinedProps.onItemAction, onGroupAction = combinedProps.onGroupAction, onGroupBlur = combinedProps.onGroupBlur, onGroupFocus = combinedProps.onGroupFocus, id = combinedProps.id, other = __rest(combinedProps, ["cardsColors", "onExpandChange", "onKeyDown", "onItemAction", "onGroupAction", "onGroupBlur", "onGroupFocus", "id"]);
|
|
39
|
+
var generateId = React.useRef((0, kendo_react_common_1.guid)());
|
|
40
|
+
(0, kendo_react_common_1.validatePackage)(package_metadata_1.packageMetadata);
|
|
41
|
+
return (React.createElement(ClientOrgChart_1.ClientOrgChart, __assign({}, combinedProps), props.groupField
|
|
42
|
+
? React.createElement(ServerGroupedOrgChart_1.ServerGroupedOrgChart, __assign({ id: id || generateId.current }, other), props.children)
|
|
43
|
+
: React.createElement(ServerOrgChart_1.ServerOrgChart, __assign({ id: id || generateId.current }, other), props.children)));
|
|
44
|
+
};
|
|
45
|
+
exports.OrgChart = OrgChart;
|
|
46
|
+
exports.OrgChart.propTypes = {
|
|
47
|
+
className: PropTypes.string,
|
|
48
|
+
style: PropTypes.object,
|
|
49
|
+
id: PropTypes.string,
|
|
50
|
+
ariaLabel: PropTypes.string,
|
|
51
|
+
idField: PropTypes.string,
|
|
52
|
+
childrenField: PropTypes.string,
|
|
53
|
+
expandField: PropTypes.string,
|
|
54
|
+
titleField: PropTypes.string,
|
|
55
|
+
hasChildrenField: PropTypes.string,
|
|
56
|
+
subTitleField: PropTypes.string,
|
|
57
|
+
avatarField: PropTypes.string,
|
|
58
|
+
cardsColors: PropTypes.array,
|
|
59
|
+
data: PropTypes.array,
|
|
60
|
+
groupField: PropTypes.string,
|
|
61
|
+
cardHeight: PropTypes.number,
|
|
62
|
+
cardWidth: PropTypes.number,
|
|
63
|
+
groupTitleHeight: PropTypes.number,
|
|
64
|
+
groupSubtitleHeight: PropTypes.number,
|
|
65
|
+
verticalLine: PropTypes.number,
|
|
66
|
+
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
67
|
+
onExpandChange: PropTypes.func,
|
|
68
|
+
onItemAction: PropTypes.func,
|
|
69
|
+
onGroupAction: PropTypes.func
|
|
70
|
+
};
|
|
71
|
+
exports.OrgChart.displayName = 'KendoOrgChart';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The descriptors of the data operations which are applied to the OrgChart component.
|
|
3
|
+
*/
|
|
4
|
+
export interface OrgChartOperationDescriptors {
|
|
5
|
+
/**
|
|
6
|
+
* The hierarchical indices of the items to which the expand operation will be applied, or the descriptor of the operation.
|
|
7
|
+
*/
|
|
8
|
+
expand?: string[] | OrgChartOperationDescriptor;
|
|
9
|
+
/**
|
|
10
|
+
* The hierarchical indices of the items to which the select operation will be applied, or the descriptor of the operation.
|
|
11
|
+
*/
|
|
12
|
+
select?: string[] | OrgChartOperationDescriptor;
|
|
13
|
+
/**
|
|
14
|
+
* The hierarchical indices of the items to which the check operation will be applied, or the descriptor of the operation.
|
|
15
|
+
*/
|
|
16
|
+
check?: string[] | OrgChartCheckDescriptor;
|
|
17
|
+
/**
|
|
18
|
+
* When the operations are applied, the corresponding items and their parents are cloned.
|
|
19
|
+
* For performance reasons, OrgChart items are cloned only once.
|
|
20
|
+
* The name of the field which provides a Boolean representation of whether an item is already cloned.
|
|
21
|
+
* Defaults to `cloned`.
|
|
22
|
+
*/
|
|
23
|
+
cloneField?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The expand field of the item.
|
|
26
|
+
*/
|
|
27
|
+
expandField?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The select field of the item.
|
|
30
|
+
*/
|
|
31
|
+
selectField?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The check field of the item.
|
|
34
|
+
*/
|
|
35
|
+
checkField?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The children field of the item.
|
|
38
|
+
*/
|
|
39
|
+
childrenField?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The descriptor which is used for expanding, selecting, and checking.
|
|
43
|
+
*/
|
|
44
|
+
export interface OrgChartOperationDescriptor {
|
|
45
|
+
/**
|
|
46
|
+
* The IDs of the items to which the operation will be applied. By default, the OrgChart applies the hierarchical indices of the items. These indices are zero-based. The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index.
|
|
47
|
+
*/
|
|
48
|
+
ids?: any[];
|
|
49
|
+
/**
|
|
50
|
+
* The name of the field which will provide a Boolean representation for the operation state of the item.
|
|
51
|
+
*
|
|
52
|
+
* The default fields are:
|
|
53
|
+
* * `expanded`—Indicates that an item is expanded.
|
|
54
|
+
* * `selected`—Indicates that an item is selected.
|
|
55
|
+
* * `checked`—Indicates that an item is checked.
|
|
56
|
+
*/
|
|
57
|
+
operationField?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The name of the field which will uniquely describe an item as an alternative to its hierarchical index.
|
|
60
|
+
*/
|
|
61
|
+
idField?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The descriptor which is used for checking.
|
|
65
|
+
*/
|
|
66
|
+
export interface OrgChartCheckDescriptor extends OrgChartOperationDescriptor {
|
|
67
|
+
/**
|
|
68
|
+
* Determines if a parent item will have an indeterminate state when not all its children are checked.
|
|
69
|
+
*/
|
|
70
|
+
applyCheckIndeterminate?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* The name of the field which will provide a Boolean representation for the indeterminate state of a parent item.
|
|
73
|
+
* Defaults to `checkIndeterminate`.
|
|
74
|
+
*/
|
|
75
|
+
checkIndeterminateField?: string;
|
|
76
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
import { ServerOrgChartProps } from '../interfaces/SeverOrgChartProps';
|
|
4
|
+
import { OrgChartActionEvent } from '../interfaces/OrgChartActionEvent';
|
|
5
|
+
import { OrgChartExpandChangeEvent } from '../main';
|
|
6
|
+
/**
|
|
7
|
+
* Represents the props of the [KendoReact OrgChart component]({% slug overview_orgchart %}).
|
|
8
|
+
*/
|
|
9
|
+
export interface OrgChartProps extends ServerOrgChartProps {
|
|
10
|
+
/**
|
|
11
|
+
* Specifies if the OrgChart can be navigatable with keyboard.
|
|
12
|
+
* Defaults to `true`.
|
|
13
|
+
*/
|
|
14
|
+
navigatable?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Fires when a node or group is expanded.
|
|
17
|
+
*/
|
|
18
|
+
onExpandChange?: (ev: OrgChartExpandChangeEvent) => void;
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
onKeyDown?: (ev: OrgChartActionEvent) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Triggers the item action event.
|
|
25
|
+
*/
|
|
26
|
+
onItemAction?: (ev: OrgChartActionEvent) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Triggers the item double click action event.
|
|
29
|
+
*/
|
|
30
|
+
onItemDoubleClick?: (ev: OrgChartActionEvent) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Triggers the item contextmenu action event.
|
|
33
|
+
*/
|
|
34
|
+
onItemContextMenu?: (ev: OrgChartActionEvent) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Triggers the group action event.
|
|
37
|
+
*/
|
|
38
|
+
onGroupAction?: (ev: OrgChartActionEvent) => void;
|
|
39
|
+
/**
|
|
40
|
+
* @hidden
|
|
41
|
+
*/
|
|
42
|
+
onGroupBlur?: (ev: OrgChartActionEvent) => void;
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
onGroupFocus?: (ev: OrgChartActionEvent) => void;
|
|
47
|
+
}
|
|
48
|
+
declare type OrgChartEventsContextType = {
|
|
49
|
+
cardColors?: string[];
|
|
50
|
+
onExpandChange?: (ev: OrgChartExpandChangeEvent) => void;
|
|
51
|
+
onKeyDown?: (ev: OrgChartActionEvent) => void;
|
|
52
|
+
onItemAction?: (ev: OrgChartActionEvent) => void;
|
|
53
|
+
onItemContextMenu?: (ev: OrgChartActionEvent) => void;
|
|
54
|
+
onItemDoubleClick?: (ev: OrgChartActionEvent) => void;
|
|
55
|
+
onGroupAction?: (ev: OrgChartActionEvent) => void;
|
|
56
|
+
onGroupBlur?: (ev: OrgChartActionEvent) => void;
|
|
57
|
+
onGroupFocus?: (ev: OrgChartActionEvent) => void;
|
|
58
|
+
};
|
|
59
|
+
export declare const OrgChartEventsContextContext: React.Context<OrgChartEventsContextType>;
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
export declare const ClientOrgChart: {
|
|
64
|
+
(props: OrgChartProps): JSX.Element;
|
|
65
|
+
propTypes: {
|
|
66
|
+
className: PropTypes.Requireable<string>;
|
|
67
|
+
style: PropTypes.Requireable<object>;
|
|
68
|
+
id: PropTypes.Requireable<string>;
|
|
69
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
70
|
+
idField: PropTypes.Requireable<string>;
|
|
71
|
+
childrenField: PropTypes.Requireable<string>;
|
|
72
|
+
expandField: PropTypes.Requireable<string>;
|
|
73
|
+
titleField: PropTypes.Requireable<string>;
|
|
74
|
+
hasChildrenField: PropTypes.Requireable<string>;
|
|
75
|
+
subTitleField: PropTypes.Requireable<string>;
|
|
76
|
+
avatarField: PropTypes.Requireable<string>;
|
|
77
|
+
cardsColors: PropTypes.Requireable<any[]>;
|
|
78
|
+
data: PropTypes.Requireable<any[]>;
|
|
79
|
+
groupField: PropTypes.Requireable<string>;
|
|
80
|
+
cardHeight: PropTypes.Requireable<number>;
|
|
81
|
+
cardWidth: PropTypes.Requireable<number>;
|
|
82
|
+
groupTitleHeight: PropTypes.Requireable<number>;
|
|
83
|
+
groupSubtitleHeight: PropTypes.Requireable<number>;
|
|
84
|
+
verticalLine: PropTypes.Requireable<number>;
|
|
85
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
86
|
+
onExpandChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
87
|
+
onItemAction: PropTypes.Requireable<(...args: any[]) => any>;
|
|
88
|
+
onItemDoubleClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
89
|
+
onItemContextMenu: PropTypes.Requireable<(...args: any[]) => any>;
|
|
90
|
+
onGroupAction: PropTypes.Requireable<(...args: any[]) => any>;
|
|
91
|
+
};
|
|
92
|
+
displayName: string;
|
|
93
|
+
};
|
|
94
|
+
export {};
|