@progress/kendo-react-layout 7.4.0-develop.9 → 7.5.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/appbar/AppBar.js +1 -1
- package/appbar/AppBar.mjs +41 -43
- package/breadcrumb/BreadcrumbLink.js +1 -1
- package/breadcrumb/BreadcrumbLink.mjs +22 -22
- package/card/Card.js +1 -1
- package/card/Card.mjs +19 -19
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/index.d.mts +17 -9
- package/index.d.ts +17 -9
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +9 -10
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +68 -65
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +74 -70
- package/splitter/Splitter.js +1 -1
- package/splitter/Splitter.mjs +6 -7
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +48 -48
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +76 -75
- package/timeline/TimelineCard.js +1 -1
- package/timeline/TimelineCard.mjs +15 -20
- package/timeline/TimelineHorizontal.js +1 -1
- package/timeline/TimelineHorizontal.mjs +98 -93
|
@@ -6,24 +6,25 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as s from "react";
|
|
10
10
|
import ft from "prop-types";
|
|
11
11
|
import { TimelineCard as ut } from "./TimelineCard.mjs";
|
|
12
12
|
import { addYearsFlags as mt } from "./utils.mjs";
|
|
13
|
-
import { caretAltLeftIcon as dt, caretAltRightIcon as
|
|
14
|
-
import { useInternationalization as
|
|
15
|
-
import { Navigation as Et, canUseDOM as
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import { caretAltLeftIcon as dt, caretAltRightIcon as Tt } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { useInternationalization as ht } from "@progress/kendo-react-intl";
|
|
15
|
+
import { Navigation as Et, canUseDOM as vt, classNames as R } from "@progress/kendo-react-common";
|
|
16
|
+
import { Button as z } from "@progress/kendo-react-buttons";
|
|
17
|
+
const gt = (g) => {
|
|
18
|
+
const M = ht(), [_, j] = s.useState(!1), [y, 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", T = s.useRef(new Et({
|
|
18
19
|
tabIndex: 0,
|
|
19
20
|
root: m,
|
|
20
21
|
selectors: [".k-timeline-scrollable-wrap"]
|
|
21
22
|
}));
|
|
22
|
-
|
|
23
|
-
m.current &&
|
|
24
|
-
const t =
|
|
23
|
+
s.useEffect(() => {
|
|
24
|
+
m.current && g.navigatable && (setTimeout(() => {
|
|
25
|
+
const t = T.current.first;
|
|
25
26
|
t && t.setAttribute("tabindex", String(0));
|
|
26
|
-
}, 0),
|
|
27
|
+
}, 0), T.current.keyboardEvents = {
|
|
27
28
|
keydown: {
|
|
28
29
|
ArrowRight: at,
|
|
29
30
|
ArrowLeft: ot,
|
|
@@ -31,104 +32,104 @@ const vt = (v) => {
|
|
|
31
32
|
Home: it
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
|
-
}, [
|
|
35
|
-
|
|
35
|
+
}, [g.navigatable, a, l]), s.useEffect(() => {
|
|
36
|
+
T.current.update();
|
|
36
37
|
});
|
|
37
38
|
const rt = (t) => {
|
|
38
|
-
nt &&
|
|
39
|
+
nt && T.current && T.current.triggerKeyboardEvent(t);
|
|
39
40
|
};
|
|
40
|
-
|
|
41
|
+
s.useEffect(() => {
|
|
41
42
|
var r;
|
|
42
|
-
const t =
|
|
43
|
-
return t && e && t.observe(e),
|
|
43
|
+
const t = vt && window.ResizeObserver && new window.ResizeObserver(p), e = i.current, n = ((r = m == null ? void 0 : m.current) == null ? void 0 : r.offsetWidth) || 0;
|
|
44
|
+
return t && e && t.observe(e), U(), p(), O([n, 0, -n]), () => {
|
|
44
45
|
t && t.disconnect();
|
|
45
46
|
};
|
|
46
|
-
}, []),
|
|
47
|
+
}, []), s.useEffect(() => {
|
|
47
48
|
const t = i.current, e = t && t.children[a];
|
|
48
49
|
if (e) {
|
|
49
|
-
const
|
|
50
|
+
const n = e.offsetWidth, r = !(f >= 0);
|
|
50
51
|
if (j(r), c) {
|
|
51
|
-
const o = c.length *
|
|
52
|
+
const o = c.length * n > l * n * ((f * -1 + 100) / 100);
|
|
52
53
|
K(o);
|
|
53
54
|
}
|
|
54
|
-
(t == null ? void 0 : t.offsetWidth) * -f / 100 >= t.children.length *
|
|
55
|
+
(t == null ? void 0 : t.offsetWidth) * -f / 100 >= t.children.length * n && (U(), p(), S((e.offsetLeft - e.offsetWidth) / (l * e.offsetWidth) * 100 * -1)), V(e);
|
|
55
56
|
}
|
|
56
|
-
}, [l,
|
|
57
|
-
const at = (t, e,
|
|
57
|
+
}, [l, b, a]);
|
|
58
|
+
const at = (t, e, n) => {
|
|
58
59
|
if (i.current) {
|
|
59
60
|
const r = i.current.children[a + 1], o = r && r.classList.contains("k-timeline-flag-wrap") ? a + 2 : a + 1;
|
|
60
61
|
if (c && c.length <= o)
|
|
61
62
|
return;
|
|
62
|
-
l + d <= o && P(), E(o,
|
|
63
|
+
l + d <= o && P(), E(o, n);
|
|
63
64
|
}
|
|
64
|
-
}, ot = (t, e,
|
|
65
|
+
}, ot = (t, e, n) => {
|
|
65
66
|
if (i.current) {
|
|
66
67
|
const r = i.current && i.current.children[a - 1], o = r && r.classList.contains("k-timeline-flag-wrap") ? a - 2 : a - 1;
|
|
67
68
|
if (o <= 0)
|
|
68
69
|
return;
|
|
69
|
-
o < d &&
|
|
70
|
+
o < d && x(), E(o, n);
|
|
70
71
|
}
|
|
71
|
-
}, it = (t, e,
|
|
72
|
+
}, it = (t, e, n) => {
|
|
72
73
|
if (i.current) {
|
|
73
74
|
if (a <= 1)
|
|
74
75
|
return;
|
|
75
76
|
const r = 1;
|
|
76
|
-
|
|
77
|
+
k(!0, r, 0, 0), E(r, n);
|
|
77
78
|
}
|
|
78
|
-
}, ct = (t, e,
|
|
79
|
+
}, ct = (t, e, n) => {
|
|
79
80
|
if (i.current) {
|
|
80
81
|
const r = i.current && i.current.children.length - 1;
|
|
81
82
|
if (r <= a)
|
|
82
83
|
return;
|
|
83
|
-
const o = Math.floor(r / l),
|
|
84
|
-
|
|
84
|
+
const o = Math.floor(r / l), v = o * -100, C = o * l;
|
|
85
|
+
k(!0, r, C, v), E(r, n);
|
|
85
86
|
}
|
|
86
|
-
},
|
|
87
|
+
}, U = () => {
|
|
87
88
|
const t = mt(tt);
|
|
88
|
-
J(t),
|
|
89
|
-
},
|
|
89
|
+
J(t), I([t[a - 1], t[a], t[a + 1]]);
|
|
90
|
+
}, x = () => {
|
|
90
91
|
var e;
|
|
91
92
|
if (i.current && c) {
|
|
92
|
-
const
|
|
93
|
-
|
|
93
|
+
const n = d - l, r = d - 1, o = c[r] && ((e = c[r]) != null && e.yearFlag) ? r - 1 : r, v = f + 100 > 0 ? 0 : f + 100;
|
|
94
|
+
k(!1, o, n, v);
|
|
94
95
|
}
|
|
95
96
|
}, P = () => {
|
|
96
97
|
if (i.current && c) {
|
|
97
|
-
const e = d + l,
|
|
98
|
-
|
|
98
|
+
const e = d + l, n = c[e] && c[e].yearFlag ? e + 1 : e, r = f - 100;
|
|
99
|
+
k(!0, n, e, r);
|
|
99
100
|
}
|
|
100
|
-
},
|
|
101
|
-
A(t, e), p(), G(
|
|
101
|
+
}, k = (t, e, n, r) => {
|
|
102
|
+
A(t, e), p(), G(n), S(r), L(e);
|
|
102
103
|
}, A = (t, e) => {
|
|
103
104
|
if (u && c) {
|
|
104
|
-
const
|
|
105
|
-
|
|
105
|
+
const n = h(t, Q), r = Object.assign([], u, { [n]: c[e] });
|
|
106
|
+
I(r), Z(n), F(t ? -100 : 100), setTimeout(() => {
|
|
106
107
|
var H;
|
|
107
|
-
const o = (H = m.current) == null ? void 0 : H.offsetWidth,
|
|
108
|
-
[
|
|
109
|
-
[
|
|
110
|
-
[
|
|
108
|
+
const o = (H = m.current) == null ? void 0 : H.offsetWidth, v = Object.assign([], w, {
|
|
109
|
+
[n]: 0,
|
|
110
|
+
[h(!0, n)]: o,
|
|
111
|
+
[h(!1, n)]: o && -o
|
|
111
112
|
}), C = Object.assign([], r, {
|
|
112
|
-
[
|
|
113
|
-
[
|
|
113
|
+
[h(!0, n)]: {},
|
|
114
|
+
[h(!1, n)]: {}
|
|
114
115
|
});
|
|
115
|
-
|
|
116
|
-
},
|
|
116
|
+
I(C), O(v), F(0);
|
|
117
|
+
}, g.transitionDuration || 300);
|
|
117
118
|
}
|
|
118
|
-
},
|
|
119
|
-
const
|
|
120
|
-
return u ?
|
|
119
|
+
}, h = (t, e) => {
|
|
120
|
+
const n = t ? e + 1 : e - 1;
|
|
121
|
+
return u ? n < 0 ? u.length - 1 : n % u.length : 0;
|
|
121
122
|
}, V = (t) => {
|
|
122
|
-
var
|
|
123
|
-
const e = (a - d) * t.offsetWidth + t.offsetWidth / 2 + (((
|
|
123
|
+
var n;
|
|
124
|
+
const e = (a - d) * t.offsetWidth + t.offsetWidth / 2 + (((n = W.current) == null ? void 0 : n.offsetWidth) || 0);
|
|
124
125
|
Y(e);
|
|
125
126
|
}, E = (t, e) => {
|
|
126
|
-
e.preventDefault(), t > a ? A(!0, t) : t < a && A(!1, t),
|
|
127
|
-
}, p =
|
|
127
|
+
e.preventDefault(), t > a ? A(!0, t) : t < a && A(!1, t), L(t);
|
|
128
|
+
}, p = s.useCallback(() => {
|
|
128
129
|
const t = i.current, e = t && t.children[a];
|
|
129
130
|
if (t instanceof HTMLElement && e) {
|
|
130
|
-
const
|
|
131
|
-
V(e),
|
|
131
|
+
const n = Math.round(t.offsetWidth / 150);
|
|
132
|
+
V(e), B(100 / n), q(n);
|
|
132
133
|
}
|
|
133
134
|
}, []), lt = () => ({
|
|
134
135
|
transitionDuration: "300ms"
|
|
@@ -136,34 +137,38 @@ const vt = (v) => {
|
|
|
136
137
|
transform: `translateX(${t}%)`,
|
|
137
138
|
transformOrigin: "left top"
|
|
138
139
|
});
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
-
|
|
140
|
+
return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("div", { className: "k-timeline-track-wrap", ref: m, onKeyDown: rt }, /* @__PURE__ */ s.createElement(
|
|
141
|
+
z,
|
|
141
142
|
{
|
|
142
|
-
ref:
|
|
143
|
+
ref: W,
|
|
143
144
|
"aria-hidden": "true",
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
fillMode: "solid",
|
|
146
|
+
rounded: "full",
|
|
147
|
+
svgIcon: dt,
|
|
148
|
+
icon: "caret-alt-left",
|
|
149
|
+
onClick: () => _ && x(),
|
|
150
|
+
className: R(
|
|
146
151
|
"k-timeline-arrow",
|
|
147
152
|
"k-timeline-arrow-left",
|
|
148
|
-
"k-
|
|
149
|
-
{ "k-disabled": !y }
|
|
153
|
+
{ "k-disabled": !_ }
|
|
150
154
|
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"button",
|
|
155
|
+
}
|
|
156
|
+
), /* @__PURE__ */ s.createElement(
|
|
157
|
+
z,
|
|
155
158
|
{
|
|
156
159
|
"aria-hidden": "true",
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
fillMode: "solid",
|
|
161
|
+
rounded: "full",
|
|
162
|
+
svgIcon: Tt,
|
|
163
|
+
icon: "caret-alt-right",
|
|
164
|
+
onClick: () => y && P(),
|
|
165
|
+
className: R(
|
|
159
166
|
"k-timeline-arrow",
|
|
160
167
|
"k-timeline-arrow-right",
|
|
161
|
-
"k-
|
|
162
|
-
{ "k-disabled": !R }
|
|
168
|
+
{ "k-disabled": !y }
|
|
163
169
|
)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
), /* @__PURE__ */ n.createElement("div", { className: "k-timeline-track" }, /* @__PURE__ */ n.createElement(
|
|
170
|
+
}
|
|
171
|
+
), /* @__PURE__ */ s.createElement("div", { className: "k-timeline-track" }, /* @__PURE__ */ s.createElement(
|
|
167
172
|
"ul",
|
|
168
173
|
{
|
|
169
174
|
ref: i,
|
|
@@ -172,54 +177,54 @@ const vt = (v) => {
|
|
|
172
177
|
tabIndex: 0,
|
|
173
178
|
style: { transform: `translateX(${f}%)` }
|
|
174
179
|
},
|
|
175
|
-
c && c.map((t, e) => t.yearFlag ? /* @__PURE__ */
|
|
180
|
+
c && c.map((t, e) => t.yearFlag ? /* @__PURE__ */ s.createElement(
|
|
176
181
|
"li",
|
|
177
182
|
{
|
|
178
183
|
role: "none",
|
|
179
184
|
className: "k-timeline-track-item k-timeline-flag-wrap",
|
|
180
|
-
style: { flex: `1 0 ${
|
|
185
|
+
style: { flex: `1 0 ${D}` },
|
|
181
186
|
key: e
|
|
182
187
|
},
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
) : /* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ s.createElement("span", { className: "k-timeline-flag" }, t.yearFlag)
|
|
189
|
+
) : /* @__PURE__ */ s.createElement(
|
|
185
190
|
"li",
|
|
186
191
|
{
|
|
187
192
|
role: "tab",
|
|
188
|
-
className:
|
|
193
|
+
className: R(
|
|
189
194
|
"k-timeline-track-item",
|
|
190
195
|
{ "k-focus": e === a }
|
|
191
196
|
),
|
|
192
197
|
"aria-selected": e === a,
|
|
193
|
-
style: { flex: `1 0 ${
|
|
198
|
+
style: { flex: `1 0 ${D}` },
|
|
194
199
|
key: e
|
|
195
200
|
},
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ s.createElement("div", { className: "k-timeline-date-wrap" }, /* @__PURE__ */ s.createElement("span", { className: "k-timeline-date" }, M.formatDate(t.date, et))),
|
|
202
|
+
/* @__PURE__ */ s.createElement(
|
|
198
203
|
"span",
|
|
199
204
|
{
|
|
200
|
-
onClick: (
|
|
205
|
+
onClick: (n) => E(e, n),
|
|
201
206
|
className: "k-timeline-circle"
|
|
202
207
|
}
|
|
203
208
|
)
|
|
204
209
|
))
|
|
205
|
-
))), /* @__PURE__ */
|
|
210
|
+
))), /* @__PURE__ */ s.createElement("div", { className: "k-timeline-events-list" }, /* @__PURE__ */ s.createElement(
|
|
206
211
|
"ul",
|
|
207
212
|
{
|
|
208
213
|
className: "k-timeline-scrollable-wrap",
|
|
209
|
-
style:
|
|
214
|
+
style: N === 0 ? { ...$(N) } : { ...$(N), ...lt() }
|
|
210
215
|
},
|
|
211
216
|
u && u.map(
|
|
212
|
-
(t, e) => /* @__PURE__ */
|
|
217
|
+
(t, e) => /* @__PURE__ */ s.createElement(
|
|
213
218
|
"li",
|
|
214
219
|
{
|
|
215
220
|
key: e,
|
|
216
221
|
className: "k-timeline-event",
|
|
217
|
-
style: { transform: `translate3d(${
|
|
222
|
+
style: { transform: `translate3d(${w[e]}px, 0px, 0px)` }
|
|
218
223
|
},
|
|
219
|
-
t && /* @__PURE__ */
|
|
224
|
+
t && /* @__PURE__ */ s.createElement(
|
|
220
225
|
ut,
|
|
221
226
|
{
|
|
222
|
-
tabindex:
|
|
227
|
+
tabindex: w[e] === 0 ? 0 : -1,
|
|
223
228
|
eventData: t,
|
|
224
229
|
onActionClick: st,
|
|
225
230
|
horizontal: !0,
|
|
@@ -231,9 +236,9 @@ const vt = (v) => {
|
|
|
231
236
|
)
|
|
232
237
|
)));
|
|
233
238
|
};
|
|
234
|
-
|
|
239
|
+
gt.propTypes = {
|
|
235
240
|
onActionClick: ft.func
|
|
236
241
|
};
|
|
237
242
|
export {
|
|
238
|
-
|
|
243
|
+
gt as TimelineHorizontal
|
|
239
244
|
};
|