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