@progress/kendo-react-layout 14.5.0-develop.12 → 14.5.0-develop.14

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.
@@ -6,11 +6,11 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as n from "react";
9
- import r from "prop-types";
10
- import { TabStripNavigation as Y } from "./TabStripNavigation.mjs";
9
+ import l from "prop-types";
10
+ import { TabStripNavigation as ee } from "./TabStripNavigation.mjs";
11
11
  import { TabStripContent as ie } from "./TabStripContent.mjs";
12
- import { Navigation as ce, classNames as ae, kendoThemeMaps as ue } from "@progress/kendo-react-common";
13
- const de = {
12
+ import { useWebMcpRegister as ce, Navigation as ae, classNames as ue, kendoThemeMaps as de } from "@progress/kendo-react-common";
13
+ const be = {
14
14
  animation: !0,
15
15
  tabPosition: "top",
16
16
  tabAlignment: "start",
@@ -20,101 +20,101 @@ const de = {
20
20
  scrollButtons: "auto",
21
21
  scrollButtonsPosition: "split",
22
22
  renderAllContent: !1
23
- }, E = n.forwardRef((Z, _) => {
24
- const R = { ...de, ...Z }, {
23
+ }, D = n.forwardRef((E, te) => {
24
+ const h = n.useMemo(() => ({ ...be, ...E }), [E]), {
25
25
  id: m,
26
26
  animation: H,
27
- children: M,
27
+ children: O,
28
28
  selected: u,
29
- onSelect: A,
30
- style: ee,
31
- tabContentStyle: O,
32
- tabPosition: p,
33
- tabAlignment: z,
29
+ onSelect: N,
30
+ style: ne,
31
+ tabContentStyle: z,
32
+ tabPosition: b,
33
+ tabAlignment: W,
34
34
  tabIndex: L,
35
- className: W,
36
- dir: v,
35
+ className: K,
36
+ dir: x,
37
37
  renderAllContent: P,
38
- keepTabsMounted: K,
39
- size: h,
38
+ keepTabsMounted: j,
39
+ size: k,
40
40
  scrollable: g,
41
- scrollButtons: x,
42
- scrollButtonsPosition: j,
43
- buttonScrollSpeed: F,
44
- mouseScrollSpeed: te,
45
- prevButton: U,
46
- nextButton: $
47
- } = R, [f, ne] = n.useState(null), oe = n.useRef({ props: R }), C = n.useRef(null), D = n.useRef(null), T = n.useRef(void 0), I = n.useRef(void 0), q = n.useCallback(() => ({ props: R }), [R]);
48
- n.useImperativeHandle(oe, q), n.useImperativeHandle(_, q);
49
- const y = n.useMemo(() => m ? m + "-content-panel-id" : void 0, [m]), w = n.useMemo(() => m ? m + "-nav-item-id" : void 0, [m]), S = n.useMemo(() => n.Children.toArray(M).filter(Boolean), [M]), G = n.useCallback(() => /top|bottom/.test(p || "top"), [p]), k = n.useCallback(() => {
50
- const s = G(), i = D.current;
41
+ scrollButtons: C,
42
+ scrollButtonsPosition: F,
43
+ buttonScrollSpeed: U,
44
+ mouseScrollSpeed: $,
45
+ prevButton: q,
46
+ nextButton: G
47
+ } = h, [f, oe] = n.useState(null), J = n.useRef({ props: h }), T = n.useRef(null), A = n.useRef(null), I = n.useRef(void 0), R = n.useRef(void 0), Q = n.useCallback(() => ({ props: h }), [h]);
48
+ n.useImperativeHandle(J, Q), n.useImperativeHandle(te, Q), ce("tabstrip", J, h, h.webMcp);
49
+ const w = n.useMemo(() => m ? m + "-content-panel-id" : void 0, [m]), y = n.useMemo(() => m ? m + "-nav-item-id" : void 0, [m]), S = n.useMemo(() => n.Children.toArray(O).filter(Boolean), [O]), V = n.useCallback(() => /top|bottom/.test(b || "top"), [b]), v = n.useCallback(() => {
50
+ const s = V(), i = A.current;
51
51
  if (!i)
52
52
  return;
53
- const a = i.scrollLeft, t = i.clientWidth, e = i.scrollWidth, l = i.scrollTop, o = i.scrollHeight, d = i.clientHeight;
53
+ const a = i.scrollLeft, t = i.clientWidth, e = i.scrollWidth, r = i.scrollTop, o = i.scrollHeight, d = i.clientHeight;
54
54
  let c = null;
55
- const re = s ? e > t : o > d, X = v === "rtl";
56
- re ? s ? a + t === e || (X && t - a) === e ? c = "end" : a === 0 || X && -a === 0 ? c = "start" : a > 0 && a + t < e || -a > 0 && t - a < e ? c = "middle" : c = null : o - (l + d) === 0 ? c = "bottom" : l === 0 ? c = "top" : l > 0 && o - (l + d) > 0 ? c = "middle" : c = null : c = null, ne(c);
57
- }, [G, v]), B = n.useCallback(
55
+ const le = s ? e > t : o > d, _ = x === "rtl";
56
+ le ? s ? a + t === e || (_ && t - a) === e ? c = "end" : a === 0 || _ && -a === 0 ? c = "start" : a > 0 && a + t < e || -a > 0 && t - a < e ? c = "middle" : c = null : o - (r + d) === 0 ? c = "bottom" : r === 0 ? c = "top" : r > 0 && o - (r + d) > 0 ? c = "middle" : c = null : c = null, oe(c);
57
+ }, [V, x]), M = n.useCallback(
58
58
  (s) => {
59
- u !== s && A && A({
59
+ u !== s && N && N({
60
60
  selected: s
61
61
  });
62
62
  },
63
- [u, A]
64
- ), b = n.useCallback(
63
+ [u, N]
64
+ ), p = n.useCallback(
65
65
  (s) => {
66
66
  var t, e;
67
67
  const i = S;
68
- ((e = (t = i == null ? void 0 : i[s]) == null ? void 0 : t.props) == null ? void 0 : e.disabled) || B(s);
68
+ ((e = (t = i == null ? void 0 : i[s]) == null ? void 0 : t.props) == null ? void 0 : e.disabled) || M(s);
69
69
  },
70
- [S, B]
71
- ), J = n.useCallback((s) => {
72
- I.current && I.current.triggerKeyboardEvent(s);
70
+ [S, M]
71
+ ), X = n.useCallback((s) => {
72
+ R.current && R.current.triggerKeyboardEvent(s);
73
73
  }, []);
74
74
  n.useEffect(() => {
75
75
  var a;
76
- const s = C.current, i = s && getComputedStyle(s).direction === "rtl" || !1;
77
- return s && (I.current = new ce({
76
+ const s = T.current, i = s && getComputedStyle(s).direction === "rtl" || !1;
77
+ return s && (R.current = new ae({
78
78
  tabIndex: 0,
79
- root: C,
79
+ root: T,
80
80
  rovingTabIndex: !0,
81
81
  focusClass: "k-focus",
82
82
  selectors: [".k-tabstrip .k-tabstrip-item"],
83
83
  keyboardEvents: {
84
84
  keydown: {
85
- ArrowLeft: (t, e, l) => {
86
- l.preventDefault();
85
+ ArrowLeft: (t, e, r) => {
86
+ r.preventDefault();
87
87
  const o = e.elements.indexOf(t), d = o !== 0 ? o - 1 : e.elements.length - 1, c = o !== e.elements.length - 1 ? o + 1 : 0;
88
- i ? (e.focusNext(t), b(c)) : (e.focusPrevious(t), b(d));
88
+ i ? (e.focusNext(t), p(c)) : (e.focusPrevious(t), p(d));
89
89
  },
90
- ArrowRight: (t, e, l) => {
91
- l.preventDefault();
90
+ ArrowRight: (t, e, r) => {
91
+ r.preventDefault();
92
92
  const o = e.elements.indexOf(t), d = o !== 0 ? o - 1 : e.elements.length - 1, c = o !== e.elements.length - 1 ? o + 1 : 0;
93
- i ? (e.focusPrevious(t), b(d)) : (e.focusNext(t), b(c));
93
+ i ? (e.focusPrevious(t), p(d)) : (e.focusNext(t), p(c));
94
94
  },
95
- ArrowDown: (t, e, l) => {
96
- l.preventDefault();
95
+ ArrowDown: (t, e, r) => {
96
+ r.preventDefault();
97
97
  const o = e.elements.indexOf(t), d = o !== e.elements.length - 1 ? o + 1 : 0;
98
- e.focusNext(t), b(d);
98
+ e.focusNext(t), p(d);
99
99
  },
100
- ArrowUp: (t, e, l) => {
101
- l.preventDefault();
100
+ ArrowUp: (t, e, r) => {
101
+ r.preventDefault();
102
102
  const o = e.elements.indexOf(t), d = o !== 0 ? o - 1 : e.elements.length - 1;
103
- e.focusPrevious(t), b(d);
103
+ e.focusPrevious(t), p(d);
104
104
  },
105
- Home: (t, e, l) => {
106
- l.preventDefault(), e.focusElement(e.first, t), b(0);
105
+ Home: (t, e, r) => {
106
+ r.preventDefault(), e.focusElement(e.first, t), p(0);
107
107
  },
108
- End: (t, e, l) => {
109
- l.preventDefault(), e.focusElement(e.last, t), b(e.elements.length - 1);
108
+ End: (t, e, r) => {
109
+ r.preventDefault(), e.focusElement(e.last, t), p(e.elements.length - 1);
110
110
  }
111
111
  }
112
112
  }
113
- }), (a = I.current) == null || a.initializeRovingTab(u), k(), T.current = window.ResizeObserver && new ResizeObserver(() => k()), C.current && T.current && T.current.observe(C.current)), () => {
113
+ }), (a = R.current) == null || a.initializeRovingTab(u), v(), I.current = window.ResizeObserver && new ResizeObserver(() => v()), T.current && I.current && I.current.observe(T.current)), () => {
114
114
  var t;
115
- (t = I.current) == null || t.removeFocusListener(), T.current && T.current.disconnect();
115
+ (t = R.current) == null || t.removeFocusListener(), I.current && I.current.disconnect();
116
116
  };
117
- }, [u, b, k]);
117
+ }, [u, p, v]);
118
118
  const se = n.useMemo(() => {
119
119
  const s = n.Children.count(S);
120
120
  return u < s && u > -1 ? /* @__PURE__ */ n.createElement(
@@ -122,103 +122,104 @@ const de = {
122
122
  {
123
123
  index: u,
124
124
  selected: u,
125
- contentPanelId: y,
126
- navItemId: w,
125
+ contentPanelId: w,
126
+ navItemId: y,
127
127
  animation: H,
128
- keepTabsMounted: K,
128
+ keepTabsMounted: j,
129
129
  renderAllContent: P,
130
- style: O
130
+ style: z
131
131
  },
132
132
  S
133
133
  ) : null;
134
- }, [u, S, y, w, H, K, P, O]), N = x === "hidden" || f === null && x === "auto" ? "hidden" : "visible", Q = n.useMemo(
134
+ }, [u, S, w, y, H, j, P, z]), B = C === "hidden" || f === null && C === "auto" ? "hidden" : "visible", Y = n.useMemo(
135
135
  () => ({
136
- itemsNavRef: D,
136
+ itemsNavRef: A,
137
137
  children: S,
138
138
  selected: u,
139
139
  tabIndex: L,
140
- tabPosition: p,
141
- tabAlignment: z,
142
- size: h,
140
+ tabPosition: b,
141
+ tabAlignment: W,
142
+ size: k,
143
143
  scrollable: g,
144
- scrollButtons: N,
145
- scrollButtonsPosition: j,
146
- buttonScrollSpeed: F,
147
- mouseScrollSpeed: te,
148
- prevButton: U,
149
- nextButton: $,
150
- dir: v,
151
- contentPanelId: y,
144
+ scrollButtons: B,
145
+ scrollButtonsPosition: F,
146
+ buttonScrollSpeed: U,
147
+ mouseScrollSpeed: $,
148
+ prevButton: q,
149
+ nextButton: G,
150
+ dir: x,
151
+ contentPanelId: w,
152
152
  renderAllContent: P,
153
- navItemId: w,
154
- onKeyDown: J,
155
- onSelect: B,
156
- onScroll: k,
153
+ navItemId: y,
154
+ onKeyDown: X,
155
+ onSelect: M,
156
+ onScroll: v,
157
157
  containerScrollPosition: f
158
158
  }),
159
159
  [
160
- D,
160
+ A,
161
161
  S,
162
162
  u,
163
163
  L,
164
- p,
165
- z,
166
- h,
164
+ b,
165
+ W,
166
+ k,
167
167
  g,
168
- N,
169
- j,
168
+ B,
170
169
  F,
171
170
  U,
172
171
  $,
173
- v,
174
- y,
175
- P,
172
+ q,
173
+ G,
174
+ x,
176
175
  w,
177
- J,
178
- B,
179
- k,
176
+ P,
177
+ y,
178
+ X,
179
+ M,
180
+ v,
180
181
  f
181
182
  ]
182
- ), V = p === "bottom", le = n.useMemo(
183
- () => ae(
183
+ ), Z = b === "bottom", re = n.useMemo(
184
+ () => ue(
184
185
  "k-tabstrip k-pos-relative",
185
186
  {
186
- [`k-tabstrip-${ue.sizeMap[h || "medium"] || h}`]: h,
187
- "k-tabstrip-left": p === "left",
188
- "k-tabstrip-right": p === "right",
189
- "k-tabstrip-bottom": p === "bottom",
190
- "k-tabstrip-top": p === "top",
187
+ [`k-tabstrip-${de.sizeMap[k || "medium"] || k}`]: k,
188
+ "k-tabstrip-left": b === "left",
189
+ "k-tabstrip-right": b === "right",
190
+ "k-tabstrip-bottom": b === "bottom",
191
+ "k-tabstrip-top": b === "top",
191
192
  "k-tabstrip-scrollable": g,
192
- "k-tabstrip-scrollable-start k-tabstrip-scrollable-end": g && N === "visible",
193
- "k-tabstrip-scrollable-start": g && x === "auto" && (f === "end" || f === "middle"),
194
- "k-tabstrip-scrollable-end": g && x === "auto" && (f === "start" || f === "middle")
193
+ "k-tabstrip-scrollable-start k-tabstrip-scrollable-end": g && B === "visible",
194
+ "k-tabstrip-scrollable-start": g && C === "auto" && (f === "end" || f === "middle"),
195
+ "k-tabstrip-scrollable-end": g && C === "auto" && (f === "start" || f === "middle")
195
196
  },
196
- W
197
+ K
197
198
  ),
198
- [h, p, g, x, N, f, W]
199
+ [k, b, g, C, B, f, K]
199
200
  );
200
- return /* @__PURE__ */ n.createElement("div", { id: m, ref: C, dir: v, className: le, style: ee, onScroll: k }, !V && /* @__PURE__ */ n.createElement(Y, { ...Q }), se, V && /* @__PURE__ */ n.createElement(Y, { ...Q }));
201
+ return /* @__PURE__ */ n.createElement("div", { id: m, ref: T, dir: x, className: re, style: ne, onScroll: v }, !Z && /* @__PURE__ */ n.createElement(ee, { ...Y }), se, Z && /* @__PURE__ */ n.createElement(ee, { ...Y }));
201
202
  });
202
- E.displayName = "TabStrip";
203
- E.propTypes = {
204
- id: r.string,
205
- animation: r.bool,
206
- children: r.node,
207
- onSelect: r.func,
208
- selected: r.number,
209
- style: r.object,
210
- tabContentStyle: r.object,
211
- tabPosition: r.string,
212
- tabAlignment: r.string,
213
- tabIndex: r.number,
214
- className: r.string,
215
- dir: r.string,
216
- renderAllContent: r.bool,
217
- size: r.oneOf(["small", "medium", "large"]),
218
- scrollButtons: r.oneOf(["auto", "visible", "hidden"]),
219
- scrollButtonsPosition: r.oneOf(["split", "start", "end", "around", "before", "after"])
203
+ D.displayName = "TabStrip";
204
+ D.propTypes = {
205
+ id: l.string,
206
+ animation: l.bool,
207
+ children: l.node,
208
+ onSelect: l.func,
209
+ selected: l.number,
210
+ style: l.object,
211
+ tabContentStyle: l.object,
212
+ tabPosition: l.string,
213
+ tabAlignment: l.string,
214
+ tabIndex: l.number,
215
+ className: l.string,
216
+ dir: l.string,
217
+ renderAllContent: l.bool,
218
+ size: l.oneOf(["small", "medium", "large"]),
219
+ scrollButtons: l.oneOf(["auto", "visible", "hidden"]),
220
+ scrollButtonsPosition: l.oneOf(["split", "start", "end", "around", "before", "after"])
220
221
  };
221
- const ge = E;
222
+ const Se = D;
222
223
  export {
223
- ge as TabStrip
224
+ Se as TabStrip
224
225
  };