@progress/kendo-react-layout 5.17.0-dev.202308101212 → 5.17.0-dev.202308110815
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/cdn/js/kendo-react-layout.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/panelbar/interfaces/PanelBarItemProps.d.ts +2 -1
- package/dist/es/panelbar/interfaces/PanelBarItemProps.js +1 -0
- package/dist/es/timeline/Timeline.d.ts +8 -0
- package/dist/es/timeline/Timeline.js +6 -5
- package/dist/es/timeline/TimelineCard.d.ts +1 -0
- package/dist/es/timeline/TimelineCard.js +1 -1
- package/dist/es/timeline/TimelineHorizontal.js +100 -14
- package/dist/es/timeline/TimelineVertical.js +43 -4
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.d.ts +2 -1
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.js +1 -0
- package/dist/npm/timeline/Timeline.d.ts +8 -0
- package/dist/npm/timeline/Timeline.js +6 -5
- package/dist/npm/timeline/TimelineCard.d.ts +1 -0
- package/dist/npm/timeline/TimelineCard.js +1 -1
- package/dist/npm/timeline/TimelineHorizontal.js +99 -13
- package/dist/npm/timeline/TimelineVertical.js +42 -3
- package/dist/systemjs/kendo-react-layout.js +1 -1
- package/package.json +13 -13
|
@@ -10,11 +10,50 @@ var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
|
10
10
|
var TimelineVertical = function (props) {
|
|
11
11
|
var intl = (0, kendo_react_intl_1.useInternationalization)();
|
|
12
12
|
var _a = React.useState(), eventsList = _a[0], setEventsList = _a[1];
|
|
13
|
-
var collapsibleEvents = props.collapsibleEvents, transitionDuration = props.transitionDuration, eventsData = props.eventsData, dateFormat = props.dateFormat, alterMode = props.alterMode, onChange = props.onChange, onActionClick = props.onActionClick;
|
|
13
|
+
var collapsibleEvents = props.collapsibleEvents, transitionDuration = props.transitionDuration, eventsData = props.eventsData, dateFormat = props.dateFormat, alterMode = props.alterMode, navigatable = props.navigatable, onChange = props.onChange, onActionClick = props.onActionClick;
|
|
14
|
+
var eventAxisRef = React.useRef(null);
|
|
15
|
+
var navigation = React.useRef(new kendo_react_common_1.Navigation({
|
|
16
|
+
tabIndex: 0,
|
|
17
|
+
root: eventAxisRef,
|
|
18
|
+
selectors: ['.k-card-vertical']
|
|
19
|
+
}));
|
|
20
|
+
React.useEffect(function () {
|
|
21
|
+
if (eventAxisRef.current) {
|
|
22
|
+
if (props.navigatable) {
|
|
23
|
+
setTimeout(function () {
|
|
24
|
+
var firstCell = navigation.current.first;
|
|
25
|
+
if (firstCell) {
|
|
26
|
+
firstCell.setAttribute('tabindex', String(0));
|
|
27
|
+
}
|
|
28
|
+
}, 0);
|
|
29
|
+
navigation.current.keyboardEvents = {
|
|
30
|
+
keydown: {
|
|
31
|
+
'Space': onEnter,
|
|
32
|
+
'Enter': onEnter
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}, [props.navigatable]);
|
|
14
38
|
React.useEffect(function () {
|
|
15
39
|
setEventsList((0, utils_1.addYearsFlags)(eventsData));
|
|
16
40
|
}, []);
|
|
17
|
-
|
|
41
|
+
React.useEffect(function () {
|
|
42
|
+
navigation.current.update();
|
|
43
|
+
});
|
|
44
|
+
var handleKeyDown = function (e) {
|
|
45
|
+
if (navigatable && navigation.current) {
|
|
46
|
+
navigation.current.triggerKeyboardEvent(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var onEnter = function (target, _nav, ev) {
|
|
50
|
+
ev.preventDefault();
|
|
51
|
+
var element = target.querySelector('.k-card-title .k-event-collapse');
|
|
52
|
+
if (element) {
|
|
53
|
+
element.click();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return (React.createElement("ul", { ref: eventAxisRef, onKeyDown: handleKeyDown }, eventsList && eventsList.map(function (event, index) {
|
|
18
57
|
var cardId = (0, kendo_react_common_1.guid)();
|
|
19
58
|
return (React.createElement(React.Fragment, { key: index }, event.yearFlag
|
|
20
59
|
? (React.createElement("li", { className: "k-timeline-flag-wrap" },
|
|
@@ -23,7 +62,7 @@ var TimelineVertical = function (props) {
|
|
|
23
62
|
React.createElement("div", { className: "k-timeline-date-wrap" },
|
|
24
63
|
React.createElement("span", { className: "k-timeline-date", id: cardId }, intl.formatDate(event.date, dateFormat))),
|
|
25
64
|
React.createElement("a", { className: "k-timeline-circle" }),
|
|
26
|
-
React.createElement(TimelineCard_1.TimelineCard, { id: cardId, tabindex: 0, eventData: event, alternated: alterMode && index % 2 !== 0, collapsible: collapsibleEvents, transitionDuration: transitionDuration, onChange: onChange, onActionClick: onActionClick })))));
|
|
65
|
+
React.createElement(TimelineCard_1.TimelineCard, { id: cardId, tabindex: navigatable ? 0 : -1, eventData: event, alternated: alterMode && index % 2 !== 0, collapsible: collapsibleEvents, transitionDuration: transitionDuration, onChange: onChange, onActionClick: onActionClick })))));
|
|
27
66
|
})));
|
|
28
67
|
};
|
|
29
68
|
exports.TimelineVertical = TimelineVertical;
|