@progress/kendo-react-layout 14.5.0-develop.9 → 15.0.0-develop.2
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/MenuMcpWrapper.d.ts +17 -0
- package/MenuMcpWrapper.js +8 -0
- package/MenuMcpWrapper.mjs +18 -0
- package/README.md +4 -4
- package/actionsheet/ActionSheet.js +1 -1
- package/actionsheet/ActionSheet.mjs +18 -19
- package/actionsheet/ActionSheetItem.js +1 -1
- package/actionsheet/ActionSheetItem.mjs +1 -3
- package/bottomnavigation/BottomNavigation.js +1 -1
- package/bottomnavigation/BottomNavigation.mjs +85 -69
- package/bottomnavigation/BottomNavigationItem.js +1 -1
- package/bottomnavigation/BottomNavigationItem.mjs +34 -33
- package/bottomnavigation/messages/index.d.ts +17 -0
- package/bottomnavigation/messages/index.js +8 -0
- package/bottomnavigation/messages/index.mjs +14 -0
- package/breadcrumb/Breadcrumb.js +1 -1
- package/breadcrumb/Breadcrumb.mjs +30 -28
- package/breadcrumb/BreadcrumbLink.js +1 -1
- package/breadcrumb/BreadcrumbLink.mjs +26 -26
- package/breadcrumb/messages/index.d.ts +17 -0
- package/breadcrumb/messages/index.js +8 -0
- package/breadcrumb/messages/index.mjs +14 -0
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/drawer/Drawer.js +1 -1
- package/drawer/Drawer.mjs +63 -63
- package/drawer/DrawerItem.js +1 -1
- package/drawer/DrawerItem.mjs +22 -23
- package/drawer/interfaces/DrawerProps.d.ts +8 -0
- package/expansionpanel/ExpansionPanel.js +1 -1
- package/expansionpanel/ExpansionPanel.mjs +50 -50
- package/expansionpanel/ExpansionPanelContent.js +1 -1
- package/expansionpanel/ExpansionPanelContent.mjs +7 -4
- package/index.d.mts +1 -2
- package/index.d.ts +1 -2
- package/index.js +1 -1
- package/index.mjs +128 -130
- package/menu/MenuProps.d.ts +6 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/panelbar/PanelBar.js +1 -1
- package/panelbar/PanelBar.mjs +94 -91
- package/panelbar/PanelBarItem.js +1 -1
- package/panelbar/PanelBarItem.mjs +13 -15
- package/panelbar/interfaces/PanelBarProps.d.ts +8 -0
- package/panelbar/interfaces/RenderPanelBarItem.d.ts +1 -0
- package/panelbar/util.d.ts +1 -1
- package/panelbar/util.js +1 -1
- package/panelbar/util.mjs +62 -59
- package/splitter/SplitterBar.d.ts +1 -0
- package/splitter/SplitterBar.js +1 -1
- package/splitter/SplitterBar.mjs +64 -56
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +79 -85
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +134 -133
- package/stepper/interfaces/StepperProps.d.ts +8 -1
- package/stepper/messages/index.d.ts +12 -2
- package/stepper/messages/index.js +1 -1
- package/stepper/messages/index.mjs +8 -4
- package/tabstrip/TabStrip.d.ts +8 -1
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +126 -125
- package/tilelayout/InternalTile.js +1 -1
- package/tilelayout/InternalTile.mjs +119 -115
- package/tilelayout/TileLayout.js +1 -1
- package/tilelayout/TileLayout.mjs +58 -58
- package/timeline/TimelineCard.d.ts +2 -0
- package/timeline/TimelineCard.js +1 -1
- package/timeline/TimelineCard.mjs +16 -15
- package/timeline/TimelineHorizontal.js +1 -1
- package/timeline/TimelineHorizontal.mjs +105 -101
package/panelbar/util.mjs
CHANGED
|
@@ -5,101 +5,104 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as i from "react";
|
|
9
9
|
import { PanelBarItem as g } from "./PanelBarItem.mjs";
|
|
10
10
|
import { NavigationAction as d } from "./interfaces/NavigationAction.mjs";
|
|
11
|
-
const
|
|
11
|
+
const q = (r) => typeof r != "object" || !("type" in r) || r.type !== g, C = ({
|
|
12
12
|
animation: r = !0,
|
|
13
13
|
keepItemsMounted: n = !1,
|
|
14
14
|
state: e,
|
|
15
15
|
expanded: p,
|
|
16
16
|
handleSelect: t,
|
|
17
17
|
children: o,
|
|
18
|
-
parentExpanded:
|
|
18
|
+
parentExpanded: f = !0,
|
|
19
19
|
level: s = 0,
|
|
20
|
-
parentPrivateKey: c = []
|
|
20
|
+
parentPrivateKey: c = [],
|
|
21
|
+
activeDescendantRef: m
|
|
21
22
|
}) => {
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
if (
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
23
|
+
const y = i.Children.toArray(o).filter(q), v = y.length ? y : o;
|
|
24
|
+
return i.Children.map(v, (u, x) => {
|
|
25
|
+
if (u && u.type === g) {
|
|
26
|
+
let b;
|
|
27
|
+
const a = l(u, c, x);
|
|
28
|
+
if (u.props.children) {
|
|
29
|
+
const F = {
|
|
29
30
|
animation: r,
|
|
30
31
|
keepItemsMounted: n,
|
|
31
32
|
state: e,
|
|
32
33
|
expanded: p,
|
|
33
34
|
handleSelect: t,
|
|
34
|
-
children:
|
|
35
|
-
parentExpanded: (p || []).indexOf(
|
|
35
|
+
children: u.props.children,
|
|
36
|
+
parentExpanded: (p || []).indexOf(a) > -1,
|
|
36
37
|
level: s + 1,
|
|
37
|
-
parentPrivateKey: [...c,
|
|
38
|
+
parentPrivateKey: [...c, a],
|
|
39
|
+
activeDescendantRef: m
|
|
38
40
|
};
|
|
39
|
-
|
|
41
|
+
b = C(F);
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
const E = u.props.id || `k-panelbar-item-default-${a}`;
|
|
44
|
+
return m && e.wrapperFocused && e.focused === a && (m.current = E), i.cloneElement(u, {
|
|
45
|
+
...u.props,
|
|
46
|
+
animation: u.props.animation !== void 0 ? u.props.animation : r,
|
|
44
47
|
keepItemsMounted: n,
|
|
45
|
-
id:
|
|
46
|
-
uniquePrivateKey:
|
|
48
|
+
id: E,
|
|
49
|
+
uniquePrivateKey: a,
|
|
47
50
|
parentUniquePrivateKey: c,
|
|
48
|
-
parentExpanded:
|
|
51
|
+
parentExpanded: f,
|
|
49
52
|
level: s,
|
|
50
|
-
expanded: (p || []).indexOf(
|
|
51
|
-
focused: e.focused ===
|
|
52
|
-
selected: e.selected ===
|
|
53
|
-
children:
|
|
53
|
+
expanded: (p || []).indexOf(a) > -1,
|
|
54
|
+
focused: e.focused === a && e.wrapperFocused,
|
|
55
|
+
selected: e.selected === a,
|
|
56
|
+
children: b,
|
|
54
57
|
onSelect: t
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ i.createElement("div", { className: "k-panelbar-content", "aria-hidden": f ? void 0 : "true" }, u);
|
|
58
61
|
});
|
|
59
|
-
},
|
|
60
|
-
const n =
|
|
61
|
-
return n ?
|
|
62
|
-
},
|
|
62
|
+
}, K = (r) => {
|
|
63
|
+
const n = i.Children.toArray(r.children)[0];
|
|
64
|
+
return n ? l(n, [], 0) : "";
|
|
65
|
+
}, k = (r, n, e = {
|
|
63
66
|
expanded: r.expanded || [],
|
|
64
67
|
selected: r.selected || "",
|
|
65
68
|
focused: r.focused || "",
|
|
66
69
|
wrapperFocused: !1
|
|
67
|
-
}, p = !0, t = []) => (
|
|
70
|
+
}, p = !0, t = []) => (i.Children.map(r.children, (o, f) => {
|
|
68
71
|
if (o && o.type === g) {
|
|
69
|
-
const s =
|
|
70
|
-
!o.props.disabled && p && (o.props.selected && (e.selected = s), o.props.focused && (e.focused = s), o.props.expanded && (n === "multiple" ? e.expanded.push(s) : n === "single" && (e.expanded = [s])), o.props.children && (e =
|
|
72
|
+
const s = l(o, t, f);
|
|
73
|
+
!o.props.disabled && p && (o.props.selected && (e.selected = s), o.props.focused && (e.focused = s), o.props.expanded && (n === "multiple" ? e.expanded.push(s) : n === "single" && (e.expanded = [s])), o.props.children && (e = k(o.props, n, e, !!o.props.expanded, [
|
|
71
74
|
...t,
|
|
72
75
|
s
|
|
73
76
|
])));
|
|
74
77
|
}
|
|
75
|
-
}), e),
|
|
76
|
-
function
|
|
78
|
+
}), e), l = (r, n, e) => r && r.props && r.props.id ? r.props.id : n.length ? n[n.length - 1] + `.${e}` : `.${e}`;
|
|
79
|
+
function w(r, n = []) {
|
|
77
80
|
return (r || []).forEach((e) => {
|
|
78
|
-
e.disabled || (n.push(e), e.expanded && e.children &&
|
|
81
|
+
e.disabled || (n.push(e), e.expanded && e.children && w(e.children, n));
|
|
79
82
|
}), n;
|
|
80
83
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
83
|
-
e && e.props && !e.props.disabled && (n.push(e), e.props.children &&
|
|
84
|
+
function P(r, n = []) {
|
|
85
|
+
return i.Children.forEach(r, (e) => {
|
|
86
|
+
e && e.props && !e.props.disabled && (n.push(e), e.props.children && P(e.props.children, n));
|
|
84
87
|
}), n;
|
|
85
88
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
88
|
-
e && e.props && (e.props.expanded || e.props.parentExpanded) && (n.push(e), e.props.children &&
|
|
89
|
+
function A(r, n = []) {
|
|
90
|
+
return i.Children.forEach(r, (e) => {
|
|
91
|
+
e && e.props && (e.props.expanded || e.props.parentExpanded) && (n.push(e), e.props.children && A(e.props.children, n));
|
|
89
92
|
}), n;
|
|
90
93
|
}
|
|
91
|
-
const
|
|
92
|
-
var
|
|
94
|
+
const L = (r) => r != null;
|
|
95
|
+
var I;
|
|
93
96
|
((r) => {
|
|
94
97
|
function n(e) {
|
|
95
98
|
return e.map((p, t) => {
|
|
96
99
|
let o;
|
|
97
|
-
return p.content && (o = p.content), p.children && (o = n(p.children)), /* @__PURE__ */
|
|
100
|
+
return p.content && (o = p.content), p.children && (o = n(p.children)), /* @__PURE__ */ i.createElement(g, { ...p, children: o, key: p.id || t });
|
|
98
101
|
});
|
|
99
102
|
}
|
|
100
103
|
r.mapItemsToComponents = n;
|
|
101
|
-
})(
|
|
102
|
-
const
|
|
104
|
+
})(I || (I = {}));
|
|
105
|
+
const N = (r, n) => r.length !== n.length ? !1 : r.every((e, p) => e === n[p]), O = (r, n, e, p, t) => {
|
|
103
106
|
let o;
|
|
104
107
|
if (t === d.First || t === d.Last)
|
|
105
108
|
switch (t) {
|
|
@@ -111,8 +114,8 @@ const K = (r, n) => r.length !== n.length ? !1 : r.every((e, p) => e === n[p]),
|
|
|
111
114
|
break;
|
|
112
115
|
}
|
|
113
116
|
else
|
|
114
|
-
r.forEach((
|
|
115
|
-
if (
|
|
117
|
+
r.forEach((f, s) => {
|
|
118
|
+
if (f.props.uniquePrivateKey === (e.uniquePrivateKey || p)) {
|
|
116
119
|
const c = s + n < 0 ? r.length - 1 : s + n > r.length - 1 ? 0 : s + n;
|
|
117
120
|
o = r[c];
|
|
118
121
|
}
|
|
@@ -120,14 +123,14 @@ const K = (r, n) => r.length !== n.length ? !1 : r.every((e, p) => e === n[p]),
|
|
|
120
123
|
return o;
|
|
121
124
|
};
|
|
122
125
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
I as PanelBarUtils,
|
|
127
|
+
P as flatChildren,
|
|
128
|
+
A as flatVisibleChildren,
|
|
129
|
+
w as flatVisibleItems,
|
|
130
|
+
K as getFirstId,
|
|
131
|
+
O as getFocusedChild,
|
|
132
|
+
k as getInitialState,
|
|
133
|
+
N as isArrayEqual,
|
|
134
|
+
L as isPresent,
|
|
135
|
+
C as renderChildren
|
|
133
136
|
};
|
|
@@ -40,6 +40,7 @@ export declare class SplitterBar extends React.Component<SplitterBarProps, Split
|
|
|
40
40
|
constructor(props: SplitterBarProps);
|
|
41
41
|
/** @hidden */
|
|
42
42
|
componentDidMount(): void;
|
|
43
|
+
private get ariaValueNow();
|
|
43
44
|
render(): React.JSX.Element;
|
|
44
45
|
private onDrag;
|
|
45
46
|
private onFocus;
|
package/splitter/SplitterBar.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),h=require("@progress/kendo-react-common"),c=require("@progress/kendo-svg-icons");function f(p){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const t in p)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(p,t);Object.defineProperty(o,t,s.get?s:{enumerable:!0,get:()=>p[t]})}}return o.default=p,Object.freeze(o)}const l=f(b);class d extends l.Component{constructor(o){super(o),this.draggable=null,this.spliterBarRef=l.createRef(),this.onDrag=(t,s,i)=>{const{event:r}=t,{onDrag:n,index:e}=this.props,g=this.draggable&&this.draggable.element;g&&!this.isStatic&&this.isDraggable&&n(r,g,e,s,i)},this.onFocus=()=>{this.setState({focused:!0})},this.onBlur=()=>{this.setState({focused:!1})},this.onToggle=t=>{const{onToggle:s,index:i,prev:r,next:n}=this.props;(r.collapsible||n.collapsible)&&s(r.collapsible?i:i+1,t)},this.onPrevToggle=t=>{const{onToggle:s,index:i,prev:r}=this.props;r.collapsible&&s(i,t)},this.onNextToggle=t=>{const{onToggle:s,index:i,next:r}=this.props;r.collapsible&&s(i+1,t)},this.onKeyDown=t=>{this.navigation.triggerKeyboardEvent(t)},this.state={focused:!1}}get isStatic(){const{prev:o,next:t}=this.props,s=o.resizable&&t.resizable,i=o.collapsible||t.collapsible;return!s&&!i}get isDraggable(){const{prev:o,next:t}=this.props,s=o.resizable&&t.resizable,i=o.collapsed||t.collapsed;return!!s&&!i}get isHorizontal(){return this.props.orientation==="horizontal"}componentDidMount(){const o=this.draggable&&this.draggable.element,{index:t,onKeyboardResize:s}=this.props,i=this.isHorizontal;o&&(this.navigation=new h.Navigation({tabIndex:0,root:this.spliterBarRef,selectors:[".k-splitter .k-splitbar"],keyboardEvents:{keydown:{ArrowLeft:(r,n,e)=>{i&&(e.preventDefault(),this.isDraggable&&s(o,t,-10,e),(e.metaKey||e.ctrlKey)&&(s(o,t,0,e),this.isDraggable?this.onPrevToggle(e):this.onNextToggle(e)))},ArrowRight:(r,n,e)=>{i&&(e.preventDefault(),this.isDraggable&&s(o,t,10,e),(e.metaKey||e.ctrlKey)&&(s(o,t,0,e),this.isDraggable?this.onNextToggle(e):this.onPrevToggle(e)))},ArrowDown:(r,n,e)=>{i||(e.preventDefault(),this.isDraggable&&s(o,t,10,e),(e.metaKey||e.ctrlKey)&&(s(o,t,0,e),this.isDraggable?this.onNextToggle(e):this.onPrevToggle(e)))},ArrowUp:(r,n,e)=>{i||(e.preventDefault(),this.isDraggable&&s(o,t,-10,e),(e.metaKey||e.ctrlKey)&&(s(o,t,0,e),this.isDraggable?this.onPrevToggle(e):this.onNextToggle(e)))},Enter:(r,n,e)=>{e.preventDefault(),this.onToggle(e)}}}}))}get ariaValueNow(){const{prev:o}=this.props;if(!this.isStatic&&o.size){const t=parseFloat(o.size);if(!isNaN(t))return t}}render(){const o=this.isDraggable,t=this.isStatic,s=this.isHorizontal;let i,r;if(this.props.prev.collapsible)if(s){const a=!!this.props.prev.collapsed!=!!this.props.isRtl;i=a?"chevron-right":"chevron-left",r=a?c.chevronRightIcon:c.chevronLeftIcon}else i=this.props.prev.collapsed?"chevron-down":"chevron-up",r=this.props.prev.collapsed?c.chevronDownIcon:c.chevronUpIcon;let n,e;if(this.props.next.collapsible)if(s){const a=!!this.props.next.collapsed==!!this.props.isRtl;n=a?"chevron-right":"chevron-left",e=a?c.chevronRightIcon:c.chevronLeftIcon}else n=this.props.next.collapsed?"chevron-up":"chevron-down",e=this.props.next.collapsed?c.chevronUpIcon:c.chevronDownIcon;const g=h.classNames("k-splitbar",{"k-focus":this.state.focused,"k-splitbar-horizontal":s,"k-splitbar-vertical":!s,"k-splitbar-draggable-horizontal":s&&o,"k-splitbar-draggable-vertical":!s&&o,"k-splitbar-static-horizontal":s&&t,"k-splitbar-static-vertical":!s&&t});return l.createElement(h.Draggable,{onPress:a=>this.onDrag(a,!0,!1),onDrag:a=>this.onDrag(a,!1,!1),onRelease:a=>this.onDrag(a,!1,!0),ref:a=>{this.draggable=a}},l.createElement("div",{ref:this.spliterBarRef,tabIndex:t?-1:0,role:"separator","aria-label":this.props.ariaLabel,"aria-valuenow":this.ariaValueNow,"aria-orientation":s?"vertical":void 0,"aria-keyshortcuts":"ArrowLeft ArrowRight ArrowUp ArrowDown",className:g,style:{touchAction:"none"},onFocus:this.onFocus,onBlur:this.onBlur,onDoubleClick:this.onToggle,onKeyDown:this.onKeyDown},this.props.prev.collapsible&&l.createElement("div",{className:"k-collapse-prev",onClick:this.onPrevToggle},l.createElement(h.IconWrap,{name:i,icon:r,size:"xsmall"})),l.createElement("div",{className:"k-resize-handle","aria-hidden":"true"}),this.props.next.collapsible&&l.createElement("div",{className:"k-collapse-next",onClick:this.onNextToggle},l.createElement(h.IconWrap,{name:n,icon:e,size:"xsmall"}))))}}exports.SplitterBar=d;
|
package/splitter/SplitterBar.mjs
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as n from "react";
|
|
9
|
-
import { Navigation as d, classNames as
|
|
9
|
+
import { Navigation as d, classNames as u, Draggable as m, IconWrap as p } from "@progress/kendo-react-common";
|
|
10
10
|
import { chevronDownIcon as h, chevronUpIcon as g, chevronRightIcon as b, chevronLeftIcon as f } from "@progress/kendo-svg-icons";
|
|
11
11
|
class w extends n.Component {
|
|
12
12
|
constructor(i) {
|
|
13
|
-
super(i), this.draggable = null, this.spliterBarRef = n.createRef(), this.onDrag = (
|
|
14
|
-
const { event:
|
|
15
|
-
c && !this.isStatic && this.isDraggable && l(
|
|
13
|
+
super(i), this.draggable = null, this.spliterBarRef = n.createRef(), this.onDrag = (t, s, o) => {
|
|
14
|
+
const { event: a } = t, { onDrag: l, index: e } = this.props, c = this.draggable && this.draggable.element;
|
|
15
|
+
c && !this.isStatic && this.isDraggable && l(a, c, e, s, o);
|
|
16
16
|
}, this.onFocus = () => {
|
|
17
17
|
this.setState({
|
|
18
18
|
focused: !0
|
|
@@ -21,104 +21,112 @@ class w extends n.Component {
|
|
|
21
21
|
this.setState({
|
|
22
22
|
focused: !1
|
|
23
23
|
});
|
|
24
|
-
}, this.onToggle = (
|
|
25
|
-
const { onToggle:
|
|
26
|
-
(
|
|
27
|
-
}, this.onPrevToggle = (
|
|
28
|
-
const { onToggle:
|
|
29
|
-
|
|
30
|
-
}, this.onNextToggle = (
|
|
31
|
-
const { onToggle:
|
|
32
|
-
|
|
33
|
-
}, this.onKeyDown = (
|
|
34
|
-
this.navigation.triggerKeyboardEvent(
|
|
24
|
+
}, this.onToggle = (t) => {
|
|
25
|
+
const { onToggle: s, index: o, prev: a, next: l } = this.props;
|
|
26
|
+
(a.collapsible || l.collapsible) && s(a.collapsible ? o : o + 1, t);
|
|
27
|
+
}, this.onPrevToggle = (t) => {
|
|
28
|
+
const { onToggle: s, index: o, prev: a } = this.props;
|
|
29
|
+
a.collapsible && s(o, t);
|
|
30
|
+
}, this.onNextToggle = (t) => {
|
|
31
|
+
const { onToggle: s, index: o, next: a } = this.props;
|
|
32
|
+
a.collapsible && s(o + 1, t);
|
|
33
|
+
}, this.onKeyDown = (t) => {
|
|
34
|
+
this.navigation.triggerKeyboardEvent(t);
|
|
35
35
|
}, this.state = {
|
|
36
36
|
focused: !1
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
get isStatic() {
|
|
40
|
-
const { prev: i, next:
|
|
41
|
-
return !
|
|
40
|
+
const { prev: i, next: t } = this.props, s = i.resizable && t.resizable, o = i.collapsible || t.collapsible;
|
|
41
|
+
return !s && !o;
|
|
42
42
|
}
|
|
43
43
|
get isDraggable() {
|
|
44
|
-
const { prev: i, next:
|
|
45
|
-
return !!
|
|
44
|
+
const { prev: i, next: t } = this.props, s = i.resizable && t.resizable, o = i.collapsed || t.collapsed;
|
|
45
|
+
return !!s && !o;
|
|
46
46
|
}
|
|
47
47
|
get isHorizontal() {
|
|
48
48
|
return this.props.orientation === "horizontal";
|
|
49
49
|
}
|
|
50
50
|
/** @hidden */
|
|
51
51
|
componentDidMount() {
|
|
52
|
-
const i = this.draggable && this.draggable.element, { index:
|
|
52
|
+
const i = this.draggable && this.draggable.element, { index: t, onKeyboardResize: s } = this.props, o = this.isHorizontal;
|
|
53
53
|
i && (this.navigation = new d({
|
|
54
54
|
tabIndex: 0,
|
|
55
55
|
root: this.spliterBarRef,
|
|
56
56
|
selectors: [".k-splitter .k-splitbar"],
|
|
57
57
|
keyboardEvents: {
|
|
58
58
|
keydown: {
|
|
59
|
-
ArrowLeft: (
|
|
60
|
-
o && (e.preventDefault(), this.isDraggable &&
|
|
59
|
+
ArrowLeft: (a, l, e) => {
|
|
60
|
+
o && (e.preventDefault(), this.isDraggable && s(i, t, -10, e), (e.metaKey || e.ctrlKey) && (s(i, t, 0, e), this.isDraggable ? this.onPrevToggle(e) : this.onNextToggle(e)));
|
|
61
61
|
},
|
|
62
|
-
ArrowRight: (
|
|
63
|
-
o && (e.preventDefault(), this.isDraggable &&
|
|
62
|
+
ArrowRight: (a, l, e) => {
|
|
63
|
+
o && (e.preventDefault(), this.isDraggable && s(i, t, 10, e), (e.metaKey || e.ctrlKey) && (s(i, t, 0, e), this.isDraggable ? this.onNextToggle(e) : this.onPrevToggle(e)));
|
|
64
64
|
},
|
|
65
|
-
ArrowDown: (
|
|
66
|
-
o || (e.preventDefault(), this.isDraggable &&
|
|
65
|
+
ArrowDown: (a, l, e) => {
|
|
66
|
+
o || (e.preventDefault(), this.isDraggable && s(i, t, 10, e), (e.metaKey || e.ctrlKey) && (s(i, t, 0, e), this.isDraggable ? this.onNextToggle(e) : this.onPrevToggle(e)));
|
|
67
67
|
},
|
|
68
|
-
ArrowUp: (
|
|
69
|
-
o || (e.preventDefault(), this.isDraggable &&
|
|
68
|
+
ArrowUp: (a, l, e) => {
|
|
69
|
+
o || (e.preventDefault(), this.isDraggable && s(i, t, -10, e), (e.metaKey || e.ctrlKey) && (s(i, t, 0, e), this.isDraggable ? this.onPrevToggle(e) : this.onNextToggle(e)));
|
|
70
70
|
},
|
|
71
|
-
Enter: (
|
|
71
|
+
Enter: (a, l, e) => {
|
|
72
72
|
e.preventDefault(), this.onToggle(e);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}));
|
|
77
77
|
}
|
|
78
|
+
get ariaValueNow() {
|
|
79
|
+
const { prev: i } = this.props;
|
|
80
|
+
if (!this.isStatic && i.size) {
|
|
81
|
+
const t = parseFloat(i.size);
|
|
82
|
+
if (!isNaN(t))
|
|
83
|
+
return t;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
78
86
|
render() {
|
|
79
|
-
const i = this.isDraggable,
|
|
80
|
-
let o,
|
|
87
|
+
const i = this.isDraggable, t = this.isStatic, s = this.isHorizontal;
|
|
88
|
+
let o, a;
|
|
81
89
|
if (this.props.prev.collapsible)
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
o =
|
|
90
|
+
if (s) {
|
|
91
|
+
const r = !!this.props.prev.collapsed != !!this.props.isRtl;
|
|
92
|
+
o = r ? "chevron-right" : "chevron-left", a = r ? b : f;
|
|
85
93
|
} else
|
|
86
|
-
o = this.props.prev.collapsed ? "chevron-down" : "chevron-up",
|
|
94
|
+
o = this.props.prev.collapsed ? "chevron-down" : "chevron-up", a = this.props.prev.collapsed ? h : g;
|
|
87
95
|
let l, e;
|
|
88
96
|
if (this.props.next.collapsible)
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
l =
|
|
97
|
+
if (s) {
|
|
98
|
+
const r = !!this.props.next.collapsed == !!this.props.isRtl;
|
|
99
|
+
l = r ? "chevron-right" : "chevron-left", e = r ? b : f;
|
|
92
100
|
} else
|
|
93
101
|
l = this.props.next.collapsed ? "chevron-up" : "chevron-down", e = this.props.next.collapsed ? g : h;
|
|
94
|
-
const c =
|
|
102
|
+
const c = u("k-splitbar", {
|
|
95
103
|
"k-focus": this.state.focused,
|
|
96
|
-
"k-splitbar-horizontal":
|
|
97
|
-
"k-splitbar-vertical": !
|
|
98
|
-
"k-splitbar-draggable-horizontal":
|
|
99
|
-
"k-splitbar-draggable-vertical": !
|
|
100
|
-
"k-splitbar-static-horizontal":
|
|
101
|
-
"k-splitbar-static-vertical": !
|
|
104
|
+
"k-splitbar-horizontal": s,
|
|
105
|
+
"k-splitbar-vertical": !s,
|
|
106
|
+
"k-splitbar-draggable-horizontal": s && i,
|
|
107
|
+
"k-splitbar-draggable-vertical": !s && i,
|
|
108
|
+
"k-splitbar-static-horizontal": s && t,
|
|
109
|
+
"k-splitbar-static-vertical": !s && t
|
|
102
110
|
});
|
|
103
111
|
return /* @__PURE__ */ n.createElement(
|
|
104
|
-
|
|
112
|
+
m,
|
|
105
113
|
{
|
|
106
|
-
onPress: (
|
|
107
|
-
onDrag: (
|
|
108
|
-
onRelease: (
|
|
109
|
-
ref: (
|
|
110
|
-
this.draggable =
|
|
114
|
+
onPress: (r) => this.onDrag(r, !0, !1),
|
|
115
|
+
onDrag: (r) => this.onDrag(r, !1, !1),
|
|
116
|
+
onRelease: (r) => this.onDrag(r, !1, !0),
|
|
117
|
+
ref: (r) => {
|
|
118
|
+
this.draggable = r;
|
|
111
119
|
}
|
|
112
120
|
},
|
|
113
121
|
/* @__PURE__ */ n.createElement(
|
|
114
122
|
"div",
|
|
115
123
|
{
|
|
116
124
|
ref: this.spliterBarRef,
|
|
117
|
-
tabIndex:
|
|
125
|
+
tabIndex: t ? -1 : 0,
|
|
118
126
|
role: "separator",
|
|
119
|
-
"aria-valuenow": 0,
|
|
120
127
|
"aria-label": this.props.ariaLabel,
|
|
121
|
-
"aria-
|
|
128
|
+
"aria-valuenow": this.ariaValueNow,
|
|
129
|
+
"aria-orientation": s ? "vertical" : void 0,
|
|
122
130
|
"aria-keyshortcuts": "ArrowLeft ArrowRight ArrowUp ArrowDown",
|
|
123
131
|
className: c,
|
|
124
132
|
style: { touchAction: "none" },
|
|
@@ -127,8 +135,8 @@ class w extends n.Component {
|
|
|
127
135
|
onDoubleClick: this.onToggle,
|
|
128
136
|
onKeyDown: this.onKeyDown
|
|
129
137
|
},
|
|
130
|
-
this.props.prev.collapsible && /* @__PURE__ */ n.createElement("div", { className: "k-collapse-prev", onClick: this.onPrevToggle }, /* @__PURE__ */ n.createElement(p, { name: o, icon:
|
|
131
|
-
/* @__PURE__ */ n.createElement("div", { className: "k-resize-handle" }),
|
|
138
|
+
this.props.prev.collapsible && /* @__PURE__ */ n.createElement("div", { className: "k-collapse-prev", onClick: this.onPrevToggle }, /* @__PURE__ */ n.createElement(p, { name: o, icon: a, size: "xsmall" })),
|
|
139
|
+
/* @__PURE__ */ n.createElement("div", { className: "k-resize-handle", "aria-hidden": "true" }),
|
|
132
140
|
this.props.next.collapsible && /* @__PURE__ */ n.createElement("div", { className: "k-collapse-next", onClick: this.onNextToggle }, /* @__PURE__ */ n.createElement(p, { name: l, icon: e, size: "xsmall" }))
|
|
133
141
|
)
|
|
134
142
|
);
|
package/stepper/Step.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("react"),n=require("prop-types"),se=require("./context/StepperContext.js"),l=require("@progress/kendo-react-common"),oe=require("@progress/kendo-react-intl"),P=require("@progress/kendo-svg-icons"),V=require("./contants.js"),T=require("./messages/index.js");function ce(s){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const b=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(m,i,b.get?b:{enumerable:!0,get:()=>s[i]})}}return m.default=s,Object.freeze(m)}const e=ce(ae),q=e.forwardRef((s,m)=>{const{children:i,className:b,current:g,disabled:o,focused:A,icon:r,svgIcon:N,index:a,isValid:t,label:c,optional:k,style:F,tabIndex:ie=le.tabIndex,text:f,...$}=s,{animationDuration:x,isVertical:E,item:z,linear:w,mode:L,numOfSteps:d,value:u,onChange:C,onFocus:S,successIcon:H,errorIcon:W,successSVGIcon:B,errorSVGIcon:G}=e.useContext(se.StepperContext),v=e.useRef(null),R=e.useCallback(()=>{v.current&&l.focusFirstFocusableChild(v.current)},[]),y=e.useCallback(()=>({element:v.current,focus:R}),[R]);e.useImperativeHandle(m,y);const h=!w||a===u-1||a===u||a===u+1,O=L==="labels"||!!r&&!!c,U=oe.useLocalization(),j=p=>U.toLanguageString(p,T.messages[p]),K=j(T.optionalText),J=typeof x=="number"?x:x!==!1?V.DEFAULT_ANIMATION_DURATION:V.NO_ANIMATION,Q=e.useCallback(p=>{C&&!o&&l.dispatchEvent(C,p,y(),{value:a})},[C,u,o]),X=e.useCallback(p=>{S&&!o&&l.dispatchEvent(S,p,y(),void 0)},[S,o]),Y=e.useMemo(()=>l.classNames("k-step",{"k-step-first":a===0,"k-step-last":d&&a===d-1,"k-step-done":a<u,"k-step-current":g,"k-step-optional":k,"k-step-error":t!==void 0&&!t,"k-step-success":t,"k-disabled":o,"k-focus":A},b),[a,d,u,g,k,o,A,t,b]),Z=e.useMemo(()=>({maxWidth:E?void 0:`calc(100% / ${d})`,maxHeight:E?`calc(100% / ${d})`:void 0,pointerEvents:h?void 0:"none",...F}),[E,d,F,h]),D=t?H:W,M=D?e.createElement("span",{className:"k-step-indicator-icon "+D,"aria-hidden":"true"}):e.createElement(l.IconWrap,{className:"k-step-indicator-icon",name:t?"check-circle":"exclamation-circle",icon:t?B||P.checkIcon:G||P.exclamationCircleIcon}),ee=e.createElement(e.Fragment,null,L!=="labels"?e.createElement("span",{className:"k-step-indicator",style:{transitionDuration:J+"ms"}},r||N?!O&&t!==void 0?M:e.createElement(l.IconWrap,{className:"k-step-indicator-icon",name:r&&l.toIconName(r),icon:N}):t!==void 0?M:e.createElement("span",{className:"k-step-indicator-text"},f||a+1)):null),te=(c||O||k)&&e.createElement("span",{className:"k-step-label"},c&&e.createElement("span",{className:"k-step-text"},c),O&&t!==void 0&&M,k&&e.createElement("span",{className:"k-step-label-optional"},K)),ne=e.createElement(e.Fragment,null,ee,te),_=j(T.stepAriaLabel);let I=c;return I||(f?I=`${_} ${f}`:(r||N)&&(I=_)),e.createElement("li",{ref:v,className:Y,style:Z,...$},e.createElement("a",{className:"k-step-link",title:c||void 0,onClick:Q,onFocus:X,"aria-current":g?"step":void 0,"aria-disabled":o||!h||void 0,"aria-invalid":t!==void 0&&!t||void 0,"aria-label":I},z?i:ne))});q.propTypes={children:n.any,className:n.string,current:n.bool,disabled:n.bool,icon:n.string,index:n.number,isValid:n.bool,label:n.string,optional:n.bool,style:n.object,tabIndex:n.number,text:n.string};const le={tabIndex:0};q.displayName="KendoStep";exports.Step=q;
|