@progress/kendo-react-layout 14.5.0-develop.8 → 15.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.
- package/MenuMcpWrapper.d.ts +17 -0
- package/MenuMcpWrapper.js +8 -0
- package/MenuMcpWrapper.mjs +18 -0
- package/README.md +4 -4
- package/actionsheet/ActionSheet.d.ts +12 -0
- package/actionsheet/ActionSheet.js +1 -1
- package/actionsheet/ActionSheet.mjs +69 -68
- package/actionsheet/ActionSheetItem.js +1 -1
- package/actionsheet/ActionSheetItem.mjs +1 -3
- package/appbar/interfaces/AppBarProps.d.ts +2 -14
- package/bottomnavigation/BottomNavigation.js +1 -1
- package/bottomnavigation/BottomNavigation.mjs +81 -76
- package/bottomnavigation/BottomNavigationItem.js +1 -1
- package/bottomnavigation/BottomNavigationItem.mjs +34 -33
- package/bottomnavigation/BottomNavigationProps.d.ts +3 -13
- package/bottomnavigation/messages/index.d.ts +17 -0
- package/bottomnavigation/messages/index.js +8 -0
- package/bottomnavigation/messages/index.mjs +14 -0
- package/breadcrumb/Breadcrumb.js +1 -1
- package/breadcrumb/Breadcrumb.mjs +30 -28
- package/breadcrumb/BreadcrumbLink.js +1 -1
- package/breadcrumb/BreadcrumbLink.mjs +26 -26
- package/breadcrumb/messages/index.d.ts +17 -0
- package/breadcrumb/messages/index.js +8 -0
- package/breadcrumb/messages/index.mjs +14 -0
- 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/Drawer.js +1 -1
- package/drawer/Drawer.mjs +63 -63
- package/drawer/DrawerContent.d.ts +1 -1
- package/drawer/DrawerItem.d.ts +1 -1
- package/drawer/DrawerItem.js +1 -1
- package/drawer/DrawerItem.mjs +22 -23
- package/drawer/interfaces/DrawerProps.d.ts +8 -0
- package/expansionpanel/ExpansionPanel.js +1 -1
- package/expansionpanel/ExpansionPanel.mjs +50 -50
- package/expansionpanel/ExpansionPanelContent.js +1 -1
- package/expansionpanel/ExpansionPanelContent.mjs +7 -4
- package/index.d.mts +1 -2
- package/index.d.ts +1 -2
- package/index.js +1 -1
- package/index.mjs +128 -130
- package/menu/MenuProps.d.ts +6 -0
- 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/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +94 -91
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +13 -15
- package/panelbar/interfaces/PanelBarProps.d.ts +8 -0
- package/panelbar/interfaces/RenderPanelBarItem.d.ts +1 -0
- package/panelbar/util.d.ts +1 -1
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +62 -59
- package/splitter/SplitterBar.d.ts +1 -0
- package/splitter/SplitterBar.js +1 -1
- package/splitter/SplitterBar.mjs +81 -72
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +79 -85
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +134 -133
- package/stepper/interfaces/StepperProps.d.ts +8 -1
- package/stepper/messages/index.d.ts +12 -2
- package/stepper/messages/index.js +1 -1
- package/stepper/messages/index.mjs +8 -4
- package/tabstrip/TabStrip.d.ts +8 -1
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +126 -125
- package/tabstrip/TabStripNavigation.js +1 -1
- package/tabstrip/TabStripNavigation.mjs +31 -31
- package/tilelayout/InternalTile.js +1 -1
- package/tilelayout/InternalTile.mjs +119 -115
- package/tilelayout/TileLayout.js +1 -1
- package/tilelayout/TileLayout.mjs +58 -58
- package/timeline/TimelineCard.d.ts +2 -0
- package/timeline/TimelineCard.js +1 -1
- package/timeline/TimelineCard.mjs +27 -18
- package/timeline/TimelineHorizontal.js +1 -1
- package/timeline/TimelineHorizontal.mjs +113 -109
|
@@ -5,76 +5,76 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { useCallback as R, useRef as T, useMemo as F, useState as z, useEffect as
|
|
10
|
-
import
|
|
11
|
-
import { dispatchEvent as
|
|
12
|
-
import { InternalTile as
|
|
8
|
+
import * as t from "react";
|
|
9
|
+
import { useCallback as R, useRef as T, useMemo as F, useState as z, useEffect as Z } from "react";
|
|
10
|
+
import o from "prop-types";
|
|
11
|
+
import { dispatchEvent as ee, classNames as K, getter as oe } from "@progress/kendo-react-common";
|
|
12
|
+
import { InternalTile as te } from "./InternalTile.mjs";
|
|
13
13
|
const re = {
|
|
14
14
|
column: "k-grid-flow-col",
|
|
15
15
|
row: "k-grid-flow-row",
|
|
16
16
|
"column dense": "k-grid-flow-col-dense",
|
|
17
17
|
"row dense": "k-grid-flow-row-dense",
|
|
18
|
-
unset:
|
|
19
|
-
},
|
|
18
|
+
unset: void 0
|
|
19
|
+
}, u = {
|
|
20
20
|
columns: 3,
|
|
21
21
|
columnWidth: "1fr",
|
|
22
22
|
rowHeight: "1fr",
|
|
23
23
|
autoFlow: "column",
|
|
24
24
|
items: []
|
|
25
|
-
},
|
|
25
|
+
}, U = t.forwardRef((j, O) => {
|
|
26
26
|
const {
|
|
27
|
-
className:
|
|
28
|
-
columns: i =
|
|
29
|
-
columnWidth: d =
|
|
27
|
+
className: V,
|
|
28
|
+
columns: i = u.columns,
|
|
29
|
+
columnWidth: d = u.columnWidth,
|
|
30
30
|
gap: a,
|
|
31
|
-
rowHeight: p =
|
|
31
|
+
rowHeight: p = u.rowHeight,
|
|
32
32
|
style: L,
|
|
33
|
-
autoFlow:
|
|
34
|
-
items: l =
|
|
33
|
+
autoFlow: _ = u.autoFlow,
|
|
34
|
+
items: l = u.items,
|
|
35
35
|
positions: f,
|
|
36
36
|
onReposition: b,
|
|
37
37
|
dataItemKey: $,
|
|
38
38
|
id: v,
|
|
39
|
-
dir:
|
|
40
|
-
ignoreDrag:
|
|
41
|
-
} =
|
|
39
|
+
dir: M,
|
|
40
|
+
ignoreDrag: q
|
|
41
|
+
} = j, B = R(() => {
|
|
42
42
|
g.current && g.current.focus();
|
|
43
43
|
}, []), y = T(null), g = T(null);
|
|
44
|
-
|
|
44
|
+
t.useImperativeHandle(
|
|
45
45
|
y,
|
|
46
46
|
() => ({
|
|
47
47
|
element: g.current,
|
|
48
|
-
focus:
|
|
48
|
+
focus: B
|
|
49
49
|
})
|
|
50
|
-
),
|
|
51
|
-
const c = f !== void 0, k = R((e) => e.map((r, s) => ({ order: s, rowSpan: 1, colSpan: 1, ...r.defaultPosition })), []),
|
|
50
|
+
), t.useImperativeHandle(O, () => y.current);
|
|
51
|
+
const c = f !== void 0, k = R((e) => e.map((r, s) => ({ order: s, rowSpan: 1, colSpan: 1, ...r.defaultPosition })), []), G = F(() => {
|
|
52
52
|
if (f)
|
|
53
53
|
return f.map(
|
|
54
54
|
(e, r) => ({ order: r, rowSpan: 1, colSpan: 1, ...e })
|
|
55
55
|
);
|
|
56
|
-
}, [f]), [
|
|
56
|
+
}, [f]), [J, W] = z(
|
|
57
57
|
() => k(l)
|
|
58
|
-
), [
|
|
59
|
-
|
|
58
|
+
), [Q, A] = z(!1), C = T(l.length);
|
|
59
|
+
Z(() => {
|
|
60
60
|
!c && l.length !== C.current && (W(k(l)), C.current = l.length);
|
|
61
61
|
}, [l, c, k]);
|
|
62
|
-
const S = c ?
|
|
62
|
+
const S = c ? G : J, X = R(
|
|
63
63
|
(e, r, s, h = 0, P = 0) => {
|
|
64
64
|
if (r === 0 && s === 0 && !P && !h)
|
|
65
65
|
return;
|
|
66
|
-
let
|
|
66
|
+
let m = !1;
|
|
67
67
|
const w = S.map((I) => ({ ...I })), n = w[e], E = w.find((I) => I.order === n.order + r);
|
|
68
|
-
E && E !== n && (n.order += r, E.order += -r,
|
|
68
|
+
E && E !== n && (n.order += r, E.order += -r, m = !0);
|
|
69
69
|
const x = n.col + s;
|
|
70
|
-
s !== 0 && x >= 1 && x + n.colSpan <= i + 1 && (n.col = x,
|
|
70
|
+
s !== 0 && x >= 1 && x + n.colSpan <= i + 1 && (n.col = x, m = !0);
|
|
71
71
|
const H = n.colSpan + P;
|
|
72
|
-
P && H >= 1 && H + n.col <= i + 1 && (n.colSpan = H,
|
|
72
|
+
P && H >= 1 && H + n.col <= i + 1 && (n.colSpan = H, m = !0);
|
|
73
73
|
const D = n.rowSpan + h;
|
|
74
|
-
h && D >= 1 && (n.rowSpan = D,
|
|
74
|
+
h && D >= 1 && (n.rowSpan = D, m = !0), m && (c || W(w), b && ee(b, {}, y.current, { value: w }));
|
|
75
75
|
},
|
|
76
76
|
[S, i, c, b, y]
|
|
77
|
-
), N = F(() => a ? `${typeof a.rows == "number" ? a.rows + "px" : a.rows} ${typeof a.columns == "number" ? a.columns + "px" : a.columns}` : 16, [a]),
|
|
77
|
+
), N = F(() => a ? `${typeof a.rows == "number" ? a.rows + "px" : a.rows} ${typeof a.columns == "number" ? a.columns + "px" : a.columns}` : 16, [a]), Y = F(
|
|
78
78
|
() => ({
|
|
79
79
|
gridTemplateColumns: `repeat(${i}, minmax(0px, ${typeof d == "number" ? d + "px" : d}))`,
|
|
80
80
|
gridAutoRows: `minmax(0px, ${typeof p == "number" ? p + "px" : p})`,
|
|
@@ -84,22 +84,22 @@ const re = {
|
|
|
84
84
|
}),
|
|
85
85
|
[i, d, p, N, L]
|
|
86
86
|
);
|
|
87
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ t.createElement(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
90
|
ref: g,
|
|
91
|
-
dir:
|
|
92
|
-
className:
|
|
93
|
-
style:
|
|
91
|
+
dir: M,
|
|
92
|
+
className: K("k-tilelayout", re[_], V),
|
|
93
|
+
style: Y,
|
|
94
94
|
id: v,
|
|
95
95
|
role: "list"
|
|
96
96
|
},
|
|
97
97
|
l.map((e, r) => {
|
|
98
98
|
let s;
|
|
99
|
-
return typeof e.header == "string" ? s = e.header : s = `tilelayout-${v ? `${v}-` : ""}${r}`, /* @__PURE__ */
|
|
100
|
-
|
|
99
|
+
return typeof e.header == "string" ? s = e.header : s = `tilelayout-${v ? `${v}-` : ""}${r}`, /* @__PURE__ */ t.createElement(t.Fragment, { key: $ ? oe($)(e) : r }, /* @__PURE__ */ t.createElement(
|
|
100
|
+
te,
|
|
101
101
|
{
|
|
102
|
-
update:
|
|
102
|
+
update: X,
|
|
103
103
|
defaultPosition: S[r],
|
|
104
104
|
index: r,
|
|
105
105
|
resizable: e.resizable,
|
|
@@ -109,33 +109,33 @@ const re = {
|
|
|
109
109
|
className: e.className,
|
|
110
110
|
hintClassName: e.hintClassName,
|
|
111
111
|
hintStyle: e.hintStyle,
|
|
112
|
-
ignoreDrag:
|
|
112
|
+
ignoreDrag: q,
|
|
113
113
|
onPress: () => A(!0),
|
|
114
114
|
onRelease: () => A(!1)
|
|
115
115
|
},
|
|
116
|
-
e.item ? e.item : /* @__PURE__ */
|
|
116
|
+
e.item ? e.item : /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { className: K("k-tilelayout-item-header k-card-header", { "k-cursor-move": e.reorderable !== !1 }) }, t.isValidElement(e.header) ? e.header : /* @__PURE__ */ t.createElement("div", { id: s, className: "k-card-title" }, e.header)), /* @__PURE__ */ t.createElement("div", { className: "k-tilelayout-item-body k-card-body" }, e.body))
|
|
117
117
|
));
|
|
118
118
|
}),
|
|
119
|
-
!
|
|
119
|
+
!Q && /* @__PURE__ */ t.createElement("div", { className: "k-layout-item-hint", style: { display: "none", zIndex: "1", height: "auto" } })
|
|
120
120
|
);
|
|
121
121
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
id:
|
|
125
|
-
style:
|
|
126
|
-
className:
|
|
127
|
-
dir:
|
|
128
|
-
gap:
|
|
129
|
-
columns:
|
|
130
|
-
columnWidth:
|
|
131
|
-
rowHeight:
|
|
132
|
-
dataItemKey:
|
|
133
|
-
items:
|
|
134
|
-
positions:
|
|
135
|
-
autoFlow:
|
|
136
|
-
onReposition:
|
|
137
|
-
ignoreDrag:
|
|
122
|
+
U.displayName = "KendoTileLayout";
|
|
123
|
+
U.propTypes = {
|
|
124
|
+
id: o.string,
|
|
125
|
+
style: o.object,
|
|
126
|
+
className: o.string,
|
|
127
|
+
dir: o.string,
|
|
128
|
+
gap: o.object,
|
|
129
|
+
columns: o.number,
|
|
130
|
+
columnWidth: o.oneOfType([o.number, o.string]),
|
|
131
|
+
rowHeight: o.oneOfType([o.number, o.string]),
|
|
132
|
+
dataItemKey: o.string,
|
|
133
|
+
items: o.array,
|
|
134
|
+
positions: o.array,
|
|
135
|
+
autoFlow: o.oneOf(["column", "row", "column dense", "row dense", "unset"]),
|
|
136
|
+
onReposition: o.func,
|
|
137
|
+
ignoreDrag: o.func
|
|
138
138
|
};
|
|
139
139
|
export {
|
|
140
|
-
|
|
140
|
+
U as TileLayout
|
|
141
141
|
};
|
|
@@ -13,11 +13,13 @@ import * as React from 'react';
|
|
|
13
13
|
interface TimelineCardProps {
|
|
14
14
|
tabindex?: number;
|
|
15
15
|
id?: string;
|
|
16
|
+
panelId?: string;
|
|
16
17
|
eventData: TimelineEventProps;
|
|
17
18
|
alternated?: boolean;
|
|
18
19
|
horizontal?: boolean;
|
|
19
20
|
collapsible?: boolean;
|
|
20
21
|
navigatable?: boolean;
|
|
22
|
+
ariaLabel?: string;
|
|
21
23
|
calloutStyle?: React.CSSProperties;
|
|
22
24
|
transitionDuration?: number;
|
|
23
25
|
onChange?: (event: EventDataProps) => void;
|
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"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),v=require("prop-types"),y=require("../card/Card.js"),A=require("../card/CardHeader.js"),D=require("../card/CardTitle.js"),I=require("../card/CardSubtitle.js"),h=require("../card/CardBody.js"),O=require("../card/CardImage.js"),T=require("../card/CardActions.js"),k=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:b}=e.eventData,[d,C]=t.useState(e.eventData.opened||!1),[s,u]=t.useState(e.eventData.opened||!!e.collapsible),f=a=>{if(C(!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(h.CardBody,null,t.createElement("div",{className:"k-card-description"},t.createElement("p",null,b),o&&o.map((a,n)=>t.createElement(O.CardImage,{key:n,src:a.src})))),r&&t.createElement(T.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:k.classNames("k-timeline-card",{"k-collapsed":e.collapsible&&s})},t.createElement(y.Card,{id:e.panelId,"aria-label":e.ariaLabel,"aria-live":e.horizontal?void 0:"polite","aria-describedby":e.id,tabIndex:e.tabindex,role:e.horizontal?"tabpanel":"button","aria-expanded":e.collapsible?s:void 0,className:"k-card-with-callout",onClick:a=>f(a)},t.createElement("span",{style:e.calloutStyle,className:k.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:v.func,onActionClick:v.func};exports.TimelineCard=E;
|
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import s from "prop-types";
|
|
10
|
-
import { Card as
|
|
11
|
-
import { CardHeader as
|
|
12
|
-
import { CardTitle as
|
|
13
|
-
import { CardSubtitle as
|
|
14
|
-
import { CardBody as
|
|
10
|
+
import { Card as C } from "../card/Card.mjs";
|
|
11
|
+
import { CardHeader as N } from "../card/CardHeader.mjs";
|
|
12
|
+
import { CardTitle as h } from "../card/CardTitle.mjs";
|
|
13
|
+
import { CardSubtitle as A } from "../card/CardSubtitle.mjs";
|
|
14
|
+
import { CardBody as D } from "../card/CardBody.mjs";
|
|
15
15
|
import { CardImage as I } from "../card/CardImage.mjs";
|
|
16
16
|
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
|
|
22
|
-
const { title:
|
|
20
|
+
import { Button as x } from "@progress/kendo-react-buttons";
|
|
21
|
+
const O = (e) => {
|
|
22
|
+
const { title: v, subtitle: l, actions: i, images: o, description: E } = 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 = {
|
|
25
25
|
syntheticEvent: a,
|
|
@@ -28,7 +28,7 @@ const x = (e) => {
|
|
|
28
28
|
};
|
|
29
29
|
e.onChange.call(void 0, n);
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, b = (a) => {
|
|
32
32
|
if (e.onActionClick) {
|
|
33
33
|
const n = {
|
|
34
34
|
syntheticEvent: a,
|
|
@@ -37,13 +37,13 @@ const x = (e) => {
|
|
|
37
37
|
};
|
|
38
38
|
e.onActionClick.call(void 0, n);
|
|
39
39
|
}
|
|
40
|
-
}, d = () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
40
|
+
}, d = () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(D, null, /* @__PURE__ */ t.createElement("div", { className: "k-card-description" }, /* @__PURE__ */ t.createElement("p", null, E), o && o.map((a, n) => /* @__PURE__ */ t.createElement(I, { key: n, src: a.src })))), i && /* @__PURE__ */ t.createElement(g, null, i.map((a, n) => /* @__PURE__ */ t.createElement(
|
|
41
41
|
"a",
|
|
42
42
|
{
|
|
43
43
|
key: n,
|
|
44
44
|
href: a.url,
|
|
45
45
|
className: "k-button k-button-md k-rounded-md k-button-flat k-button-flat-primary",
|
|
46
|
-
onClick:
|
|
46
|
+
onClick: b
|
|
47
47
|
},
|
|
48
48
|
a.text
|
|
49
49
|
))));
|
|
@@ -54,14 +54,15 @@ const x = (e) => {
|
|
|
54
54
|
className: u("k-timeline-card", { "k-collapsed": e.collapsible && r })
|
|
55
55
|
},
|
|
56
56
|
/* @__PURE__ */ t.createElement(
|
|
57
|
-
|
|
57
|
+
C,
|
|
58
58
|
{
|
|
59
|
-
|
|
59
|
+
id: e.panelId,
|
|
60
|
+
"aria-label": e.ariaLabel,
|
|
61
|
+
"aria-live": e.horizontal ? void 0 : "polite",
|
|
60
62
|
"aria-describedby": e.id,
|
|
61
|
-
"aria-atomic": "true",
|
|
62
63
|
tabIndex: e.tabindex,
|
|
63
64
|
role: e.horizontal ? "tabpanel" : "button",
|
|
64
|
-
"aria-expanded": e.collapsible
|
|
65
|
+
"aria-expanded": e.collapsible ? r : void 0,
|
|
65
66
|
className: "k-card-with-callout",
|
|
66
67
|
onClick: (a) => f(a)
|
|
67
68
|
},
|
|
@@ -78,7 +79,15 @@ const x = (e) => {
|
|
|
78
79
|
)
|
|
79
80
|
}
|
|
80
81
|
),
|
|
81
|
-
/* @__PURE__ */ t.createElement("div", { className: "k-card-inner" }, /* @__PURE__ */ t.createElement(
|
|
82
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-card-inner" }, /* @__PURE__ */ t.createElement(N, null, /* @__PURE__ */ t.createElement(h, null, /* @__PURE__ */ t.createElement("span", { className: "k-event-title" }, v), e.collapsible && /* @__PURE__ */ t.createElement(
|
|
83
|
+
x,
|
|
84
|
+
{
|
|
85
|
+
className: "k-event-collapse",
|
|
86
|
+
fillMode: "flat",
|
|
87
|
+
size: "xs",
|
|
88
|
+
svgIcon: T
|
|
89
|
+
}
|
|
90
|
+
)), l && /* @__PURE__ */ t.createElement(A, null, l)), e.collapsible ? /* @__PURE__ */ t.createElement(
|
|
82
91
|
y,
|
|
83
92
|
{
|
|
84
93
|
transitionEnterDuration: e.transitionDuration || 400,
|
|
@@ -91,10 +100,10 @@ const x = (e) => {
|
|
|
91
100
|
)
|
|
92
101
|
);
|
|
93
102
|
};
|
|
94
|
-
|
|
103
|
+
O.propTypes = {
|
|
95
104
|
onChange: s.func,
|
|
96
105
|
onActionClick: s.func
|
|
97
106
|
};
|
|
98
107
|
export {
|
|
99
|
-
|
|
108
|
+
O as TimelineCard
|
|
100
109
|
};
|
|
@@ -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"),ge=require("prop-types"),Te=require("./TimelineCard.js"),be=require("./utils.js"),X=require("@progress/kendo-svg-icons"),ke=require("@progress/kendo-react-intl"),v=require("@progress/kendo-react-common"),Y=require("@progress/kendo-react-buttons");function Ee(l){const I=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const g in l)if(g!=="default"){const T=Object.getOwnPropertyDescriptor(l,g);Object.defineProperty(I,g,T.get?T:{enumerable:!0,get:()=>l[g]})}}return I.default=l,Object.freeze(I)}const s=Ee(ve),G=l=>{const T=ke.useInternationalization(),[A,J]=s.useState(!1),[O,Q]=s.useState(!0),[Z,ee]=s.useState(),[f,L]=s.useState(0),[y,te]=s.useState(),[u,ne]=s.useState(0),[h,se]=s.useState(0),[a,D]=s.useState(1),[d,R]=s.useState(),[i,re]=s.useState(),[F,W]=s.useState([0,0,0]),[_,U]=s.useState(0),[P,ae]=s.useState(1),V=v.useId(),m=s.useRef(null),c=s.useRef(null),x=s.useRef(null),{eventsData:oe,dateFormat:$,navigatable:ie,onActionClick:ce}=l,j=y?`${y}%`:"150px",b=s.useRef(new v.Navigation({tabIndex:0,root:m,selectors:[".k-timeline-scrollable-wrap"]}));s.useEffect(()=>{m.current&&l.navigatable&&(setTimeout(()=>{const e=b.current.first;e&&e.setAttribute("tabindex",String(0))},0),b.current.keyboardEvents={keydown:{ArrowRight:ue,ArrowLeft:fe,End:me,Home:de}})},[l.navigatable,a,u]),s.useEffect(()=>{b.current.update()});const le=e=>{ie&&b.current&&b.current.triggerKeyboardEvent(e)};s.useEffect(()=>{var r;const e=v.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),q(),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(J(r),i){const o=i.length*n>u*n*((f*-1+100)/100);Q(o)}(e==null?void 0:e.offsetWidth)*-f/100>=e.children.length*n&&(q(),w(),L((t.offsetLeft-t.offsetWidth)/(u*t.offsetWidth)*100*-1)),M(t)}},[u,y,a]);const ue=(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+h<=o&&H(),E(o,n)}},fe=(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<h&&z(),E(o,n)}},de=(e,t,n)=>{if(c.current){if(a<=1)return;const r=1;N(!0,r,0,0),E(r,n)}},me=(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),p=o*-100,S=o*u;N(!0,r,S,p),E(r,n)}},q=()=>{const e=be.addYearsFlags(oe);re(e),R([e[a-1],e[a],e[a+1]])},z=()=>{var t;if(c.current&&i){const n=h-u,r=h-1,o=i[r]&&((t=i[r])!=null&&t.yearFlag)?r-1:r,p=f+100>0?0:f+100;N(!1,o,n,p)}},H=()=>{if(c.current&&i){const t=h+u,n=i[t]&&i[t].yearFlag?t+1:t,r=f-100;N(!0,n,t,r)}},N=(e,t,n,r)=>{C(e,t),w(),se(n),L(r),D(t)},C=(e,t)=>{if(d&&i){const n=k(e,P),r=Object.assign([],d,{[n]:i[t]});R(r),ae(n),U(e?-100:100),setTimeout(()=>{var K;const o=(K=m.current)==null?void 0:K.offsetWidth,p=Object.assign([],F,{[n]:0,[k(!0,n)]:o,[k(!1,n)]:o&&-o}),S=Object.assign([],r,{[k(!0,n)]:{},[k(!1,n)]:{}});R(S),W(p),U(0)},l.transitionDuration||300)}},k=(e,t)=>{const n=e?t+1:t-1;return d?n<0?d.length-1:n%d.length:0},M=e=>{var n,r;const t=(a-h)*e.offsetWidth+e.offsetWidth/2+(((r=(n=x.current)==null?void 0:n.element)==null?void 0:r.clientWidth)||0);ee(t)},E=(e,t)=>{t.preventDefault(),e>a?C(!0,e):e<a&&C(!1,e),D(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);M(t),te(100/n),ne(n)}},[]),he=()=>({transitionDuration:"300ms"}),B=e=>({transform:`translateX(${e}%)`,transformOrigin:"left top"});return s.createElement(s.Fragment,null,s.createElement("div",{className:"k-timeline-track-wrap",ref:m,onKeyDown:le},s.createElement(Y.Button,{ref:x,"aria-hidden":"true",rounded:"full",svgIcon:X.chevronLeftIcon,icon:"chevron-left",onClick:()=>A&&z(),className:v.classNames("k-timeline-arrow","k-timeline-arrow-left",{"k-disabled":!A})}),s.createElement(Y.Button,{"aria-hidden":"true",rounded:"full",svgIcon:X.chevronRightIcon,icon:"chevron-right",onClick:()=>O&&H(),className:v.classNames("k-timeline-arrow","k-timeline-arrow-right",{"k-disabled":!O})}),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==null?void 0:i.map((e,t)=>e.yearFlag?s.createElement("li",{role:"none","aria-hidden":"true",className:"k-timeline-track-item k-timeline-flag-wrap",style:{flex:`1 0 ${j}`},key:t},s.createElement("span",{className:"k-timeline-flag"},e.yearFlag)):s.createElement("li",{role:"tab",className:v.classNames("k-timeline-track-item",{"k-focus":t===a}),"aria-selected":t===a||void 0,"aria-describedby":t===a?V:void 0,style:{flex:`1 0 ${j}`},key:t},s.createElement("div",{className:"k-timeline-date-wrap"},s.createElement("span",{className:"k-timeline-date"},T.formatDate(e.date,$))),s.createElement("span",{onClick:n=>E(t,n),className:"k-timeline-circle"})))))),s.createElement("div",{className:"k-timeline-events-list"},s.createElement("ul",{className:"k-timeline-scrollable-wrap",style:_===0?{...B(_)}:{...B(_),...he()}},d&&d.map((e,t)=>t===P?s.createElement("li",{key:t,className:"k-timeline-event",style:{transform:`translate3d(${F[t]}px, 0px, 0px)`}},e&&s.createElement(Te.TimelineCard,{tabindex:0,panelId:V,eventData:e,ariaLabel:e.date?T.formatDate(e.date,$):void 0,onActionClick:ce,horizontal:!0,collapsible:!1,calloutStyle:{left:`${Z}px`}})):null))))};G.propTypes={onActionClick:ge.func};exports.TimelineHorizontal=G;
|