@progress/kendo-react-layout 8.2.0-develop.8 → 8.2.0
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/breadcrumb/BreadcrumbLink.js +1 -1
- package/breadcrumb/BreadcrumbLink.mjs +1 -0
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/index.d.mts +13 -16
- package/index.d.ts +13 -16
- package/index.js +1 -1
- package/index.mjs +97 -96
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +115 -85
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +1 -1
- package/panelbar/interfaces/NavigationAction.js +1 -1
- package/panelbar/interfaces/NavigationAction.mjs +1 -1
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +113 -92
- package/splitter/Splitter.js +1 -1
- package/splitter/Splitter.mjs +37 -36
- package/splitter/SplitterPane.js +1 -1
- package/splitter/SplitterPane.mjs +19 -15
- package/tabstrip/TabStripNavigation.js +1 -1
- package/tabstrip/TabStripNavigation.mjs +30 -25
- package/tabstrip/messages/index.js +8 -0
- package/tabstrip/messages/index.mjs +17 -0
package/splitter/Splitter.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),B=require("./SplitterPane.js"),_=require("./SplitterBar.js"),T=require("@progress/kendo-react-common"),k=require("../package-metadata.js"),C=require("./messages/index.js"),N=require("@progress/kendo-react-intl");function w(d){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(i,e,t.get?t:{enumerable:!0,get:()=>d[e]})}}return i.default=d,Object.freeze(i)}const S=w(R),q={collapsible:!1,collapsed:!1,resizable:!0,scrollable:!0},L=150,b=class b extends S.Component{constructor(i){super(i),this._container=null,this.validatePanes=e=>{if(!e.filter(n=>n.size===void 0).length)throw new Error("The Splitter should have at least one pane without a set size.")},this.mapPaneOptions=(e,t)=>{const n=this.orientation,{dragIndex:r,isDragging:a}=this.state,l=[];for(let s=0;s<t.length;s++){let o=!1;const p=t[s];S.isValidElement(p)&&(o=p.type.displayName==="Splitter");let h=!1;a&&r!==void 0&&(h=r===s||r+1===s),l.push({...q,orientation:n,containsSplitter:o,overlay:h,...(e||[])[s]})}return l},this.mapSplitterPanes=(e,t)=>{const n=N.provideLocalizationService(this).toLanguageString(C.splitBarLabel,C.messages[C.splitBarLabel]);return e.map((r,a)=>{let l;const s=a*2,o=s+1;if(a+1<e.length){const h=e[a+1];l=S.createElement(_.SplitterBar,{key:o,index:a,orientation:r.orientation,prev:r,next:h,ariaLabel:n,onDrag:this.onBarDragResize,onToggle:this.onBarToggle,onKeyboardResize:this.onBarKeyboardResize,isRtl:this.isRtl})}return[S.createElement(B.SplitterPane,{key:s,...r},t[a]),l]})},this.onBarToggle=(e,t)=>{const r=this.panesOptions(this.panesContent).map((a,l)=>{const s=this.getPaneProps(a);return l===e?{...s,collapsed:!a.collapsed}:{...s}});this.props.onChange&&this.props.onChange({newState:r,isLast:!0,nativeEvent:t})},this.onBarDragResize=(e,t,n,r,a)=>{const l=new Date().getTime(),{pageX:s,pageY:o}=e,{prevElement:p,nextElement:h}=this.surroudingPanes(t);if(!p||!h)return;if(r){this.setState({isDragging:!0,dragIndex:n,startTime:l,originalX:s,originalY:o,originalPrevSize:this.elementSize(p),originalNextSize:this.elementSize(h)});return}const{originalPrevSize:P,originalNextSize:c,startTime:v,originalX:f,originalY:m}=this.state;if(!r&&l-v<L){a&&this.resetDragState();return}let g;this.orientation==="vertical"?g=o-m:this.isRtl?g=f-s:g=s-f,this.resize(n,n+1,P,c,g,a,e),a&&this.resetDragState()},this.onBarKeyboardResize=(e,t,n,r)=>{const{prevElement:a,nextElement:l}=this.surroudingPanes(e),s=this.elementSize(a),o=this.elementSize(l);this.resize(t,t+1,s,o,n,!0,r)},this.containerSize=()=>this._container?this.elementSize(this._container,!0):0,this.panesOptions=e=>this.mapPaneOptions(this.panes,e),this.elementSize=(e,t)=>{const n=t?"client":"offset";return this.orientation==="vertical"?e[`${n}Height`]:e[`${n}Width`]},this.clamp=(e,t,n)=>Math.min(t,Math.max(e,n)),this.fixedSize=e=>e&&e.length>0,T.validatePackage(k.packageMetadata),this.state={isDragging:!1,dragIndex:void 0,startTime:0,originalX:0,originalY:0,originalPrevSize:0,originalNextSize:0,panes:i.defaultPanes||[]}}get isControlledState(){return this.props.panes!==void 0}get panes(){return this.panesDuringOnChange!==void 0?this.panesDuringOnChange:this.isControlledState?this.props.panes:this.state.panes}get orientation(){return this.props.orientation||"horizontal"}get isRtl(){return this._container&&getComputedStyle(this._container).direction==="rtl"||!1}get panesContent(){return S.Children.toArray(this.props.children).filter(i=>i)}render(){const i=this.panesContent,e=this.panesOptions(i),t=T.classNames("k-splitter","k-splitter-flex",`k-splitter-${this.orientation}`,this.props.className);return this.validatePanes(e),S.createElement("div",{style:this.props.style,ref:n=>this._container=n,className:t},this.mapSplitterPanes(e,i))}surroudingPanes(i){return{prevElement:i.previousElementSibling,nextElement:i.nextElementSibling}}isPercent(i){return/%$/.test(i)}toPixels(i,e){let t=parseInt(i,10);return this.isPercent(i)&&(t=e*t/100),t}resetDragState(){this.setState({isDragging:!1,dragIndex:void 0,startTime:0,originalX:0,originalY:0,originalPrevSize:0,originalNextSize:0})}resize(i,e,t,n,r,a,l){const s=this.panesOptions(this.panesContent),o=s[i],p=s[e],h=t+n,P=this.containerSize(),c=u=>this.toPixels(u,P),v={index:i,initialSize:t,min:c(o.min)||h-c(p.max)||0,max:c(o.max)||h-c(p.min)||h},f={index:e,initialSize:n,min:c(p.min)||h-c(o.max)||0,max:c(p.max)||h-c(o.min)||h},m=(u,x)=>{const z=s[u.index],E=this.clamp(u.min,u.max,u.initialSize+x);return this.isPercent(z.size||"")?100*E/P+"%":E+"px"};let g,O;this.fixedSize(o.size)&&this.fixedSize(p.size)?(g=m(v,r),O=m(f,-r)):p.collapsible||this.fixedSize(p.size)?O=m(f,-r):g=m(v,r);const y=s.map((u,x)=>{const z=this.getPaneProps(u);return x===i?{...z,size:g}:x===e?{...z,size:O}:{...z}});this.panesDuringOnChange=y,this.isControlledState||this.setState({panes:y}),this.props.onChange&&this.props.onChange({newState:y,isLast:a,nativeEvent:l}),this.panesDuringOnChange=void 0}getPaneProps(i){const{orientation:e,overlay:t,containsSplitter:n,...r}=i;return r}};b.displayName="Splitter";let D=b;exports.Splitter=D;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),B=require("./SplitterPane.js"),_=require("./SplitterBar.js"),T=require("@progress/kendo-react-common"),k=require("../package-metadata.js"),C=require("./messages/index.js"),N=require("@progress/kendo-react-intl");function w(d){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(i,e,t.get?t:{enumerable:!0,get:()=>d[e]})}}return i.default=d,Object.freeze(i)}const S=w(R),q={collapsible:!1,collapsed:!1,resizable:!0,scrollable:!0},L=150,b=class b extends S.Component{constructor(i){super(i),this._container=null,this.validatePanes=e=>{if(!e.filter(n=>n.size===void 0).length)throw new Error("The Splitter should have at least one pane without a set size.")},this.mapPaneOptions=(e,t)=>{const n=this.orientation,{dragIndex:r,isDragging:a}=this.state,l=[];for(let s=0;s<t.length;s++){let o=!1;const p=t[s];S.isValidElement(p)&&(o=p.type.displayName==="Splitter");let h=!1;a&&r!==void 0&&(h=r===s||r+1===s),l.push({...q,orientation:n,containsSplitter:o,overlay:h,...(e||[])[s]})}return l},this.mapSplitterPanes=(e,t)=>{const n=N.provideLocalizationService(this).toLanguageString(C.splitBarLabel,C.messages[C.splitBarLabel]);return e.map((r,a)=>{let l;const s=a*2,o=s+1;if(a+1<e.length){const h=e[a+1];l=S.createElement(_.SplitterBar,{key:o,index:a,orientation:r.orientation,prev:r,next:h,ariaLabel:n,onDrag:this.onBarDragResize,onToggle:this.onBarToggle,onKeyboardResize:this.onBarKeyboardResize,isRtl:this.isRtl})}return[S.createElement(B.SplitterPane,{key:s,...r},t[a]),l]})},this.onBarToggle=(e,t)=>{const r=this.panesOptions(this.panesContent).map((a,l)=>{const s=this.getPaneProps(a);return l===e?{...s,collapsed:!a.collapsed}:{...s}});this.props.onChange&&this.props.onChange({newState:r,isLast:!0,nativeEvent:t})},this.onBarDragResize=(e,t,n,r,a)=>{const l=new Date().getTime(),{pageX:s,pageY:o}=e,{prevElement:p,nextElement:h}=this.surroudingPanes(t);if(!p||!h)return;if(r){this.setState({isDragging:!0,dragIndex:n,startTime:l,originalX:s,originalY:o,originalPrevSize:this.elementSize(p),originalNextSize:this.elementSize(h)});return}const{originalPrevSize:P,originalNextSize:c,startTime:v,originalX:f,originalY:m}=this.state;if(!r&&l-v<L){a&&this.resetDragState();return}let g;this.orientation==="vertical"?g=o-m:this.isRtl?g=f-s:g=s-f,this.resize(n,n+1,P,c,g,a,e),a&&this.resetDragState()},this.onBarKeyboardResize=(e,t,n,r)=>{const{prevElement:a,nextElement:l}=this.surroudingPanes(e),s=this.elementSize(a),o=this.elementSize(l);this.resize(t,t+1,s,o,n,!0,r)},this.containerSize=()=>this._container?this.elementSize(this._container,!0):0,this.panesOptions=e=>this.mapPaneOptions(this.panes,e),this.elementSize=(e,t)=>{const n=t?"client":"offset";return this.orientation==="vertical"?e[`${n}Height`]:e[`${n}Width`]},this.clamp=(e,t,n)=>Math.min(t,Math.max(e,n)),this.fixedSize=e=>e&&e.length>0,T.validatePackage(k.packageMetadata),this.state={isDragging:!1,dragIndex:void 0,startTime:0,originalX:0,originalY:0,originalPrevSize:0,originalNextSize:0,panes:i.defaultPanes||[]}}get isControlledState(){return this.props.panes!==void 0}get panes(){return this.panesDuringOnChange!==void 0?this.panesDuringOnChange:this.isControlledState?this.props.panes:this.state.panes}get orientation(){return this.props.orientation||"horizontal"}get isRtl(){return this._container&&getComputedStyle(this._container).direction==="rtl"||!1}get panesContent(){return S.Children.toArray(this.props.children).filter(i=>i)}render(){const i=this.panesContent,e=this.panesOptions(i),t=T.classNames("k-splitter","k-splitter-flex",`k-splitter-${this.orientation}`,this.props.className);return this.validatePanes(e),S.createElement("div",{id:this.props.id,style:this.props.style,ref:n=>this._container=n,className:t},this.mapSplitterPanes(e,i))}surroudingPanes(i){return{prevElement:i.previousElementSibling,nextElement:i.nextElementSibling}}isPercent(i){return/%$/.test(i)}toPixels(i,e){let t=parseInt(i,10);return this.isPercent(i)&&(t=e*t/100),t}resetDragState(){this.setState({isDragging:!1,dragIndex:void 0,startTime:0,originalX:0,originalY:0,originalPrevSize:0,originalNextSize:0})}resize(i,e,t,n,r,a,l){const s=this.panesOptions(this.panesContent),o=s[i],p=s[e],h=t+n,P=this.containerSize(),c=u=>this.toPixels(u,P),v={index:i,initialSize:t,min:c(o.min)||h-c(p.max)||0,max:c(o.max)||h-c(p.min)||h},f={index:e,initialSize:n,min:c(p.min)||h-c(o.max)||0,max:c(p.max)||h-c(o.min)||h},m=(u,x)=>{const z=s[u.index],E=this.clamp(u.min,u.max,u.initialSize+x);return this.isPercent(z.size||"")?100*E/P+"%":E+"px"};let g,O;this.fixedSize(o.size)&&this.fixedSize(p.size)?(g=m(v,r),O=m(f,-r)):p.collapsible||this.fixedSize(p.size)?O=m(f,-r):g=m(v,r);const y=s.map((u,x)=>{const z=this.getPaneProps(u);return x===i?{...z,size:g}:x===e?{...z,size:O}:{...z}});this.panesDuringOnChange=y,this.isControlledState||this.setState({panes:y}),this.props.onChange&&this.props.onChange({newState:y,isLast:a,nativeEvent:l}),this.panesDuringOnChange=void 0}getPaneProps(i){const{orientation:e,overlay:t,containsSplitter:n,...r}=i;return r}};b.displayName="Splitter";let D=b;exports.Splitter=D;
|
package/splitter/Splitter.mjs
CHANGED
|
@@ -22,23 +22,23 @@ const k = {
|
|
|
22
22
|
/**
|
|
23
23
|
* @hidden
|
|
24
24
|
*/
|
|
25
|
-
constructor(
|
|
26
|
-
super(
|
|
25
|
+
constructor(n) {
|
|
26
|
+
super(n), this._container = null, this.validatePanes = (t) => {
|
|
27
27
|
if (!t.filter((i) => i.size === void 0).length)
|
|
28
28
|
throw new Error("The Splitter should have at least one pane without a set size.");
|
|
29
29
|
}, this.mapPaneOptions = (t, e) => {
|
|
30
30
|
const i = this.orientation, { dragIndex: r, isDragging: a } = this.state, l = [];
|
|
31
|
-
for (let
|
|
31
|
+
for (let s = 0; s < e.length; s++) {
|
|
32
32
|
let o = !1;
|
|
33
|
-
const p = e[
|
|
33
|
+
const p = e[s];
|
|
34
34
|
S.isValidElement(p) && (o = p.type.displayName === "Splitter");
|
|
35
35
|
let h = !1;
|
|
36
|
-
a && r !== void 0 && (h = r ===
|
|
36
|
+
a && r !== void 0 && (h = r === s || r + 1 === s), l.push({
|
|
37
37
|
...k,
|
|
38
38
|
orientation: i,
|
|
39
39
|
containsSplitter: o,
|
|
40
40
|
overlay: h,
|
|
41
|
-
...(t || [])[
|
|
41
|
+
...(t || [])[s]
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
return l;
|
|
@@ -46,7 +46,7 @@ const k = {
|
|
|
46
46
|
const i = _(this).toLanguageString(O, w[O]);
|
|
47
47
|
return t.map((r, a) => {
|
|
48
48
|
let l;
|
|
49
|
-
const
|
|
49
|
+
const s = a * 2, o = s + 1;
|
|
50
50
|
if (a + 1 < t.length) {
|
|
51
51
|
const h = t[a + 1];
|
|
52
52
|
l = /* @__PURE__ */ S.createElement(
|
|
@@ -68,7 +68,7 @@ const k = {
|
|
|
68
68
|
return [/* @__PURE__ */ S.createElement(
|
|
69
69
|
T,
|
|
70
70
|
{
|
|
71
|
-
key:
|
|
71
|
+
key: s,
|
|
72
72
|
...r
|
|
73
73
|
},
|
|
74
74
|
e[a]
|
|
@@ -76,12 +76,12 @@ const k = {
|
|
|
76
76
|
});
|
|
77
77
|
}, this.onBarToggle = (t, e) => {
|
|
78
78
|
const r = this.panesOptions(this.panesContent).map((a, l) => {
|
|
79
|
-
const
|
|
79
|
+
const s = this.getPaneProps(a);
|
|
80
80
|
return l === t ? {
|
|
81
|
-
...
|
|
81
|
+
...s,
|
|
82
82
|
collapsed: !a.collapsed
|
|
83
83
|
} : {
|
|
84
|
-
...
|
|
84
|
+
...s
|
|
85
85
|
};
|
|
86
86
|
});
|
|
87
87
|
this.props.onChange && this.props.onChange({
|
|
@@ -90,7 +90,7 @@ const k = {
|
|
|
90
90
|
nativeEvent: e
|
|
91
91
|
});
|
|
92
92
|
}, this.onBarDragResize = (t, e, i, r, a) => {
|
|
93
|
-
const l = (/* @__PURE__ */ new Date()).getTime(), { pageX:
|
|
93
|
+
const l = (/* @__PURE__ */ new Date()).getTime(), { pageX: s, pageY: o } = t, { prevElement: p, nextElement: h } = this.surroudingPanes(e);
|
|
94
94
|
if (!p || !h)
|
|
95
95
|
return;
|
|
96
96
|
if (r) {
|
|
@@ -98,7 +98,7 @@ const k = {
|
|
|
98
98
|
isDragging: !0,
|
|
99
99
|
dragIndex: i,
|
|
100
100
|
startTime: l,
|
|
101
|
-
originalX:
|
|
101
|
+
originalX: s,
|
|
102
102
|
originalY: o,
|
|
103
103
|
originalPrevSize: this.elementSize(p),
|
|
104
104
|
originalNextSize: this.elementSize(h)
|
|
@@ -111,10 +111,10 @@ const k = {
|
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
let c;
|
|
114
|
-
this.orientation === "vertical" ? c = o - u : this.isRtl ? c = f -
|
|
114
|
+
this.orientation === "vertical" ? c = o - u : this.isRtl ? c = f - s : c = s - f, this.resize(i, i + 1, d, g, c, a, t), a && this.resetDragState();
|
|
115
115
|
}, this.onBarKeyboardResize = (t, e, i, r) => {
|
|
116
|
-
const { prevElement: a, nextElement: l } = this.surroudingPanes(t),
|
|
117
|
-
this.resize(e, e + 1,
|
|
116
|
+
const { prevElement: a, nextElement: l } = this.surroudingPanes(t), s = this.elementSize(a), o = this.elementSize(l);
|
|
117
|
+
this.resize(e, e + 1, s, o, i, !0, r);
|
|
118
118
|
}, this.containerSize = () => this._container ? this.elementSize(this._container, !0) : 0, this.panesOptions = (t) => this.mapPaneOptions(this.panes, t), this.elementSize = (t, e) => {
|
|
119
119
|
const i = e ? "client" : "offset";
|
|
120
120
|
return this.orientation === "vertical" ? t[`${i}Height`] : t[`${i}Width`];
|
|
@@ -126,7 +126,7 @@ const k = {
|
|
|
126
126
|
originalY: 0,
|
|
127
127
|
originalPrevSize: 0,
|
|
128
128
|
originalNextSize: 0,
|
|
129
|
-
panes:
|
|
129
|
+
panes: n.defaultPanes || []
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
get isControlledState() {
|
|
@@ -142,13 +142,13 @@ const k = {
|
|
|
142
142
|
return this._container && getComputedStyle(this._container).direction === "rtl" || !1;
|
|
143
143
|
}
|
|
144
144
|
get panesContent() {
|
|
145
|
-
return S.Children.toArray(this.props.children).filter((
|
|
145
|
+
return S.Children.toArray(this.props.children).filter((n) => n);
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* @hidden
|
|
149
149
|
*/
|
|
150
150
|
render() {
|
|
151
|
-
const
|
|
151
|
+
const n = this.panesContent, t = this.panesOptions(n), e = N(
|
|
152
152
|
"k-splitter",
|
|
153
153
|
"k-splitter-flex",
|
|
154
154
|
`k-splitter-${this.orientation}`,
|
|
@@ -157,25 +157,26 @@ const k = {
|
|
|
157
157
|
return this.validatePanes(t), /* @__PURE__ */ S.createElement(
|
|
158
158
|
"div",
|
|
159
159
|
{
|
|
160
|
+
id: this.props.id,
|
|
160
161
|
style: this.props.style,
|
|
161
162
|
ref: (i) => this._container = i,
|
|
162
163
|
className: e
|
|
163
164
|
},
|
|
164
|
-
this.mapSplitterPanes(t,
|
|
165
|
+
this.mapSplitterPanes(t, n)
|
|
165
166
|
);
|
|
166
167
|
}
|
|
167
|
-
surroudingPanes(
|
|
168
|
+
surroudingPanes(n) {
|
|
168
169
|
return {
|
|
169
|
-
prevElement:
|
|
170
|
-
nextElement:
|
|
170
|
+
prevElement: n.previousElementSibling,
|
|
171
|
+
nextElement: n.nextElementSibling
|
|
171
172
|
};
|
|
172
173
|
}
|
|
173
|
-
isPercent(
|
|
174
|
-
return /%$/.test(
|
|
174
|
+
isPercent(n) {
|
|
175
|
+
return /%$/.test(n);
|
|
175
176
|
}
|
|
176
|
-
toPixels(
|
|
177
|
-
let e = parseInt(
|
|
178
|
-
return this.isPercent(
|
|
177
|
+
toPixels(n, t) {
|
|
178
|
+
let e = parseInt(n, 10);
|
|
179
|
+
return this.isPercent(n) && (e = t * e / 100), e;
|
|
179
180
|
}
|
|
180
181
|
resetDragState() {
|
|
181
182
|
this.setState({
|
|
@@ -188,9 +189,9 @@ const k = {
|
|
|
188
189
|
originalNextSize: 0
|
|
189
190
|
});
|
|
190
191
|
}
|
|
191
|
-
resize(
|
|
192
|
-
const
|
|
193
|
-
index:
|
|
192
|
+
resize(n, t, e, i, r, a, l) {
|
|
193
|
+
const s = this.panesOptions(this.panesContent), o = s[n], p = s[t], h = e + i, d = this.containerSize(), g = (m) => this.toPixels(m, d), P = {
|
|
194
|
+
index: n,
|
|
194
195
|
initialSize: e,
|
|
195
196
|
min: g(o.min) || h - g(p.max) || 0,
|
|
196
197
|
max: g(o.max) || h - g(p.min) || h
|
|
@@ -200,14 +201,14 @@ const k = {
|
|
|
200
201
|
min: g(p.min) || h - g(o.max) || 0,
|
|
201
202
|
max: g(p.max) || h - g(o.min) || h
|
|
202
203
|
}, u = (m, v) => {
|
|
203
|
-
const z =
|
|
204
|
+
const z = s[m.index], E = this.clamp(m.min, m.max, m.initialSize + v);
|
|
204
205
|
return this.isPercent(z.size || "") ? 100 * E / d + "%" : E + "px";
|
|
205
206
|
};
|
|
206
207
|
let c, x;
|
|
207
208
|
this.fixedSize(o.size) && this.fixedSize(p.size) ? (c = u(P, r), x = u(f, -r)) : p.collapsible || this.fixedSize(p.size) ? x = u(f, -r) : c = u(P, r);
|
|
208
|
-
const C =
|
|
209
|
+
const C = s.map((m, v) => {
|
|
209
210
|
const z = this.getPaneProps(m);
|
|
210
|
-
return v ===
|
|
211
|
+
return v === n ? {
|
|
211
212
|
...z,
|
|
212
213
|
size: c
|
|
213
214
|
} : v === t ? {
|
|
@@ -225,8 +226,8 @@ const k = {
|
|
|
225
226
|
nativeEvent: l
|
|
226
227
|
}), this.panesDuringOnChange = void 0;
|
|
227
228
|
}
|
|
228
|
-
getPaneProps(
|
|
229
|
-
const { orientation: t, overlay: e, containsSplitter: i, ...r } =
|
|
229
|
+
getPaneProps(n) {
|
|
230
|
+
const { orientation: t, overlay: e, containsSplitter: i, ...r } = n;
|
|
230
231
|
return r;
|
|
231
232
|
}
|
|
232
233
|
};
|
package/splitter/SplitterPane.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),k=require("@progress/kendo-react-common");function g(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const l=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,l.get?l:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const s=g(y);class v extends s.Component{render(){const{id:n,size:e,collapsed:l,overlay:a,containsSplitter:r,collapsible:o,resizable:c,scrollable:i,keepMounted:p,style:d,className:u}=this.props,m=e&&e.length>0,f={flexBasis:e,...d},b=k.classNames("k-pane",{"k-hidden":l,hidden:l,"k-pane-flex":r,"k-pane-static":!c&&!o||m,"k-scrollable":i},u);return s.createElement("div",{id:n,role:"group",style:f,className:b},!l||p?this.props.children:void 0,a?s.createElement("div",{className:"k-splitter-overlay k-overlay"}):void 0)}}exports.SplitterPane=v;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as l from "react";
|
|
10
|
-
import { classNames as
|
|
11
|
-
class
|
|
10
|
+
import { classNames as h } from "@progress/kendo-react-common";
|
|
11
|
+
class x extends l.Component {
|
|
12
12
|
render() {
|
|
13
13
|
const {
|
|
14
14
|
id: t,
|
|
@@ -16,29 +16,33 @@ class f extends l.Component {
|
|
|
16
16
|
collapsed: s,
|
|
17
17
|
overlay: a,
|
|
18
18
|
containsSplitter: o,
|
|
19
|
-
collapsible:
|
|
20
|
-
resizable:
|
|
21
|
-
scrollable:
|
|
22
|
-
keepMounted: c
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, m = k
|
|
19
|
+
collapsible: n,
|
|
20
|
+
resizable: r,
|
|
21
|
+
scrollable: i,
|
|
22
|
+
keepMounted: c,
|
|
23
|
+
style: p,
|
|
24
|
+
className: d
|
|
25
|
+
} = this.props, m = e && e.length > 0, k = {
|
|
26
|
+
flexBasis: e,
|
|
27
|
+
...p
|
|
28
|
+
}, v = h(
|
|
26
29
|
"k-pane",
|
|
27
30
|
{
|
|
28
31
|
"k-hidden": s,
|
|
29
32
|
hidden: s,
|
|
30
33
|
"k-pane-flex": o,
|
|
31
|
-
"k-pane-static": !
|
|
32
|
-
"k-scrollable":
|
|
33
|
-
}
|
|
34
|
+
"k-pane-static": !r && !n || m,
|
|
35
|
+
"k-scrollable": i
|
|
36
|
+
},
|
|
37
|
+
d
|
|
34
38
|
);
|
|
35
39
|
return /* @__PURE__ */ l.createElement(
|
|
36
40
|
"div",
|
|
37
41
|
{
|
|
38
42
|
id: t,
|
|
39
43
|
role: "group",
|
|
40
|
-
style:
|
|
41
|
-
className:
|
|
44
|
+
style: k,
|
|
45
|
+
className: v
|
|
42
46
|
},
|
|
43
47
|
!s || c ? this.props.children : void 0,
|
|
44
48
|
a ? /* @__PURE__ */ l.createElement("div", { className: "k-splitter-overlay k-overlay" }) : void 0
|
|
@@ -46,5 +50,5 @@ class f extends l.Component {
|
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
export {
|
|
49
|
-
|
|
53
|
+
x as SplitterPane
|
|
50
54
|
};
|
|
@@ -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 A=require("react"),f=require("prop-types"),C=require("./TabStripNavigationItem.js"),P=require("@progress/kendo-react-common"),x=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-svg-icons"),L=require("@progress/kendo-react-intl"),v=require("./messages/index.js");function M(h){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(l,t,s.get?s:{enumerable:!0,get:()=>h[t]})}}return l.default=h,Object.freeze(l)}const a=M(A),E=h=>Array.apply(null,Array(h)),y=h=>h.preventDefault(),g="smooth",u="prev",S="next",k=class k extends a.Component{constructor(l){super(l),this.itemsNavRef=a.createRef(),this.isRtl=()=>this.props.dir==="rtl",this.onWheel=t=>{t.stopPropagation();const s=t.deltaY<0?u:S;this.setNewScrollPosition(s,t)},this.arrowClickPrev=t=>{this.handleArrowClick(u,t)},this.arrowClickNext=t=>{this.handleArrowClick(S,t)},this.handleArrowClick=(t,s)=>{this.setNewScrollPosition(t,s)},this.setNewScrollPosition=(t,s)=>{const e=this.itemsNavRef.current;if(!e)return;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;let o=n?e.scrollLeft:e.scrollTop,i=n?e.scrollWidth-e.scrollLeft:e.scrollHeight-e.scrollTop,d=e.scrollWidth-e.scrollLeft*-1;this.isRtl()&&this.horizontalScroll()?(t===u&&o<0&&(o+=r,d+=r),t===S&&o<c&&(o-=r,d-=r),o=Math.min(0,Math.min(c,o))):(t===u&&o>0&&(o-=r,i+=r),t===S&&o<c&&(o+=r,i-=r),o=Math.max(0,Math.min(c,o)));const b=o===0,T=s.type==="click"?g:void 0;if(n){const w=this.isRtl()?Math.round(d)<=e.clientWidth||Math.floor(d)<=e.clientWidth:Math.round(i)<=e.clientWidth||Math.floor(i)<=e.clientWidth;this.setState({disabledPrev:b,disabledNext:w}),e.scrollTo({left:o,behavior:T})}else this.setState({disabledPrev:b,disabledNext:Math.round(i)<=e.clientHeight||Math.floor(i)<=e.clientHeight}),e.scrollTo({top:o,behavior:T})},this.renderArrow=(t,s)=>{const e=this.horizontalScroll(),n=L.provideLocalizationService(this),c={prev:{arrowTab:"k-tabstrip-prev",fontIcon:e?this.isRtl()?"caret-alt-right":"caret-alt-left":"caret-alt-up",svgIcon:e?this.isRtl()?m.caretAltRightIcon:m.caretAltLeftIcon:m.caretAltUpIcon,title:n.toLanguageString(v.prevArrowTitle,v.messages[v.prevArrowTitle])},next:{arrowTab:"k-tabstrip-next",fontIcon:e?this.isRtl()?"caret-alt-left":"caret-alt-right":"caret-alt-down",svgIcon:e?this.isRtl()?m.caretAltLeftIcon:m.caretAltRightIcon:m.caretAltDownIcon,title:n.toLanguageString(v.nextArrowTitle,v.messages[v.nextArrowTitle])}},r=(t===u?this.props.prevButton:this.props.nextButton)||x.Button,o=t===u?this.arrowClickPrev:this.arrowClickNext;return a.createElement(r,{disabled:s,className:`${c[t].arrowTab}`,onClick:o,icon:c[t].fontIcon,svgIcon:c[t].svgIcon,onMouseDown:y,tabIndex:-1,fillMode:"flat",title:c[t].title})},this.state={disabledPrev:this.props.selected===0,disabledNext:this.props.selected===a.Children.count(this.props.children)-1}}componentDidMount(){this.props.scrollable&&this.scrollToSelected()}componentDidUpdate(l){const{scrollable:t,selected:s}=this.props;t&&l.selected!==s&&(this.scrollToSelected(),this.setState({disabledPrev:s===0,disabledNext:s===a.Children.count(this.props.children)-1}))}render(){const{selected:l,tabPosition:t,children:s,onSelect:e,onKeyDown:n,navItemId:c,contentPanelId:r,renderAllContent:o}=this.props,i=a.Children.count(s),d=a.Children.toArray(s);let b;s&&(b=E(i).map((z,p,N)=>{const R={active:l===p,disabled:d[p].props.disabled,index:p,title:d[p].props.title,first:p===0,last:p===N.length-1,contentPanelId:r,renderAllContent:o,id:c,onSelect:e};return a.createElement(C.TabStripNavigationItem,{key:p,...R})}));const T=P.classNames("k-tabstrip-items-wrapper",{"k-hstack":t==="top"||t==="bottom","k-vstack":t==="left"||t==="right"}),w=P.classNames("k-tabstrip-items","k-reset");return a.createElement("div",{className:T},this.props.scrollable?a.createElement(a.Fragment,null,this.renderArrow(u,this.state.disabledPrev),a.createElement("ul",{ref:this.itemsNavRef,className:w,role:"tablist",tabIndex:this.props.tabIndex,onKeyDown:n,onWheel:this.onWheel,"aria-orientation":t==="left"||t==="right"?"vertical":void 0},b),this.renderArrow(S,this.state.disabledNext)):a.createElement("ul",{className:w,role:"tablist",tabIndex:this.props.tabIndex,onKeyDown:n},b))}scrollToSelected(){const l=this.itemsNavRef.current,t=l&&l.children[this.props.selected||0];if(t instanceof HTMLElement&&l instanceof HTMLElement){const s=this.horizontalScroll(),e=s?l.offsetWidth:l.offsetHeight,n=s?t.offsetWidth:t.offsetHeight,c=s?"left":"top";let r=s?l.scrollLeft:l.scrollTop,o=0;if(this.isRtl()){const i=t.offsetLeft;r=r*-1,i<0?(o=i-n+l.offsetLeft,l.scrollTo({[c]:o,behavior:g})):i+n>e-r&&(o=r+i-n,l.scrollTo({[c]:o,behavior:g}))}else{const i=s?t.offsetLeft-l.offsetLeft:t.offsetTop-l.offsetTop;r+e<i+n?(o=i+n-e,l.scrollTo({[c]:o,behavior:g})):r>i&&(o=i,l.scrollTo({[c]:o,behavior:g}))}}}horizontalScroll(){return/top|bottom/.test(this.props.tabPosition||"top")}};k.propTypes={children:f.oneOfType([f.element,f.arrayOf(f.element)]),onSelect:f.func,onKeyDown:f.func,selected:f.number,tabIndex:f.number};let I=k;exports.TabStripNavigation=I;
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as a from "react";
|
|
10
10
|
import h from "prop-types";
|
|
11
|
-
import { TabStripNavigationItem as
|
|
12
|
-
import { classNames as
|
|
13
|
-
import { Button as
|
|
14
|
-
import { caretAltRightIcon as
|
|
15
|
-
|
|
11
|
+
import { TabStripNavigationItem as L } from "./TabStripNavigationItem.mjs";
|
|
12
|
+
import { classNames as T } from "@progress/kendo-react-common";
|
|
13
|
+
import { Button as M } from "@progress/kendo-react-buttons";
|
|
14
|
+
import { caretAltRightIcon as I, caretAltLeftIcon as P, caretAltUpIcon as E, caretAltDownIcon as W } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { provideLocalizationService as z } from "@progress/kendo-react-intl";
|
|
16
|
+
import { prevArrowTitle as k, messages as N, nextArrowTitle as C } from "./messages/index.mjs";
|
|
17
|
+
const D = (g) => Array.apply(null, Array(g)), H = (g) => g.preventDefault(), b = "smooth", d = "prev", u = "next", w = class w extends a.Component {
|
|
16
18
|
constructor(l) {
|
|
17
19
|
super(l), this.itemsNavRef = a.createRef(), this.isRtl = () => this.props.dir === "rtl", this.onWheel = (t) => {
|
|
18
20
|
t.stopPropagation();
|
|
@@ -44,29 +46,32 @@ const E = (w) => Array.apply(null, Array(w)), L = (w) => w.preventDefault(), b =
|
|
|
44
46
|
disabledNext: Math.round(i) <= e.clientHeight || Math.floor(i) <= e.clientHeight
|
|
45
47
|
}), e.scrollTo({ top: o, behavior: v });
|
|
46
48
|
}, this.renderArrow = (t, s) => {
|
|
47
|
-
const e = this.horizontalScroll(), n = {
|
|
49
|
+
const e = this.horizontalScroll(), n = z(this), c = {
|
|
48
50
|
prev: {
|
|
49
51
|
arrowTab: "k-tabstrip-prev",
|
|
50
52
|
fontIcon: e ? this.isRtl() ? "caret-alt-right" : "caret-alt-left" : "caret-alt-up",
|
|
51
|
-
svgIcon: e ? this.isRtl() ?
|
|
53
|
+
svgIcon: e ? this.isRtl() ? I : P : E,
|
|
54
|
+
title: n.toLanguageString(k, N[k])
|
|
52
55
|
},
|
|
53
56
|
next: {
|
|
54
57
|
arrowTab: "k-tabstrip-next",
|
|
55
58
|
fontIcon: e ? this.isRtl() ? "caret-alt-left" : "caret-alt-right" : "caret-alt-down",
|
|
56
|
-
svgIcon: e ? this.isRtl() ?
|
|
59
|
+
svgIcon: e ? this.isRtl() ? P : I : W,
|
|
60
|
+
title: n.toLanguageString(C, N[C])
|
|
57
61
|
}
|
|
58
|
-
},
|
|
62
|
+
}, r = (t === d ? this.props.prevButton : this.props.nextButton) || M, o = t === d ? this.arrowClickPrev : this.arrowClickNext;
|
|
59
63
|
return /* @__PURE__ */ a.createElement(
|
|
60
|
-
|
|
64
|
+
r,
|
|
61
65
|
{
|
|
62
66
|
disabled: s,
|
|
63
|
-
className: `${
|
|
64
|
-
onClick:
|
|
65
|
-
icon:
|
|
66
|
-
svgIcon:
|
|
67
|
-
onMouseDown:
|
|
67
|
+
className: `${c[t].arrowTab}`,
|
|
68
|
+
onClick: o,
|
|
69
|
+
icon: c[t].fontIcon,
|
|
70
|
+
svgIcon: c[t].svgIcon,
|
|
71
|
+
onMouseDown: H,
|
|
68
72
|
tabIndex: -1,
|
|
69
|
-
fillMode: "flat"
|
|
73
|
+
fillMode: "flat",
|
|
74
|
+
title: c[t].title
|
|
70
75
|
}
|
|
71
76
|
);
|
|
72
77
|
}, this.state = {
|
|
@@ -96,25 +101,25 @@ const E = (w) => Array.apply(null, Array(w)), L = (w) => w.preventDefault(), b =
|
|
|
96
101
|
render() {
|
|
97
102
|
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
103
|
let m;
|
|
99
|
-
s && (m =
|
|
100
|
-
const
|
|
104
|
+
s && (m = D(i).map((y, p, x) => {
|
|
105
|
+
const A = {
|
|
101
106
|
active: l === p,
|
|
102
107
|
disabled: f[p].props.disabled,
|
|
103
108
|
index: p,
|
|
104
109
|
title: f[p].props.title,
|
|
105
110
|
first: p === 0,
|
|
106
|
-
last: p ===
|
|
111
|
+
last: p === x.length - 1,
|
|
107
112
|
contentPanelId: r,
|
|
108
113
|
renderAllContent: o,
|
|
109
114
|
id: c,
|
|
110
115
|
onSelect: e
|
|
111
116
|
};
|
|
112
|
-
return /* @__PURE__ */ a.createElement(
|
|
117
|
+
return /* @__PURE__ */ a.createElement(L, { key: p, ...A });
|
|
113
118
|
}));
|
|
114
|
-
const v =
|
|
119
|
+
const v = T("k-tabstrip-items-wrapper", {
|
|
115
120
|
"k-hstack": t === "top" || t === "bottom",
|
|
116
121
|
"k-vstack": t === "left" || t === "right"
|
|
117
|
-
}), S =
|
|
122
|
+
}), S = T("k-tabstrip-items", "k-reset");
|
|
118
123
|
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(
|
|
119
124
|
"ul",
|
|
120
125
|
{
|
|
@@ -156,7 +161,7 @@ const E = (w) => Array.apply(null, Array(w)), L = (w) => w.preventDefault(), b =
|
|
|
156
161
|
return /top|bottom/.test(this.props.tabPosition || "top");
|
|
157
162
|
}
|
|
158
163
|
};
|
|
159
|
-
|
|
164
|
+
w.propTypes = {
|
|
160
165
|
children: h.oneOfType([
|
|
161
166
|
h.element,
|
|
162
167
|
h.arrayOf(h.element)
|
|
@@ -166,7 +171,7 @@ T.propTypes = {
|
|
|
166
171
|
selected: h.number,
|
|
167
172
|
tabIndex: h.number
|
|
168
173
|
};
|
|
169
|
-
let
|
|
174
|
+
let R = w;
|
|
170
175
|
export {
|
|
171
|
-
|
|
176
|
+
R as TabStripNavigation
|
|
172
177
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="prevArrow.title",r="nextArrow.title",t={[e]:"Previous tab arrow",[r]:"Next tab arrow"};exports.messages=t;exports.nextArrowTitle=r;exports.prevArrowTitle=e;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const r = "prevArrow.title", t = "nextArrow.title", e = {
|
|
10
|
+
[r]: "Previous tab arrow",
|
|
11
|
+
[t]: "Next tab arrow"
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
e as messages,
|
|
15
|
+
t as nextArrowTitle,
|
|
16
|
+
r as prevArrowTitle
|
|
17
|
+
};
|