@progress/kendo-react-layout 7.4.0-develop.5 → 7.4.0-develop.7
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 +21 -1
- package/index.d.ts +21 -1
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- 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
package/index.d.mts
CHANGED
|
@@ -3792,6 +3792,7 @@ export declare class TabStripClassComponent extends React_2.Component<TabStripPr
|
|
|
3792
3792
|
keepTabsMounted: boolean;
|
|
3793
3793
|
buttonScrollSpeed: number;
|
|
3794
3794
|
mouseScrollSpeed: number;
|
|
3795
|
+
renderAllContent: boolean;
|
|
3795
3796
|
};
|
|
3796
3797
|
private _element;
|
|
3797
3798
|
private get contentPanelId();
|
|
@@ -3834,8 +3835,9 @@ export declare class TabStripContent extends React_2.Component<TabStripContentPr
|
|
|
3834
3835
|
/**
|
|
3835
3836
|
* @hidden
|
|
3836
3837
|
*/
|
|
3837
|
-
render(): JSX_2.Element;
|
|
3838
|
+
render(): JSX_2.Element | JSX_2.Element[] | null | undefined;
|
|
3838
3839
|
private renderContent;
|
|
3840
|
+
private renderAllContent;
|
|
3839
3841
|
private renderChild;
|
|
3840
3842
|
private childFactory;
|
|
3841
3843
|
}
|
|
@@ -3864,6 +3866,10 @@ export declare interface TabStripContentProps {
|
|
|
3864
3866
|
* @hidden
|
|
3865
3867
|
*/
|
|
3866
3868
|
keepTabsMounted?: boolean;
|
|
3869
|
+
/**
|
|
3870
|
+
* @hidden
|
|
3871
|
+
*/
|
|
3872
|
+
renderAllContent?: boolean;
|
|
3867
3873
|
/**
|
|
3868
3874
|
* @hidden
|
|
3869
3875
|
*/
|
|
@@ -3983,6 +3989,10 @@ export declare interface TabStripNavigationItemProps {
|
|
|
3983
3989
|
* @hidden
|
|
3984
3990
|
*/
|
|
3985
3991
|
contentPanelId?: string;
|
|
3992
|
+
/**
|
|
3993
|
+
* @hidden
|
|
3994
|
+
*/
|
|
3995
|
+
renderAllContent?: boolean;
|
|
3986
3996
|
}
|
|
3987
3997
|
|
|
3988
3998
|
/**
|
|
@@ -4045,6 +4055,10 @@ export declare interface TabStripNavigationProps {
|
|
|
4045
4055
|
* @hidden
|
|
4046
4056
|
*/
|
|
4047
4057
|
navItemId?: string;
|
|
4058
|
+
/**
|
|
4059
|
+
* @hidden
|
|
4060
|
+
*/
|
|
4061
|
+
renderAllContent?: boolean;
|
|
4048
4062
|
}
|
|
4049
4063
|
|
|
4050
4064
|
/**
|
|
@@ -4101,6 +4115,12 @@ export declare interface TabStripProps extends KendoReactComponentBaseProps, Tab
|
|
|
4101
4115
|
* Defines if the tabs will remain mounted after another tab is selected. Defaults to `false`.
|
|
4102
4116
|
*/
|
|
4103
4117
|
keepTabsMounted?: boolean;
|
|
4118
|
+
/**
|
|
4119
|
+
* @default false
|
|
4120
|
+
* Defines if the all component tabs will be rendered by default. Defaults to `false`.
|
|
4121
|
+
* If set to `false`, the component will render only the currently selected tab. This can be useful when the content of the tabs is heavy and you want to improve the initial loading time. Check also the [keepTabsMounted]({% slug api_layout_tabstripprops %}#toc-keeptabsmounted) prop.
|
|
4122
|
+
*/
|
|
4123
|
+
renderAllContent?: boolean;
|
|
4104
4124
|
/**
|
|
4105
4125
|
* Fires each time the user makes a selection.
|
|
4106
4126
|
*/
|
package/index.d.ts
CHANGED
|
@@ -3792,6 +3792,7 @@ export declare class TabStripClassComponent extends React_2.Component<TabStripPr
|
|
|
3792
3792
|
keepTabsMounted: boolean;
|
|
3793
3793
|
buttonScrollSpeed: number;
|
|
3794
3794
|
mouseScrollSpeed: number;
|
|
3795
|
+
renderAllContent: boolean;
|
|
3795
3796
|
};
|
|
3796
3797
|
private _element;
|
|
3797
3798
|
private get contentPanelId();
|
|
@@ -3834,8 +3835,9 @@ export declare class TabStripContent extends React_2.Component<TabStripContentPr
|
|
|
3834
3835
|
/**
|
|
3835
3836
|
* @hidden
|
|
3836
3837
|
*/
|
|
3837
|
-
render(): JSX_2.Element;
|
|
3838
|
+
render(): JSX_2.Element | JSX_2.Element[] | null | undefined;
|
|
3838
3839
|
private renderContent;
|
|
3840
|
+
private renderAllContent;
|
|
3839
3841
|
private renderChild;
|
|
3840
3842
|
private childFactory;
|
|
3841
3843
|
}
|
|
@@ -3864,6 +3866,10 @@ export declare interface TabStripContentProps {
|
|
|
3864
3866
|
* @hidden
|
|
3865
3867
|
*/
|
|
3866
3868
|
keepTabsMounted?: boolean;
|
|
3869
|
+
/**
|
|
3870
|
+
* @hidden
|
|
3871
|
+
*/
|
|
3872
|
+
renderAllContent?: boolean;
|
|
3867
3873
|
/**
|
|
3868
3874
|
* @hidden
|
|
3869
3875
|
*/
|
|
@@ -3983,6 +3989,10 @@ export declare interface TabStripNavigationItemProps {
|
|
|
3983
3989
|
* @hidden
|
|
3984
3990
|
*/
|
|
3985
3991
|
contentPanelId?: string;
|
|
3992
|
+
/**
|
|
3993
|
+
* @hidden
|
|
3994
|
+
*/
|
|
3995
|
+
renderAllContent?: boolean;
|
|
3986
3996
|
}
|
|
3987
3997
|
|
|
3988
3998
|
/**
|
|
@@ -4045,6 +4055,10 @@ export declare interface TabStripNavigationProps {
|
|
|
4045
4055
|
* @hidden
|
|
4046
4056
|
*/
|
|
4047
4057
|
navItemId?: string;
|
|
4058
|
+
/**
|
|
4059
|
+
* @hidden
|
|
4060
|
+
*/
|
|
4061
|
+
renderAllContent?: boolean;
|
|
4048
4062
|
}
|
|
4049
4063
|
|
|
4050
4064
|
/**
|
|
@@ -4101,6 +4115,12 @@ export declare interface TabStripProps extends KendoReactComponentBaseProps, Tab
|
|
|
4101
4115
|
* Defines if the tabs will remain mounted after another tab is selected. Defaults to `false`.
|
|
4102
4116
|
*/
|
|
4103
4117
|
keepTabsMounted?: boolean;
|
|
4118
|
+
/**
|
|
4119
|
+
* @default false
|
|
4120
|
+
* Defines if the all component tabs will be rendered by default. Defaults to `false`.
|
|
4121
|
+
* If set to `false`, the component will render only the currently selected tab. This can be useful when the content of the tabs is heavy and you want to improve the initial loading time. Check also the [keepTabsMounted]({% slug api_layout_tabstripprops %}#toc-keeptabsmounted) prop.
|
|
4122
|
+
*/
|
|
4123
|
+
renderAllContent?: boolean;
|
|
4104
4124
|
/**
|
|
4105
4125
|
* Fires each time the user makes a selection.
|
|
4106
4126
|
*/
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-layout",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1711444323,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-layout",
|
|
3
|
-
"version": "7.4.0-develop.
|
|
3
|
+
"version": "7.4.0-develop.7",
|
|
4
4
|
"description": "React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
|
-
"@progress/kendo-react-animation": "7.4.0-develop.
|
|
27
|
-
"@progress/kendo-react-common": "7.4.0-develop.
|
|
28
|
-
"@progress/kendo-react-intl": "7.4.0-develop.
|
|
29
|
-
"@progress/kendo-react-popup": "7.4.0-develop.
|
|
30
|
-
"@progress/kendo-react-progressbars": "7.4.0-develop.
|
|
26
|
+
"@progress/kendo-react-animation": "7.4.0-develop.7",
|
|
27
|
+
"@progress/kendo-react-common": "7.4.0-develop.7",
|
|
28
|
+
"@progress/kendo-react-intl": "7.4.0-develop.7",
|
|
29
|
+
"@progress/kendo-react-popup": "7.4.0-develop.7",
|
|
30
|
+
"@progress/kendo-react-progressbars": "7.4.0-develop.7",
|
|
31
31
|
"@progress/kendo-svg-icons": "^2.1.0",
|
|
32
32
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
33
33
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
package/tabstrip/TabStrip.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 u=require("react"),o=require("prop-types"),p=require("./TabStripNavigation.js"),y=require("./TabStripContent.js"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),o=require("prop-types"),p=require("./TabStripNavigation.js"),y=require("./TabStripContent.js"),n=require("@progress/kendo-react-common"),b=require("../package-metadata.js");function f(c){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>c[e]})}}return s.default=c,Object.freeze(s)}const a=f(u),h=class h extends a.Component{constructor(s){super(s),this._element=null,this.showLicenseWatermark=!1,this.keyBinding={[n.Keys.left]:()=>this.prevNavigatableTab(),[n.Keys.right]:()=>this.nextNavigatableTab(),[n.Keys.down]:()=>this.nextNavigatableTab(),[n.Keys.up]:()=>this.prevNavigatableTab(),[n.Keys.home]:()=>0,[n.Keys.end]:()=>a.Children.count(this.props.children)-1},this.onSelect=e=>{this.props.selected!==e&&this.props.onSelect&&this.props.onSelect({selected:e})},this.onKeyDown=e=>{let t;switch(e.keyCode){case n.Keys.left:t=this.keyBinding[this.invertKeys(n.Keys.left,n.Keys.right)];break;case n.Keys.right:t=this.keyBinding[this.invertKeys(n.Keys.right,n.Keys.left)];break;case n.Keys.up:t=this.keyBinding[n.Keys.up];break;case n.Keys.down:t=this.keyBinding[n.Keys.down];break;case n.Keys.home:t=this.keyBinding[n.Keys.home];break;case n.Keys.end:t=this.keyBinding[n.Keys.end];break}t&&(e.preventDefault(),this.onSelect(t()))},this.renderContent=e=>{const{selected:t,children:i,tabContentStyle:r}=e,l=a.Children.count(i);return t<l&&t>-1?a.createElement(y.TabStripContent,{index:t,...e,style:r}):null},this.firstNavigatableTab=()=>{const e=this.children(),t=a.Children.count(e);if(e){for(let i=0;i<t;i++)if(!e[i].props.disabled)return i}},this.lastNavigatableTab=()=>{const e=this.children(),t=a.Children.count(e);if(e){for(let i=t-1;i>0;i--)if(!e[i].props.disabled)return i}},this.prevNavigatableTab=()=>{const e=this.children(),{selected:t}=this.props,i=t?t-1:-1;if(i<0)return this.lastNavigatableTab();if(e)for(let r=i;r>-1;r--){if(!e[r].props.disabled)return r;if(r===0)return this.lastNavigatableTab()}},this.nextNavigatableTab=()=>{const e=this.children(),{selected:t}=this.props,i=t?t+1:1,r=a.Children.count(e);if(i>=r)return this.firstNavigatableTab();if(e)for(let l=i;l<r;l++){if(!e[l].props.disabled)return l;if(l+1===r)return this.firstNavigatableTab()}},n.validatePackage(b.packageMetadata),this.showLicenseWatermark=n.shouldShowValidationUI(b.packageMetadata)}get contentPanelId(){return this.props.id+"-content-panel-id"}get navItemId(){return this.props.id+"-nav-item-id"}render(){const s={...this.props,children:this.children(),contentPanelId:this.contentPanelId,renderAllContent:this.props.renderAllContent,navItemId:this.navItemId,onKeyDown:this.onKeyDown,onSelect:this.onSelect},{tabPosition:e,tabIndex:t=0}=s,i=e==="bottom",r=n.classNames("k-tabstrip k-pos-relative",{"k-tabstrip-left":e==="left","k-tabstrip-right":e==="right","k-tabstrip-bottom":e==="bottom","k-tabstrip-top":e==="top","k-tabstrip-scrollable":this.props.scrollable},this.props.className);return a.createElement("div",{id:this.props.id,ref:l=>this._element=l,dir:this.props.dir,className:r,style:this.props.style},!i&&a.createElement(p.TabStripNavigation,{...s,tabIndex:t}),this.renderContent(s),i&&a.createElement(p.TabStripNavigation,{...s,tabIndex:t}),this.showLicenseWatermark&&a.createElement(n.WatermarkOverlay,null))}invertKeys(s,e){return this._element&&getComputedStyle(this._element).direction==="rtl"||!1?e:s}children(){return a.Children.toArray(this.props.children).filter(s=>s)}};h.propTypes={animation:o.bool,children:o.node,onSelect:o.func,selected:o.number,style:o.object,tabContentStyle:o.object,tabPosition:o.string,tabIndex:o.number,className:o.string,dir:o.string},h.defaultProps={animation:!0,tabPosition:"top",keepTabsMounted:!1,buttonScrollSpeed:100,mouseScrollSpeed:10,renderAllContent:!1};let d=h;exports.TabStrip=d;
|
package/tabstrip/TabStrip.mjs
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
|
-
import
|
|
10
|
+
import a from "prop-types";
|
|
11
11
|
import { TabStripNavigation as c } from "./TabStripNavigation.mjs";
|
|
12
12
|
import { TabStripContent as b } from "./TabStripContent.mjs";
|
|
13
13
|
import { Keys as n, validatePackage as m, shouldShowValidationUI as f, classNames as u, WatermarkOverlay as g } from "@progress/kendo-react-common";
|
|
14
14
|
import { packageMetadata as d } from "../package-metadata.mjs";
|
|
15
15
|
const h = class h extends r.Component {
|
|
16
|
-
constructor(
|
|
17
|
-
super(
|
|
16
|
+
constructor(o) {
|
|
17
|
+
super(o), this._element = null, this.showLicenseWatermark = !1, this.keyBinding = {
|
|
18
18
|
[n.left]: () => this.prevNavigatableTab(),
|
|
19
19
|
[n.right]: () => this.nextNavigatableTab(),
|
|
20
20
|
[n.down]: () => this.nextNavigatableTab(),
|
|
@@ -99,14 +99,15 @@ const h = class h extends r.Component {
|
|
|
99
99
|
* @hidden
|
|
100
100
|
*/
|
|
101
101
|
render() {
|
|
102
|
-
const
|
|
102
|
+
const o = {
|
|
103
103
|
...this.props,
|
|
104
104
|
children: this.children(),
|
|
105
105
|
contentPanelId: this.contentPanelId,
|
|
106
|
+
renderAllContent: this.props.renderAllContent,
|
|
106
107
|
navItemId: this.navItemId,
|
|
107
108
|
onKeyDown: this.onKeyDown,
|
|
108
109
|
onSelect: this.onSelect
|
|
109
|
-
}, { tabPosition: t, tabIndex: e = 0 } =
|
|
110
|
+
}, { tabPosition: t, tabIndex: e = 0 } = o, i = t === "bottom", s = u(
|
|
110
111
|
"k-tabstrip k-pos-relative",
|
|
111
112
|
{
|
|
112
113
|
"k-tabstrip-left": t === "left",
|
|
@@ -126,36 +127,37 @@ const h = class h extends r.Component {
|
|
|
126
127
|
className: s,
|
|
127
128
|
style: this.props.style
|
|
128
129
|
},
|
|
129
|
-
!i && /* @__PURE__ */ r.createElement(c, { ...
|
|
130
|
-
this.renderContent(
|
|
131
|
-
i && /* @__PURE__ */ r.createElement(c, { ...
|
|
130
|
+
!i && /* @__PURE__ */ r.createElement(c, { ...o, tabIndex: e }),
|
|
131
|
+
this.renderContent(o),
|
|
132
|
+
i && /* @__PURE__ */ r.createElement(c, { ...o, tabIndex: e }),
|
|
132
133
|
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(g, null)
|
|
133
134
|
);
|
|
134
135
|
}
|
|
135
|
-
invertKeys(
|
|
136
|
-
return this._element && getComputedStyle(this._element).direction === "rtl" || !1 ? t :
|
|
136
|
+
invertKeys(o, t) {
|
|
137
|
+
return this._element && getComputedStyle(this._element).direction === "rtl" || !1 ? t : o;
|
|
137
138
|
}
|
|
138
139
|
children() {
|
|
139
|
-
return r.Children.toArray(this.props.children).filter((
|
|
140
|
+
return r.Children.toArray(this.props.children).filter((o) => o);
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
143
|
h.propTypes = {
|
|
143
|
-
animation:
|
|
144
|
-
children:
|
|
145
|
-
onSelect:
|
|
146
|
-
selected:
|
|
147
|
-
style:
|
|
148
|
-
tabContentStyle:
|
|
149
|
-
tabPosition:
|
|
150
|
-
tabIndex:
|
|
151
|
-
className:
|
|
152
|
-
dir:
|
|
144
|
+
animation: a.bool,
|
|
145
|
+
children: a.node,
|
|
146
|
+
onSelect: a.func,
|
|
147
|
+
selected: a.number,
|
|
148
|
+
style: a.object,
|
|
149
|
+
tabContentStyle: a.object,
|
|
150
|
+
tabPosition: a.string,
|
|
151
|
+
tabIndex: a.number,
|
|
152
|
+
className: a.string,
|
|
153
|
+
dir: a.string
|
|
153
154
|
}, h.defaultProps = {
|
|
154
155
|
animation: !0,
|
|
155
156
|
tabPosition: "top",
|
|
156
157
|
keepTabsMounted: !1,
|
|
157
158
|
buttonScrollSpeed: 100,
|
|
158
|
-
mouseScrollSpeed: 10
|
|
159
|
+
mouseScrollSpeed: 10,
|
|
160
|
+
renderAllContent: !1
|
|
159
161
|
};
|
|
160
162
|
let p = h;
|
|
161
163
|
export {
|
|
@@ -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"),i=require("prop-types"),h=require("@progress/kendo-react-animation"),u=require("@progress/kendo-react-common");function b(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const r=b(y),c=class c extends r.Component{constructor(){super(...arguments),this.contentId=this.props.contentPanelId,this.childFactory=e=>r.cloneElement(e,{...e.props,in:e.props.children.props.id===String(this.contentId+this.props.selected)})}render(){const{children:e,selected:t,contentPanelId:n,keepTabsMounted:s,navItemId:o,renderAllContent:l}=this.props,d=e&&typeof t=="number"&&r.Children.toArray(e)[t],m=u.classNames("k-tabstrip-content","k-active",d&&d.props.contentClassName);return l?this.renderAllContent(e):r.createElement("div",{className:m,style:this.props.style,id:n,role:"tabpanel","aria-hidden":s,"aria-labelledby":`${o}-${(t==null?void 0:t.toString())||""}`},this.renderContent(e))}renderContent(e){return this.props.keepTabsMounted?r.Children.map(this.props.children,(t,n)=>this.renderChild(t,n)):this.renderChild(r.Children.toArray(e)[this.props.selected],this.props.selected)}renderAllContent(e){return r.Children.map(e,(t,n)=>{const s=t,o=n===this.props.selected,l=u.classNames("k-tabstrip-content",{"k-active":o},s.props.contentClassName);return r.createElement("div",{className:l,style:this.props.style,id:`${this.props.contentPanelId}-${n}`,role:"tabpanel","aria-hidden":!o,hidden:!o,"aria-labelledby":`${this.props.navItemId}-${n}`},this.props.animation?r.createElement(h.Fade,{key:`${n}-${o}`,appear:!0,enter:!0,exit:!1},s.props.children):s.props.children)})}renderChild(e,t){const n=t===this.props.selected,s={style:{display:n?void 0:"none"}},o={position:"initial",display:n?void 0:"none"};return e.props.disabled?null:this.props.animation?r.createElement(h.Fade,{appear:!0,exit:this.props.keepTabsMounted,style:o,childFactory:this.props.keepTabsMounted?this.childFactory:void 0},r.createElement("div",{...s,id:String(this.contentId+t),key:t},e.props.children)):r.createElement("div",{...s,key:t},e.props.children)}};c.propTypes={animation:i.bool,children:i.oneOfType([i.element,i.arrayOf(i.element)]),selected:i.number,style:i.object};let p=c;exports.TabStripContent=p;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { Fade as
|
|
12
|
-
import { classNames as
|
|
13
|
-
const
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import i from "prop-types";
|
|
11
|
+
import { Fade as d } from "@progress/kendo-react-animation";
|
|
12
|
+
import { classNames as c } from "@progress/kendo-react-common";
|
|
13
|
+
const l = class l extends n.Component {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments), this.contentId = this.props.contentPanelId, this.childFactory = (e) =>
|
|
15
|
+
super(...arguments), this.contentId = this.props.contentPanelId, this.childFactory = (e) => n.cloneElement(e, {
|
|
16
16
|
...e.props,
|
|
17
17
|
in: e.props.children.props.id === String(this.contentId + this.props.selected)
|
|
18
18
|
});
|
|
@@ -21,61 +21,92 @@ const p = class p extends r.Component {
|
|
|
21
21
|
* @hidden
|
|
22
22
|
*/
|
|
23
23
|
render() {
|
|
24
|
-
const { children: e, selected: t, contentPanelId:
|
|
24
|
+
const { children: e, selected: t, contentPanelId: r, keepTabsMounted: s, navItemId: o, renderAllContent: p } = this.props, a = e && typeof t == "number" && n.Children.toArray(e)[t], m = c(
|
|
25
25
|
"k-tabstrip-content",
|
|
26
26
|
"k-active",
|
|
27
|
-
|
|
27
|
+
a && a.props.contentClassName
|
|
28
28
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return p ? this.renderAllContent(e) : /* @__PURE__ */ n.createElement(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
|
-
className:
|
|
32
|
+
className: m,
|
|
33
33
|
style: this.props.style,
|
|
34
|
-
id:
|
|
34
|
+
id: r,
|
|
35
35
|
role: "tabpanel",
|
|
36
|
-
"aria-hidden":
|
|
37
|
-
"aria-labelledby": `${
|
|
36
|
+
"aria-hidden": s,
|
|
37
|
+
"aria-labelledby": `${o}-${(t == null ? void 0 : t.toString()) || ""}`
|
|
38
38
|
},
|
|
39
39
|
this.renderContent(e)
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
renderContent(e) {
|
|
43
|
-
return this.props.keepTabsMounted ?
|
|
44
|
-
|
|
43
|
+
return this.props.keepTabsMounted ? n.Children.map(this.props.children, (t, r) => this.renderChild(t, r)) : this.renderChild(
|
|
44
|
+
n.Children.toArray(e)[this.props.selected],
|
|
45
45
|
this.props.selected
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
+
renderAllContent(e) {
|
|
49
|
+
return n.Children.map(e, (t, r) => {
|
|
50
|
+
const s = t, o = r === this.props.selected, p = c(
|
|
51
|
+
"k-tabstrip-content",
|
|
52
|
+
{ "k-active": o },
|
|
53
|
+
s.props.contentClassName
|
|
54
|
+
);
|
|
55
|
+
return /* @__PURE__ */ n.createElement(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: p,
|
|
59
|
+
style: this.props.style,
|
|
60
|
+
id: `${this.props.contentPanelId}-${r}`,
|
|
61
|
+
role: "tabpanel",
|
|
62
|
+
"aria-hidden": !o,
|
|
63
|
+
hidden: !o,
|
|
64
|
+
"aria-labelledby": `${this.props.navItemId}-${r}`
|
|
65
|
+
},
|
|
66
|
+
this.props.animation ? /* @__PURE__ */ n.createElement(
|
|
67
|
+
d,
|
|
68
|
+
{
|
|
69
|
+
key: `${r}-${o}`,
|
|
70
|
+
appear: !0,
|
|
71
|
+
enter: !0,
|
|
72
|
+
exit: !1
|
|
73
|
+
},
|
|
74
|
+
s.props.children
|
|
75
|
+
) : s.props.children
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
48
79
|
renderChild(e, t) {
|
|
49
|
-
const
|
|
80
|
+
const r = t === this.props.selected, s = {
|
|
50
81
|
style: {
|
|
51
|
-
display:
|
|
82
|
+
display: r ? void 0 : "none"
|
|
52
83
|
}
|
|
53
|
-
},
|
|
84
|
+
}, o = {
|
|
54
85
|
position: "initial",
|
|
55
|
-
display:
|
|
86
|
+
display: r ? void 0 : "none"
|
|
56
87
|
};
|
|
57
|
-
return e.props.disabled ? null : this.props.animation ? /* @__PURE__ */
|
|
58
|
-
|
|
88
|
+
return e.props.disabled ? null : this.props.animation ? /* @__PURE__ */ n.createElement(
|
|
89
|
+
d,
|
|
59
90
|
{
|
|
60
91
|
appear: !0,
|
|
61
92
|
exit: this.props.keepTabsMounted,
|
|
62
|
-
style:
|
|
93
|
+
style: o,
|
|
63
94
|
childFactory: this.props.keepTabsMounted ? this.childFactory : void 0
|
|
64
95
|
},
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
) : /* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ n.createElement("div", { ...s, id: String(this.contentId + t), key: t }, e.props.children)
|
|
97
|
+
) : /* @__PURE__ */ n.createElement("div", { ...s, key: t }, e.props.children);
|
|
67
98
|
}
|
|
68
99
|
};
|
|
69
|
-
|
|
70
|
-
animation:
|
|
71
|
-
children:
|
|
72
|
-
|
|
73
|
-
|
|
100
|
+
l.propTypes = {
|
|
101
|
+
animation: i.bool,
|
|
102
|
+
children: i.oneOfType([
|
|
103
|
+
i.element,
|
|
104
|
+
i.arrayOf(i.element)
|
|
74
105
|
]),
|
|
75
|
-
selected:
|
|
76
|
-
style:
|
|
106
|
+
selected: i.number,
|
|
107
|
+
style: i.object
|
|
77
108
|
};
|
|
78
|
-
let
|
|
109
|
+
let h = l;
|
|
79
110
|
export {
|
|
80
|
-
|
|
111
|
+
h as TabStripContent
|
|
81
112
|
};
|
|
@@ -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"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),f=require("prop-types"),C=require("./TabStripNavigationItem.js"),k=require("@progress/kendo-react-common"),A=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-svg-icons");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(R),x=h=>Array.apply(null,Array(h)),L=h=>h.preventDefault(),v="smooth",b="prev",S="next",P=class P 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?b:S;this.setNewScrollPosition(s,t)},this.arrowClickPrev=t=>{this.handleArrowClick(b,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===b&&o<0&&(o+=r,d+=r),t===S&&o<c&&(o-=r,d-=r),o=Math.min(0,Math.min(c,o))):(t===b&&o>0&&(o-=r,i+=r),t===S&&o<c&&(o+=r,i-=r),o=Math.max(0,Math.min(c,o)));const u=o===0,g=s.type==="click"?v:void 0;if(n){const T=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:u,disabledNext:T}),e.scrollTo({left:o,behavior:g})}else this.setState({disabledPrev:u,disabledNext:Math.round(i)<=e.clientHeight||Math.floor(i)<=e.clientHeight}),e.scrollTo({top:o,behavior:g})},this.renderArrow=(t,s)=>{const e=this.horizontalScroll(),n={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},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}},c=(t===b?this.props.prevButton:this.props.nextButton)||A.Button,r=t===b?this.arrowClickPrev:this.arrowClickNext;return a.createElement(c,{disabled:s,className:`${n[t].arrowTab}`,onClick:r,icon:n[t].fontIcon,svgIcon:n[t].svgIcon,onMouseDown:L,tabIndex:-1,fillMode:"flat"})},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 u;s&&(u=x(i).map((y,p,w)=>{const N={active:l===p,disabled:d[p].props.disabled,index:p,title:d[p].props.title,first:p===0,last:p===w.length-1,contentPanelId:r,renderAllContent:o,id:c,onSelect:e};return a.createElement(C.TabStripNavigationItem,{key:p,...N})}));const g=k.classNames("k-tabstrip-items-wrapper",{"k-hstack":t==="top"||t==="bottom","k-vstack":t==="left"||t==="right"}),T=k.classNames("k-tabstrip-items","k-reset");return a.createElement("div",{className:g},this.props.scrollable?a.createElement(a.Fragment,null,this.renderArrow(b,this.state.disabledPrev),a.createElement("ul",{ref:this.itemsNavRef,className:T,role:"tablist",tabIndex:this.props.tabIndex,onKeyDown:n,onWheel:this.onWheel,"aria-orientation":t==="left"||t==="right"?"vertical":void 0},u),this.renderArrow(S,this.state.disabledNext)):a.createElement("ul",{className:T,role:"tablist",tabIndex:this.props.tabIndex,onKeyDown:n},u))}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:v})):i+n>e-r&&(o=r+i-n,l.scrollTo({[c]:o,behavior:v}))}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:v})):r>i&&(o=i,l.scrollTo({[c]:o,behavior:v}))}}}horizontalScroll(){return/top|bottom/.test(this.props.tabPosition||"top")}};P.propTypes={children:f.oneOfType([f.element,f.arrayOf(f.element)]),onSelect:f.func,onKeyDown:f.func,selected:f.number,tabIndex:f.number};let I=P;exports.TabStripNavigation=I;
|
|
@@ -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;
|