@progress/kendo-react-layout 7.4.0-develop.1 → 7.4.0-develop.11
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/index.d.mts +26 -6
- package/index.d.ts +26 -6
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +3 -3
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +3 -2
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +24 -22
- package/tabstrip/TabStripContent.js +1 -1
- package/tabstrip/TabStripContent.mjs +64 -33
- package/tabstrip/TabStripNavigation.js +1 -1
- package/tabstrip/TabStripNavigation.mjs +35 -34
- package/tabstrip/TabStripNavigationItem.js +1 -1
- package/tabstrip/TabStripNavigationItem.mjs +7 -7
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as a from "react";
|
|
10
|
-
import
|
|
11
|
-
import { TabStripNavigationItem as
|
|
10
|
+
import h from "prop-types";
|
|
11
|
+
import { TabStripNavigationItem as g } from "./TabStripNavigationItem.mjs";
|
|
12
12
|
import { classNames as I } from "@progress/kendo-react-common";
|
|
13
13
|
import { Button as x } from "@progress/kendo-react-buttons";
|
|
14
14
|
import { caretAltRightIcon as P, caretAltLeftIcon as k, caretAltUpIcon as A, caretAltDownIcon as M } from "@progress/kendo-svg-icons";
|
|
15
|
-
const E = (
|
|
15
|
+
const E = (w) => Array.apply(null, Array(w)), L = (w) => w.preventDefault(), b = "smooth", d = "prev", u = "next", T = class T extends a.Component {
|
|
16
16
|
constructor(l) {
|
|
17
17
|
super(l), this.itemsNavRef = a.createRef(), this.isRtl = () => this.props.dir === "rtl", this.onWheel = (t) => {
|
|
18
18
|
t.stopPropagation();
|
|
@@ -29,20 +29,20 @@ const E = (S) => Array.apply(null, Array(S)), L = (S) => S.preventDefault(), b =
|
|
|
29
29
|
if (!e)
|
|
30
30
|
return;
|
|
31
31
|
const n = this.horizontalScroll(), c = n ? e.scrollWidth - e.offsetWidth : e.scrollHeight - e.offsetHeight, r = (s.type === "click" ? this.props.buttonScrollSpeed : this.props.mouseScrollSpeed) || 0;
|
|
32
|
-
let o = n ? e.scrollLeft : e.scrollTop, i = n ? e.scrollWidth - e.scrollLeft : e.scrollHeight - e.scrollTop,
|
|
33
|
-
this.isRtl() && this.horizontalScroll() ? (t === d && o < 0 && (o += r,
|
|
34
|
-
const
|
|
32
|
+
let o = n ? e.scrollLeft : e.scrollTop, i = n ? e.scrollWidth - e.scrollLeft : e.scrollHeight - e.scrollTop, f = e.scrollWidth - e.scrollLeft * -1;
|
|
33
|
+
this.isRtl() && this.horizontalScroll() ? (t === d && o < 0 && (o += r, f += r), t === u && o < c && (o -= r, f -= r), o = Math.min(0, Math.min(c, o))) : (t === d && o > 0 && (o -= r, i += r), t === u && o < c && (o += r, i -= r), o = Math.max(0, Math.min(c, o)));
|
|
34
|
+
const m = o === 0, v = s.type === "click" ? b : void 0;
|
|
35
35
|
if (n) {
|
|
36
|
-
const
|
|
36
|
+
const S = this.isRtl() ? Math.round(f) <= e.clientWidth || Math.floor(f) <= e.clientWidth : Math.round(i) <= e.clientWidth || Math.floor(i) <= e.clientWidth;
|
|
37
37
|
this.setState({
|
|
38
|
-
disabledPrev:
|
|
39
|
-
disabledNext:
|
|
40
|
-
}), e.scrollTo({ left: o, behavior:
|
|
38
|
+
disabledPrev: m,
|
|
39
|
+
disabledNext: S
|
|
40
|
+
}), e.scrollTo({ left: o, behavior: v });
|
|
41
41
|
} else
|
|
42
42
|
this.setState({
|
|
43
|
-
disabledPrev:
|
|
43
|
+
disabledPrev: m,
|
|
44
44
|
disabledNext: Math.round(i) <= e.clientHeight || Math.floor(i) <= e.clientHeight
|
|
45
|
-
}), e.scrollTo({ top: o, behavior:
|
|
45
|
+
}), e.scrollTo({ top: o, behavior: v });
|
|
46
46
|
}, this.renderArrow = (t, s) => {
|
|
47
47
|
const e = this.horizontalScroll(), n = {
|
|
48
48
|
prev: {
|
|
@@ -94,47 +94,48 @@ const E = (S) => Array.apply(null, Array(S)), L = (S) => S.preventDefault(), b =
|
|
|
94
94
|
* @hidden
|
|
95
95
|
*/
|
|
96
96
|
render() {
|
|
97
|
-
const { selected: l, tabPosition: t, children: s, onSelect: e, onKeyDown: n, navItemId: c, contentPanelId: r } = this.props,
|
|
98
|
-
let
|
|
99
|
-
s && (
|
|
100
|
-
const
|
|
97
|
+
const { selected: l, tabPosition: t, children: s, onSelect: e, onKeyDown: n, navItemId: c, contentPanelId: r, renderAllContent: o } = this.props, i = a.Children.count(s), f = a.Children.toArray(s);
|
|
98
|
+
let m;
|
|
99
|
+
s && (m = E(i).map((W, p, C) => {
|
|
100
|
+
const R = {
|
|
101
101
|
active: l === p,
|
|
102
|
-
disabled:
|
|
102
|
+
disabled: f[p].props.disabled,
|
|
103
103
|
index: p,
|
|
104
|
-
title:
|
|
104
|
+
title: f[p].props.title,
|
|
105
105
|
first: p === 0,
|
|
106
|
-
last: p ===
|
|
106
|
+
last: p === C.length - 1,
|
|
107
107
|
contentPanelId: r,
|
|
108
|
+
renderAllContent: o,
|
|
108
109
|
id: c,
|
|
109
110
|
onSelect: e
|
|
110
111
|
};
|
|
111
|
-
return /* @__PURE__ */ a.createElement(
|
|
112
|
+
return /* @__PURE__ */ a.createElement(g, { key: p, ...R });
|
|
112
113
|
}));
|
|
113
114
|
const v = I("k-tabstrip-items-wrapper", {
|
|
114
115
|
"k-hstack": t === "top" || t === "bottom",
|
|
115
116
|
"k-vstack": t === "left" || t === "right"
|
|
116
|
-
}),
|
|
117
|
+
}), S = I("k-tabstrip-items", "k-reset");
|
|
117
118
|
return /* @__PURE__ */ a.createElement("div", { className: v }, this.props.scrollable ? /* @__PURE__ */ a.createElement(a.Fragment, null, this.renderArrow(d, this.state.disabledPrev), /* @__PURE__ */ a.createElement(
|
|
118
119
|
"ul",
|
|
119
120
|
{
|
|
120
121
|
ref: this.itemsNavRef,
|
|
121
|
-
className:
|
|
122
|
+
className: S,
|
|
122
123
|
role: "tablist",
|
|
123
124
|
tabIndex: this.props.tabIndex,
|
|
124
125
|
onKeyDown: n,
|
|
125
126
|
onWheel: this.onWheel,
|
|
126
127
|
"aria-orientation": t === "left" || t === "right" ? "vertical" : void 0
|
|
127
128
|
},
|
|
128
|
-
|
|
129
|
+
m
|
|
129
130
|
), this.renderArrow(u, this.state.disabledNext)) : /* @__PURE__ */ a.createElement(
|
|
130
131
|
"ul",
|
|
131
132
|
{
|
|
132
|
-
className:
|
|
133
|
+
className: S,
|
|
133
134
|
role: "tablist",
|
|
134
135
|
tabIndex: this.props.tabIndex,
|
|
135
136
|
onKeyDown: n
|
|
136
137
|
},
|
|
137
|
-
|
|
138
|
+
m
|
|
138
139
|
));
|
|
139
140
|
}
|
|
140
141
|
scrollToSelected() {
|
|
@@ -155,17 +156,17 @@ const E = (S) => Array.apply(null, Array(S)), L = (S) => S.preventDefault(), b =
|
|
|
155
156
|
return /top|bottom/.test(this.props.tabPosition || "top");
|
|
156
157
|
}
|
|
157
158
|
};
|
|
158
|
-
|
|
159
|
-
children:
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
T.propTypes = {
|
|
160
|
+
children: h.oneOfType([
|
|
161
|
+
h.element,
|
|
162
|
+
h.arrayOf(h.element)
|
|
162
163
|
]),
|
|
163
|
-
onSelect:
|
|
164
|
-
onKeyDown:
|
|
165
|
-
selected:
|
|
166
|
-
tabIndex:
|
|
164
|
+
onSelect: h.func,
|
|
165
|
+
onKeyDown: h.func,
|
|
166
|
+
selected: h.number,
|
|
167
|
+
tabIndex: h.number
|
|
167
168
|
};
|
|
168
|
-
let N =
|
|
169
|
+
let N = T;
|
|
169
170
|
export {
|
|
170
171
|
N as TabStripNavigation
|
|
171
172
|
};
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),e=require("prop-types"),h=require("@progress/kendo-react-common");function R(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return n.default=s,Object.freeze(n)}const o=R(b),l=class l extends o.Component{constructor(){super(...arguments),this.itemRef=null,this.focus=()=>{this.itemRef&&(this.itemRef.tabIndex=0,this.itemRef.focus())},this.blur=()=>{this.itemRef&&(this.itemRef.tabIndex=-1,this.itemRef.blur())},this.onClick=()=>{this.props.onSelect&&this.props.onSelect(this.props.index),this.itemRef&&(this.itemRef.tabIndex=0,this.itemRef.focus())}}render(){const{id:n,active:t,disabled:i,title:d="Untitled",index:c,renderAllContent:f}=this.props,a=f?`${this.props.contentPanelId}-${c.toString()}`:this.props.contentPanelId,u={id:`${n}-${c.toString()}`,"aria-selected":t,"aria-controls":t?a:void 0,"aria-disabled":i,role:"tab",onClick:i?void 0:this.onClick},p=h.classNames("k-item","k-tabstrip-item",{"k-disabled":i,"k-active":t});return o.createElement("li",{...u,className:p,ref:m=>this.itemRef=m,onBlur:this.blur,"aria-controls":a},o.createElement("span",{className:"k-link"},d))}};l.propTypes={active:e.bool,disabled:e.bool,index:e.number,onSelect:e.func,title:e.oneOfType([e.string,e.element]),first:e.bool,last:e.bool};let r=l;exports.TabStripNavigationItem=r;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as s from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { classNames as
|
|
11
|
+
import { classNames as h } from "@progress/kendo-react-common";
|
|
12
12
|
const o = class o extends s.Component {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments), this.itemRef = null, this.focus = () => {
|
|
@@ -23,18 +23,18 @@ const o = class o extends s.Component {
|
|
|
23
23
|
* @hidden
|
|
24
24
|
*/
|
|
25
25
|
render() {
|
|
26
|
-
const { id:
|
|
27
|
-
id: `${
|
|
26
|
+
const { id: c, active: t, disabled: i, title: a = "Untitled", index: n, renderAllContent: m } = this.props, l = m ? `${this.props.contentPanelId}-${n.toString()}` : this.props.contentPanelId, d = {
|
|
27
|
+
id: `${c}-${n.toString()}`,
|
|
28
28
|
"aria-selected": t,
|
|
29
29
|
"aria-controls": t ? l : void 0,
|
|
30
30
|
"aria-disabled": i,
|
|
31
31
|
role: "tab",
|
|
32
32
|
onClick: i ? void 0 : this.onClick
|
|
33
|
-
},
|
|
33
|
+
}, p = h("k-item", "k-tabstrip-item", {
|
|
34
34
|
"k-disabled": i,
|
|
35
35
|
"k-active": t
|
|
36
36
|
});
|
|
37
|
-
return /* @__PURE__ */ s.createElement("li", { ...
|
|
37
|
+
return /* @__PURE__ */ s.createElement("li", { ...d, className: p, ref: (f) => this.itemRef = f, onBlur: this.blur, "aria-controls": l }, /* @__PURE__ */ s.createElement("span", { className: "k-link" }, a));
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
o.propTypes = {
|
|
@@ -49,7 +49,7 @@ o.propTypes = {
|
|
|
49
49
|
first: e.bool,
|
|
50
50
|
last: e.bool
|
|
51
51
|
};
|
|
52
|
-
let
|
|
52
|
+
let r = o;
|
|
53
53
|
export {
|
|
54
|
-
|
|
54
|
+
r as TabStripNavigationItem
|
|
55
55
|
};
|