@progress/kendo-react-layout 14.5.0-develop.7 → 14.5.0-develop.9
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/actionsheet/ActionSheet.d.ts +12 -0
- package/actionsheet/ActionSheet.js +1 -1
- package/actionsheet/ActionSheet.mjs +60 -58
- package/appbar/interfaces/AppBarProps.d.ts +2 -14
- package/bottomnavigation/BottomNavigation.js +1 -1
- package/bottomnavigation/BottomNavigation.mjs +24 -35
- package/bottomnavigation/BottomNavigationProps.d.ts +3 -13
- package/card/Avatar.js +1 -1
- package/card/Avatar.mjs +14 -26
- package/card/interfaces/AvatarProps.d.ts +1 -8
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.d.ts +1 -1
- package/drawer/DrawerContent.d.ts +1 -1
- package/drawer/DrawerItem.d.ts +1 -1
- package/menu/components/MenuItemArrow.d.ts +3 -3
- package/menu/components/MenuItemArrow.js +1 -1
- package/menu/components/MenuItemArrow.mjs +13 -23
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +14 -9
- package/splitter/SplitterBar.js +1 -1
- package/splitter/SplitterBar.mjs +65 -64
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +1 -1
- package/tabstrip/TabStripNavigation.js +1 -1
- package/tabstrip/TabStripNavigation.mjs +31 -31
- package/timeline/TimelineCard.js +1 -1
- package/timeline/TimelineCard.mjs +13 -5
- package/timeline/TimelineHorizontal.js +1 -1
- package/timeline/TimelineHorizontal.mjs +39 -39
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
import * as n from "react";
|
|
9
9
|
import r from "prop-types";
|
|
10
10
|
import { TabStripNavigationItem as bt } from "./TabStripNavigationItem.mjs";
|
|
11
|
-
import { classNames as
|
|
11
|
+
import { classNames as B } from "@progress/kendo-react-common";
|
|
12
12
|
import { Button as pt } from "@progress/kendo-react-buttons";
|
|
13
|
-
import {
|
|
13
|
+
import { chevronLeftIcon as Z, chevronRightIcon as tt, chevronDownIcon as ut, chevronUpIcon as dt } from "@progress/kendo-svg-icons";
|
|
14
14
|
import { useLocalization as vt } from "@progress/kendo-react-intl";
|
|
15
15
|
import { nextArrowTitle as ot, messages as et, prevArrowTitle as nt } from "./messages/index.mjs";
|
|
16
16
|
const ht = (P) => Array.from({ length: P }), S = "smooth", p = "prev", h = "next", lt = (P) => {
|
|
17
17
|
const {
|
|
18
18
|
selected: g,
|
|
19
19
|
tabPosition: m,
|
|
20
|
-
tabAlignment:
|
|
20
|
+
tabAlignment: O,
|
|
21
21
|
children: k,
|
|
22
|
-
onSelect:
|
|
23
|
-
onKeyDown:
|
|
22
|
+
onSelect: R,
|
|
23
|
+
onKeyDown: A,
|
|
24
24
|
onScroll: T,
|
|
25
25
|
navItemId: E,
|
|
26
26
|
contentPanelId: M,
|
|
@@ -40,32 +40,32 @@ const ht = (P) => Array.from({ length: P }), S = "smooth", p = "prev", h = "next
|
|
|
40
40
|
} = P, st = n.useRef(null), I = rt || st, L = vt(), u = n.useCallback(() => /top|bottom/.test(m || "top"), [m]), v = n.useCallback(() => K === "rtl", [K]), V = n.useCallback(() => {
|
|
41
41
|
const t = I.current, o = t == null ? void 0 : t.children[g || 0];
|
|
42
42
|
if (o instanceof HTMLElement && t instanceof HTMLElement) {
|
|
43
|
-
const l = u(),
|
|
43
|
+
const l = u(), a = l ? t.offsetWidth : t.offsetHeight, s = l ? o.offsetWidth : o.offsetHeight, f = l ? "left" : "top";
|
|
44
44
|
let e = l ? t.scrollLeft : t.scrollTop, c = 0;
|
|
45
45
|
if (v()) {
|
|
46
|
-
const
|
|
47
|
-
e = e * -1,
|
|
46
|
+
const i = o.offsetLeft;
|
|
47
|
+
e = e * -1, i < 0 ? (c = i - s + t.offsetLeft, t.scrollTo({ [f]: c, behavior: S })) : i + s > a - e && (c = e + i - s, t.scrollTo({ [f]: c, behavior: S }));
|
|
48
48
|
} else {
|
|
49
|
-
const
|
|
50
|
-
e +
|
|
49
|
+
const i = l ? o.offsetLeft - t.offsetLeft : o.offsetTop - t.offsetTop;
|
|
50
|
+
e + a < i + s ? (c = i + s - a, t.scrollTo({ [f]: c, behavior: S })) : e > i && (c = i, t.scrollTo({ [f]: c, behavior: S }));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}, [I, g, u, v]);
|
|
54
54
|
n.useEffect(() => {
|
|
55
55
|
H && V();
|
|
56
56
|
}, [H, g, V]);
|
|
57
|
-
const
|
|
57
|
+
const x = n.useCallback(() => {
|
|
58
58
|
T == null || T();
|
|
59
59
|
}, [T]), X = n.useCallback(
|
|
60
60
|
(t, o) => {
|
|
61
61
|
const l = I.current;
|
|
62
62
|
if (!l)
|
|
63
63
|
return;
|
|
64
|
-
const
|
|
65
|
-
let e =
|
|
64
|
+
const a = u(), s = a ? l.scrollWidth - l.offsetWidth : l.scrollHeight - l.offsetHeight, f = (o.type === "click" ? D : W) || 0;
|
|
65
|
+
let e = a ? l.scrollLeft : l.scrollTop;
|
|
66
66
|
v() && u() ? (t === p && e < 0 && (e += f), t === h && e < s && (e -= f), e = Math.min(0, Math.min(s, e))) : (t === p && e > 0 && (e -= f), t === h && e < s && (e += f), e = Math.max(0, Math.min(s, e)));
|
|
67
67
|
const c = o.type === "click" ? S : void 0;
|
|
68
|
-
|
|
68
|
+
a ? l.scrollTo({ left: e, behavior: c }) : l.scrollTo({ top: e, behavior: c });
|
|
69
69
|
},
|
|
70
70
|
[I, u, v, D, W]
|
|
71
71
|
), N = n.useCallback(
|
|
@@ -85,7 +85,7 @@ const ht = (P) => Array.from({ length: P }), S = "smooth", p = "prev", h = "next
|
|
|
85
85
|
[N]
|
|
86
86
|
), z = n.useCallback(
|
|
87
87
|
(t) => {
|
|
88
|
-
const o = u(), l = v(), s = o ? l ? "
|
|
88
|
+
const o = u(), l = v(), s = o ? l ? "chevron-right" : "chevron-left" : "chevron-up", e = o ? l ? tt : Z : dt, i = o ? l ? "chevron-left" : "chevron-right" : "chevron-down", it = o ? l ? Z : tt : ut, w = {
|
|
89
89
|
prev: {
|
|
90
90
|
arrowTab: "k-tabstrip-prev",
|
|
91
91
|
fontIcon: s,
|
|
@@ -94,16 +94,16 @@ const ht = (P) => Array.from({ length: P }), S = "smooth", p = "prev", h = "next
|
|
|
94
94
|
},
|
|
95
95
|
next: {
|
|
96
96
|
arrowTab: "k-tabstrip-next",
|
|
97
|
-
fontIcon:
|
|
98
|
-
svgIcon:
|
|
97
|
+
fontIcon: i,
|
|
98
|
+
svgIcon: it,
|
|
99
99
|
title: L.toLanguageString(ot, et[ot])
|
|
100
100
|
}
|
|
101
|
-
},
|
|
101
|
+
}, at = (t === p ? $ : _) || pt, ft = t === p ? j : q, mt = d === null || t === p && (d === "start" || d === "top") || t === h && (d === "end" || d === "bottom");
|
|
102
102
|
return /* @__PURE__ */ n.createElement(
|
|
103
|
-
|
|
103
|
+
at,
|
|
104
104
|
{
|
|
105
105
|
disabled: mt,
|
|
106
|
-
className:
|
|
106
|
+
className: B(`${w[t].arrowTab}`),
|
|
107
107
|
onClick: ft,
|
|
108
108
|
icon: w[t].fontIcon,
|
|
109
109
|
svgIcon: w[t].svgIcon,
|
|
@@ -126,7 +126,7 @@ const ht = (P) => Array.from({ length: P }), S = "smooth", p = "prev", h = "next
|
|
|
126
126
|
L
|
|
127
127
|
]
|
|
128
128
|
), G = n.Children.count(k), J = n.Children.toArray(k), Q = n.useMemo(() => k ? ht(G).map((t, o, l) => {
|
|
129
|
-
const
|
|
129
|
+
const a = {
|
|
130
130
|
active: g === o,
|
|
131
131
|
disabled: J[o].props.disabled,
|
|
132
132
|
index: o,
|
|
@@ -136,19 +136,19 @@ const ht = (P) => Array.from({ length: P }), S = "smooth", p = "prev", h = "next
|
|
|
136
136
|
contentPanelId: M,
|
|
137
137
|
renderAllContent: F,
|
|
138
138
|
id: E,
|
|
139
|
-
onSelect:
|
|
140
|
-
onScroll:
|
|
139
|
+
onSelect: R,
|
|
140
|
+
onScroll: x
|
|
141
141
|
};
|
|
142
|
-
return /* @__PURE__ */ n.createElement(bt, { key: `${E}-${o}`, ...
|
|
143
|
-
}) : null, [k, G, g, M, F, E,
|
|
144
|
-
() =>
|
|
142
|
+
return /* @__PURE__ */ n.createElement(bt, { key: `${E}-${o}`, ...a });
|
|
143
|
+
}) : null, [k, G, g, M, F, E, R, x]), ct = n.useMemo(
|
|
144
|
+
() => B("k-tabstrip-items-wrapper k-tabstrip-items-wrapper-scroll", {
|
|
145
145
|
"k-hstack": m === "top" || m === "bottom",
|
|
146
146
|
"k-vstack": m === "left" || m === "right"
|
|
147
147
|
}),
|
|
148
148
|
[m]
|
|
149
149
|
), Y = n.useMemo(
|
|
150
|
-
() =>
|
|
151
|
-
[
|
|
150
|
+
() => B("k-tabstrip-items k-tabstrip-items-scroll k-reset", `k-tabstrip-items-${O}`),
|
|
151
|
+
[O]
|
|
152
152
|
);
|
|
153
153
|
return /* @__PURE__ */ n.createElement("div", { className: ct }, H ? /* @__PURE__ */ n.createElement(n.Fragment, null, C !== "hidden" && b && ["split", "start", "around", "before"].includes(b) && z(p), C !== "hidden" && (b === "start" || b === "before") && z(h), /* @__PURE__ */ n.createElement(
|
|
154
154
|
"ul",
|
|
@@ -157,12 +157,12 @@ const ht = (P) => Array.from({ length: P }), S = "smooth", p = "prev", h = "next
|
|
|
157
157
|
className: Y,
|
|
158
158
|
role: "tablist",
|
|
159
159
|
tabIndex: y,
|
|
160
|
-
onKeyDown:
|
|
161
|
-
onScroll:
|
|
160
|
+
onKeyDown: A,
|
|
161
|
+
onScroll: x,
|
|
162
162
|
"aria-orientation": m === "left" || m === "right" ? "vertical" : void 0
|
|
163
163
|
},
|
|
164
164
|
Q
|
|
165
|
-
), C !== "hidden" && (b === "end" || b === "after") && z(p), C !== "hidden" && b && ["split", "end", "around", "after"].includes(b) && z(h)) : /* @__PURE__ */ n.createElement("ul", { className: Y, role: "tablist", tabIndex: y, onKeyDown:
|
|
165
|
+
), C !== "hidden" && (b === "end" || b === "after") && z(p), C !== "hidden" && b && ["split", "end", "around", "after"].includes(b) && z(h)) : /* @__PURE__ */ n.createElement("ul", { className: Y, role: "tablist", tabIndex: y, onKeyDown: A }, Q));
|
|
166
166
|
};
|
|
167
167
|
lt.propTypes = {
|
|
168
168
|
children: r.oneOfType([r.element, r.arrayOf(r.element)]),
|
package/timeline/TimelineCard.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),k=require("prop-types"),y=require("../card/Card.js"),A=require("../card/CardHeader.js"),D=require("../card/CardTitle.js"),I=require("../card/CardSubtitle.js"),O=require("../card/CardBody.js"),T=require("../card/CardImage.js"),h=require("../card/CardActions.js"),v=require("@progress/kendo-react-common"),q=require("@progress/kendo-react-animation"),R=require("@progress/kendo-svg-icons"),S=require("@progress/kendo-react-buttons");function x(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const c=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(i,l,c.get?c:{enumerable:!0,get:()=>e[l]})}}return i.default=e,Object.freeze(i)}const t=x(N),E=e=>{const{title:l,subtitle:c,actions:r,images:o,description:C}=e.eventData,[d,b]=t.useState(e.eventData.opened||!1),[s,u]=t.useState(e.eventData.opened||!!e.collapsible),f=a=>{if(b(!d),e.onChange){const n={syntheticEvent:a,nativeEvent:a.nativeEvent,eventData:e.eventData};e.onChange.call(void 0,n)}},g=a=>{if(e.onActionClick){const n={syntheticEvent:a,nativeEvent:a.nativeEvent,eventData:e.eventData};e.onActionClick.call(void 0,n)}},m=()=>t.createElement(t.Fragment,null,t.createElement(O.CardBody,null,t.createElement("div",{className:"k-card-description"},t.createElement("p",null,C),o&&o.map((a,n)=>t.createElement(T.CardImage,{key:n,src:a.src})))),r&&t.createElement(h.CardActions,null,r.map((a,n)=>t.createElement("a",{key:n,href:a.url,className:"k-button k-button-md k-rounded-md k-button-flat k-button-flat-primary",onClick:g},a.text))));return t.createElement("div",{"data-testid":"k-timeline-card",className:v.classNames("k-timeline-card",{"k-collapsed":e.collapsible&&s})},t.createElement(y.Card,{"aria-live":"polite","aria-describedby":e.id,"aria-atomic":"true",tabIndex:e.tabindex,role:e.horizontal?"tabpanel":"button","aria-expanded":e.collapsible&&s,className:"k-card-with-callout",onClick:a=>f(a)},t.createElement("span",{style:e.calloutStyle,className:v.classNames("k-timeline-card-callout","k-card-callout",{"k-callout-n":e.horizontal},{"k-callout-e":e.alternated&&!e.horizontal},{"k-callout-w":!e.alternated&&!e.horizontal})}),t.createElement("div",{className:"k-card-inner"},t.createElement(A.CardHeader,null,t.createElement(D.CardTitle,null,t.createElement("span",{className:"k-event-title"},l),e.collapsible&&t.createElement(S.Button,{className:"k-event-collapse",fillMode:"flat",svgIcon:R.chevronRightIcon})),c&&t.createElement(I.CardSubtitle,null,c)),e.collapsible?t.createElement(q.Reveal,{transitionEnterDuration:e.transitionDuration||400,transitionExitDuration:e.transitionDuration||400,onBeforeEnter:()=>u(!1),onAfterExited:()=>u(!0)},d?m():null):m())))};E.propTypes={onChange:k.func,onActionClick:k.func};exports.TimelineCard=E;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),k=require("prop-types"),y=require("../card/Card.js"),A=require("../card/CardHeader.js"),D=require("../card/CardTitle.js"),I=require("../card/CardSubtitle.js"),O=require("../card/CardBody.js"),T=require("../card/CardImage.js"),h=require("../card/CardActions.js"),v=require("@progress/kendo-react-common"),q=require("@progress/kendo-react-animation"),R=require("@progress/kendo-svg-icons"),S=require("@progress/kendo-react-buttons");function x(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const c=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(i,l,c.get?c:{enumerable:!0,get:()=>e[l]})}}return i.default=e,Object.freeze(i)}const t=x(N),E=e=>{const{title:l,subtitle:c,actions:r,images:o,description:C}=e.eventData,[d,b]=t.useState(e.eventData.opened||!1),[s,u]=t.useState(e.eventData.opened||!!e.collapsible),f=a=>{if(b(!d),e.onChange){const n={syntheticEvent:a,nativeEvent:a.nativeEvent,eventData:e.eventData};e.onChange.call(void 0,n)}},g=a=>{if(e.onActionClick){const n={syntheticEvent:a,nativeEvent:a.nativeEvent,eventData:e.eventData};e.onActionClick.call(void 0,n)}},m=()=>t.createElement(t.Fragment,null,t.createElement(O.CardBody,null,t.createElement("div",{className:"k-card-description"},t.createElement("p",null,C),o&&o.map((a,n)=>t.createElement(T.CardImage,{key:n,src:a.src})))),r&&t.createElement(h.CardActions,null,r.map((a,n)=>t.createElement("a",{key:n,href:a.url,className:"k-button k-button-md k-rounded-md k-button-flat k-button-flat-primary",onClick:g},a.text))));return t.createElement("div",{"data-testid":"k-timeline-card",className:v.classNames("k-timeline-card",{"k-collapsed":e.collapsible&&s})},t.createElement(y.Card,{"aria-live":"polite","aria-describedby":e.id,"aria-atomic":"true",tabIndex:e.tabindex,role:e.horizontal?"tabpanel":"button","aria-expanded":e.collapsible&&s,className:"k-card-with-callout",onClick:a=>f(a)},t.createElement("span",{style:e.calloutStyle,className:v.classNames("k-timeline-card-callout","k-card-callout",{"k-callout-n":e.horizontal},{"k-callout-e":e.alternated&&!e.horizontal},{"k-callout-w":!e.alternated&&!e.horizontal})}),t.createElement("div",{className:"k-card-inner"},t.createElement(A.CardHeader,null,t.createElement(D.CardTitle,null,t.createElement("span",{className:"k-event-title"},l),e.collapsible&&t.createElement(S.Button,{className:"k-event-collapse",fillMode:"flat",size:"xs",svgIcon:R.chevronRightIcon})),c&&t.createElement(I.CardSubtitle,null,c)),e.collapsible?t.createElement(q.Reveal,{transitionEnterDuration:e.transitionDuration||400,transitionExitDuration:e.transitionDuration||400,onBeforeEnter:()=>u(!1),onAfterExited:()=>u(!0)},d?m():null):m())))};E.propTypes={onChange:k.func,onActionClick:k.func};exports.TimelineCard=E;
|
|
@@ -17,8 +17,8 @@ import { CardActions as g } from "../card/CardActions.mjs";
|
|
|
17
17
|
import { classNames as u } from "@progress/kendo-react-common";
|
|
18
18
|
import { Reveal as y } from "@progress/kendo-react-animation";
|
|
19
19
|
import { chevronRightIcon as T } from "@progress/kendo-svg-icons";
|
|
20
|
-
import { Button as
|
|
21
|
-
const
|
|
20
|
+
import { Button as x } from "@progress/kendo-react-buttons";
|
|
21
|
+
const O = (e) => {
|
|
22
22
|
const { title: E, subtitle: l, actions: i, images: o, description: v } = e.eventData, [c, k] = t.useState(e.eventData.opened || !1), [r, m] = t.useState(e.eventData.opened || !!e.collapsible), f = (a) => {
|
|
23
23
|
if (k(!c), e.onChange) {
|
|
24
24
|
const n = {
|
|
@@ -78,7 +78,15 @@ const x = (e) => {
|
|
|
78
78
|
)
|
|
79
79
|
}
|
|
80
80
|
),
|
|
81
|
-
/* @__PURE__ */ t.createElement("div", { className: "k-card-inner" }, /* @__PURE__ */ t.createElement(b, null, /* @__PURE__ */ t.createElement(A, null, /* @__PURE__ */ t.createElement("span", { className: "k-event-title" }, E), e.collapsible && /* @__PURE__ */ t.createElement(
|
|
81
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-card-inner" }, /* @__PURE__ */ t.createElement(b, null, /* @__PURE__ */ t.createElement(A, null, /* @__PURE__ */ t.createElement("span", { className: "k-event-title" }, E), e.collapsible && /* @__PURE__ */ t.createElement(
|
|
82
|
+
x,
|
|
83
|
+
{
|
|
84
|
+
className: "k-event-collapse",
|
|
85
|
+
fillMode: "flat",
|
|
86
|
+
size: "xs",
|
|
87
|
+
svgIcon: T
|
|
88
|
+
}
|
|
89
|
+
)), l && /* @__PURE__ */ t.createElement(D, null, l)), e.collapsible ? /* @__PURE__ */ t.createElement(
|
|
82
90
|
y,
|
|
83
91
|
{
|
|
84
92
|
transitionEnterDuration: e.transitionDuration || 400,
|
|
@@ -91,10 +99,10 @@ const x = (e) => {
|
|
|
91
99
|
)
|
|
92
100
|
);
|
|
93
101
|
};
|
|
94
|
-
|
|
102
|
+
O.propTypes = {
|
|
95
103
|
onChange: s.func,
|
|
96
104
|
onActionClick: s.func
|
|
97
105
|
};
|
|
98
106
|
export {
|
|
99
|
-
|
|
107
|
+
O as TimelineCard
|
|
100
108
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ve=require("react"),he=require("prop-types"),ge=require("./TimelineCard.js"),Te=require("./utils.js"),M=require("@progress/kendo-svg-icons"),ke=require("@progress/kendo-react-intl"),b=require("@progress/kendo-react-common"),B=require("@progress/kendo-react-buttons");function Ee(l){const p=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const h in l)if(h!=="default"){const I=Object.getOwnPropertyDescriptor(l,h);Object.defineProperty(p,h,I.get?I:{enumerable:!0,get:()=>l[h]})}}return p.default=l,Object.freeze(p)}const s=Ee(ve),K=l=>{const I=ke.useInternationalization(),[A,X]=s.useState(!1),[L,Y]=s.useState(!0),[G,J]=s.useState(),[f,D]=s.useState(0),[y,Q]=s.useState(),[u,Z]=s.useState(0),[v,ee]=s.useState(0),[a,F]=s.useState(1),[d,R]=s.useState(),[i,te]=s.useState(),[_,W]=s.useState([0,0,0]),[C,U]=s.useState(0),[ne,se]=s.useState(1),m=s.useRef(null),c=s.useRef(null),P=s.useRef(null),{eventsData:re,dateFormat:ae,navigatable:oe,onActionClick:ce}=l,x=y?`${y}%`:"150px",g=s.useRef(new b.Navigation({tabIndex:0,root:m,selectors:[".k-timeline-scrollable-wrap"]}));s.useEffect(()=>{m.current&&l.navigatable&&(setTimeout(()=>{const e=g.current.first;e&&e.setAttribute("tabindex",String(0))},0),g.current.keyboardEvents={keydown:{ArrowRight:le,ArrowLeft:ue,End:de,Home:fe}})},[l.navigatable,a,u]),s.useEffect(()=>{g.current.update()});const ie=e=>{oe&&g.current&&g.current.triggerKeyboardEvent(e)};s.useEffect(()=>{var r;const e=b.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(w),t=c.current,n=((r=m==null?void 0:m.current)==null?void 0:r.offsetWidth)||0;return e&&t&&e.observe(t),V(),w(),W([n,0,-n]),()=>{e&&e.disconnect()}},[]),s.useEffect(()=>{const e=c.current,t=e&&e.children[a];if(t){const n=t.offsetWidth,r=!(f>=0);if(X(r),i){const o=i.length*n>u*n*((f*-1+100)/100);Y(o)}(e==null?void 0:e.offsetWidth)*-f/100>=e.children.length*n&&(V(),w(),D((t.offsetLeft-t.offsetWidth)/(u*t.offsetWidth)*100*-1)),q(t)}},[u,y,a]);const le=(e,t,n)=>{if(c.current){const r=c.current.children[a+1],o=r&&r.classList.contains("k-timeline-flag-wrap")?a+2:a+1;if(i&&i.length<=o)return;u+v<=o&&j(),k(o,n)}},ue=(e,t,n)=>{if(c.current){const r=c.current&&c.current.children[a-1],o=r&&r.classList.contains("k-timeline-flag-wrap")?a-2:a-1;if(o<=0)return;o<v&&$(),k(o,n)}},fe=(e,t,n)=>{if(c.current){if(a<=1)return;const r=1;N(!0,r,0,0),k(r,n)}},de=(e,t,n)=>{if(c.current){const r=c.current&&c.current.children.length-1;if(r<=a)return;const o=Math.floor(r/u),E=o*-100,O=o*u;N(!0,r,O,E),k(r,n)}},V=()=>{const e=Te.addYearsFlags(re);te(e),R([e[a-1],e[a],e[a+1]])},$=()=>{var t;if(c.current&&i){const n=v-u,r=v-1,o=i[r]&&((t=i[r])!=null&&t.yearFlag)?r-1:r,E=f+100>0?0:f+100;N(!1,o,n,E)}},j=()=>{if(c.current&&i){const t=v+u,n=i[t]&&i[t].yearFlag?t+1:t,r=f-100;N(!0,n,t,r)}},N=(e,t,n,r)=>{S(e,t),w(),ee(n),D(r),F(t)},S=(e,t)=>{if(d&&i){const n=T(e,ne),r=Object.assign([],d,{[n]:i[t]});R(r),se(n),U(e?-100:100),setTimeout(()=>{var H;const o=(H=m.current)==null?void 0:H.offsetWidth,E=Object.assign([],_,{[n]:0,[T(!0,n)]:o,[T(!1,n)]:o&&-o}),O=Object.assign([],r,{[T(!0,n)]:{},[T(!1,n)]:{}});R(O),W(E),U(0)},l.transitionDuration||300)}},T=(e,t)=>{const n=e?t+1:t-1;return d?n<0?d.length-1:n%d.length:0},q=e=>{var n,r;const t=(a-v)*e.offsetWidth+e.offsetWidth/2+(((r=(n=P.current)==null?void 0:n.element)==null?void 0:r.clientWidth)||0);J(t)},k=(e,t)=>{t.preventDefault(),e>a?S(!0,e):e<a&&S(!1,e),F(e)},w=s.useCallback(()=>{const e=c.current,t=e&&e.children[a];if(e instanceof HTMLElement&&t){const n=Math.round(e.offsetWidth/150);q(t),Q(100/n),Z(n)}},[]),me=()=>({transitionDuration:"300ms"}),z=e=>({transform:`translateX(${e}%)`,transformOrigin:"left top"});return s.createElement(s.Fragment,null,s.createElement("div",{className:"k-timeline-track-wrap",ref:m,onKeyDown:ie},s.createElement(B.Button,{ref:P,"aria-hidden":"true",rounded:"full",svgIcon:M.chevronLeftIcon,icon:"chevron-left",onClick:()=>A&&$(),className:b.classNames("k-timeline-arrow","k-timeline-arrow-left",{"k-disabled":!A})}),s.createElement(B.Button,{"aria-hidden":"true",rounded:"full",svgIcon:M.chevronRightIcon,icon:"chevron-right",onClick:()=>L&&j(),className:b.classNames("k-timeline-arrow","k-timeline-arrow-right",{"k-disabled":!L})}),s.createElement("div",{className:"k-timeline-track"},s.createElement("ul",{ref:c,className:"k-timeline-scrollable-wrap",role:"tablist",tabIndex:0,style:{transform:`translateX(${f}%)`}},i&&i.map((e,t)=>e.yearFlag?s.createElement("li",{role:"none",className:"k-timeline-track-item k-timeline-flag-wrap",style:{flex:`1 0 ${x}`},key:t},s.createElement("span",{className:"k-timeline-flag"},e.yearFlag)):s.createElement("li",{role:"tab",className:b.classNames("k-timeline-track-item",{"k-focus":t===a}),"aria-selected":t===a,style:{flex:`1 0 ${x}`},key:t},s.createElement("div",{className:"k-timeline-date-wrap"},s.createElement("span",{className:"k-timeline-date"},I.formatDate(e.date,ae))),s.createElement("span",{onClick:n=>k(t,n),className:"k-timeline-circle"})))))),s.createElement("div",{className:"k-timeline-events-list"},s.createElement("ul",{className:"k-timeline-scrollable-wrap",style:C===0?{...z(C)}:{...z(C),...me()}},d&&d.map((e,t)=>s.createElement("li",{key:t,className:"k-timeline-event",style:{transform:`translate3d(${_[t]}px, 0px, 0px)`}},e&&s.createElement(ge.TimelineCard,{tabindex:_[t]===0?0:-1,eventData:e,onActionClick:ce,horizontal:!0,collapsible:!1,calloutStyle:{left:`${G}px`}}))))))};K.propTypes={onActionClick:he.func};exports.TimelineHorizontal=K;
|
|
@@ -9,13 +9,13 @@ import * as s from "react";
|
|
|
9
9
|
import ft from "prop-types";
|
|
10
10
|
import { TimelineCard as ut } from "./TimelineCard.mjs";
|
|
11
11
|
import { addYearsFlags as mt } from "./utils.mjs";
|
|
12
|
-
import {
|
|
13
|
-
import { useInternationalization as
|
|
14
|
-
import { Navigation as
|
|
12
|
+
import { chevronLeftIcon as dt, chevronRightIcon as ht } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { useInternationalization as vt } from "@progress/kendo-react-intl";
|
|
14
|
+
import { Navigation as Tt, canUseDOM as Et, classNames as _ } from "@progress/kendo-react-common";
|
|
15
15
|
import { Button as z } from "@progress/kendo-react-buttons";
|
|
16
16
|
const gt = (g) => {
|
|
17
|
-
const M =
|
|
18
|
-
new
|
|
17
|
+
const M = vt(), [y, j] = s.useState(!1), [A, K] = s.useState(!0), [X, Y] = s.useState(), [f, S] = s.useState(0), [b, B] = s.useState(), [l, q] = s.useState(0), [d, G] = s.useState(0), [a, L] = s.useState(1), [u, I] = s.useState(), [c, J] = s.useState(), [w, O] = s.useState([0, 0, 0]), [N, F] = s.useState(0), [Q, Z] = s.useState(1), m = s.useRef(null), i = s.useRef(null), W = s.useRef(null), { eventsData: tt, dateFormat: et, navigatable: nt, onActionClick: st } = g, D = b ? `${b}%` : "150px", h = s.useRef(
|
|
18
|
+
new Tt({
|
|
19
19
|
tabIndex: 0,
|
|
20
20
|
root: m,
|
|
21
21
|
selectors: [".k-timeline-scrollable-wrap"]
|
|
@@ -23,9 +23,9 @@ const gt = (g) => {
|
|
|
23
23
|
);
|
|
24
24
|
s.useEffect(() => {
|
|
25
25
|
m.current && g.navigatable && (setTimeout(() => {
|
|
26
|
-
const t =
|
|
26
|
+
const t = h.current.first;
|
|
27
27
|
t && t.setAttribute("tabindex", String(0));
|
|
28
|
-
}, 0),
|
|
28
|
+
}, 0), h.current.keyboardEvents = {
|
|
29
29
|
keydown: {
|
|
30
30
|
ArrowRight: at,
|
|
31
31
|
ArrowLeft: ot,
|
|
@@ -34,14 +34,14 @@ const gt = (g) => {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
}, [g.navigatable, a, l]), s.useEffect(() => {
|
|
37
|
-
|
|
37
|
+
h.current.update();
|
|
38
38
|
});
|
|
39
39
|
const rt = (t) => {
|
|
40
|
-
nt &&
|
|
40
|
+
nt && h.current && h.current.triggerKeyboardEvent(t);
|
|
41
41
|
};
|
|
42
42
|
s.useEffect(() => {
|
|
43
43
|
var r;
|
|
44
|
-
const t =
|
|
44
|
+
const t = Et && window.ResizeObserver && new window.ResizeObserver(p), e = i.current, n = ((r = m == null ? void 0 : m.current) == null ? void 0 : r.offsetWidth) || 0;
|
|
45
45
|
return t && e && t.observe(e), U(), p(), O([n, 0, -n]), () => {
|
|
46
46
|
t && t.disconnect();
|
|
47
47
|
};
|
|
@@ -63,29 +63,29 @@ const gt = (g) => {
|
|
|
63
63
|
const r = i.current.children[a + 1], o = r && r.classList.contains("k-timeline-flag-wrap") ? a + 2 : a + 1;
|
|
64
64
|
if (c && c.length <= o)
|
|
65
65
|
return;
|
|
66
|
-
l + d <= o && P(),
|
|
66
|
+
l + d <= o && P(), T(o, n);
|
|
67
67
|
}
|
|
68
68
|
}, ot = (t, e, n) => {
|
|
69
69
|
if (i.current) {
|
|
70
70
|
const r = i.current && i.current.children[a - 1], o = r && r.classList.contains("k-timeline-flag-wrap") ? a - 2 : a - 1;
|
|
71
71
|
if (o <= 0)
|
|
72
72
|
return;
|
|
73
|
-
o < d && x(),
|
|
73
|
+
o < d && x(), T(o, n);
|
|
74
74
|
}
|
|
75
75
|
}, it = (t, e, n) => {
|
|
76
76
|
if (i.current) {
|
|
77
77
|
if (a <= 1)
|
|
78
78
|
return;
|
|
79
79
|
const r = 1;
|
|
80
|
-
k(!0, r, 0, 0),
|
|
80
|
+
k(!0, r, 0, 0), T(r, n);
|
|
81
81
|
}
|
|
82
82
|
}, ct = (t, e, n) => {
|
|
83
83
|
if (i.current) {
|
|
84
84
|
const r = i.current && i.current.children.length - 1;
|
|
85
85
|
if (r <= a)
|
|
86
86
|
return;
|
|
87
|
-
const o = Math.floor(r / l),
|
|
88
|
-
k(!0, r,
|
|
87
|
+
const o = Math.floor(r / l), E = o * -100, R = o * l;
|
|
88
|
+
k(!0, r, R, E), T(r, n);
|
|
89
89
|
}
|
|
90
90
|
}, U = () => {
|
|
91
91
|
const t = mt(tt);
|
|
@@ -93,8 +93,8 @@ const gt = (g) => {
|
|
|
93
93
|
}, x = () => {
|
|
94
94
|
var e;
|
|
95
95
|
if (i.current && c) {
|
|
96
|
-
const n = d - l, r = d - 1, o = c[r] && ((e = c[r]) != null && e.yearFlag) ? r - 1 : r,
|
|
97
|
-
k(!1, o, n,
|
|
96
|
+
const n = d - l, r = d - 1, o = c[r] && ((e = c[r]) != null && e.yearFlag) ? r - 1 : r, E = f + 100 > 0 ? 0 : f + 100;
|
|
97
|
+
k(!1, o, n, E);
|
|
98
98
|
}
|
|
99
99
|
}, P = () => {
|
|
100
100
|
if (i.current && c) {
|
|
@@ -102,32 +102,32 @@ const gt = (g) => {
|
|
|
102
102
|
k(!0, n, e, r);
|
|
103
103
|
}
|
|
104
104
|
}, k = (t, e, n, r) => {
|
|
105
|
-
|
|
106
|
-
},
|
|
105
|
+
C(t, e), p(), G(n), S(r), L(e);
|
|
106
|
+
}, C = (t, e) => {
|
|
107
107
|
if (u && c) {
|
|
108
|
-
const n =
|
|
108
|
+
const n = v(t, Q), r = Object.assign([], u, { [n]: c[e] });
|
|
109
109
|
I(r), Z(n), F(t ? -100 : 100), setTimeout(() => {
|
|
110
110
|
var H;
|
|
111
|
-
const o = (H = m.current) == null ? void 0 : H.offsetWidth,
|
|
111
|
+
const o = (H = m.current) == null ? void 0 : H.offsetWidth, E = Object.assign([], w, {
|
|
112
112
|
[n]: 0,
|
|
113
|
-
[
|
|
114
|
-
[
|
|
115
|
-
}),
|
|
116
|
-
[
|
|
117
|
-
[
|
|
113
|
+
[v(!0, n)]: o,
|
|
114
|
+
[v(!1, n)]: o && -o
|
|
115
|
+
}), R = Object.assign([], r, {
|
|
116
|
+
[v(!0, n)]: {},
|
|
117
|
+
[v(!1, n)]: {}
|
|
118
118
|
});
|
|
119
|
-
I(
|
|
119
|
+
I(R), O(E), F(0);
|
|
120
120
|
}, g.transitionDuration || 300);
|
|
121
121
|
}
|
|
122
|
-
},
|
|
122
|
+
}, v = (t, e) => {
|
|
123
123
|
const n = t ? e + 1 : e - 1;
|
|
124
124
|
return u ? n < 0 ? u.length - 1 : n % u.length : 0;
|
|
125
125
|
}, V = (t) => {
|
|
126
126
|
var n, r;
|
|
127
127
|
const e = (a - d) * t.offsetWidth + t.offsetWidth / 2 + (((r = (n = W.current) == null ? void 0 : n.element) == null ? void 0 : r.clientWidth) || 0);
|
|
128
128
|
Y(e);
|
|
129
|
-
},
|
|
130
|
-
e.preventDefault(), t > a ?
|
|
129
|
+
}, T = (t, e) => {
|
|
130
|
+
e.preventDefault(), t > a ? C(!0, t) : t < a && C(!1, t), L(t);
|
|
131
131
|
}, p = s.useCallback(() => {
|
|
132
132
|
const t = i.current, e = t && t.children[a];
|
|
133
133
|
if (t instanceof HTMLElement && e) {
|
|
@@ -147,19 +147,19 @@ const gt = (g) => {
|
|
|
147
147
|
"aria-hidden": "true",
|
|
148
148
|
rounded: "full",
|
|
149
149
|
svgIcon: dt,
|
|
150
|
-
icon: "
|
|
151
|
-
onClick: () =>
|
|
152
|
-
className:
|
|
150
|
+
icon: "chevron-left",
|
|
151
|
+
onClick: () => y && x(),
|
|
152
|
+
className: _("k-timeline-arrow", "k-timeline-arrow-left", { "k-disabled": !y })
|
|
153
153
|
}
|
|
154
154
|
), /* @__PURE__ */ s.createElement(
|
|
155
155
|
z,
|
|
156
156
|
{
|
|
157
157
|
"aria-hidden": "true",
|
|
158
158
|
rounded: "full",
|
|
159
|
-
svgIcon:
|
|
160
|
-
icon: "
|
|
161
|
-
onClick: () =>
|
|
162
|
-
className:
|
|
159
|
+
svgIcon: ht,
|
|
160
|
+
icon: "chevron-right",
|
|
161
|
+
onClick: () => A && P(),
|
|
162
|
+
className: _("k-timeline-arrow", "k-timeline-arrow-right", { "k-disabled": !A })
|
|
163
163
|
}
|
|
164
164
|
), /* @__PURE__ */ s.createElement("div", { className: "k-timeline-track" }, /* @__PURE__ */ s.createElement(
|
|
165
165
|
"ul",
|
|
@@ -184,7 +184,7 @@ const gt = (g) => {
|
|
|
184
184
|
"li",
|
|
185
185
|
{
|
|
186
186
|
role: "tab",
|
|
187
|
-
className:
|
|
187
|
+
className: _("k-timeline-track-item", {
|
|
188
188
|
"k-focus": e === a
|
|
189
189
|
}),
|
|
190
190
|
"aria-selected": e === a,
|
|
@@ -192,7 +192,7 @@ const gt = (g) => {
|
|
|
192
192
|
key: e
|
|
193
193
|
},
|
|
194
194
|
/* @__PURE__ */ s.createElement("div", { className: "k-timeline-date-wrap" }, /* @__PURE__ */ s.createElement("span", { className: "k-timeline-date" }, M.formatDate(t.date, et))),
|
|
195
|
-
/* @__PURE__ */ s.createElement("span", { onClick: (n) =>
|
|
195
|
+
/* @__PURE__ */ s.createElement("span", { onClick: (n) => T(e, n), className: "k-timeline-circle" })
|
|
196
196
|
)
|
|
197
197
|
)
|
|
198
198
|
))), /* @__PURE__ */ s.createElement("div", { className: "k-timeline-events-list" }, /* @__PURE__ */ s.createElement(
|