@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
@@ -7,11 +7,11 @@
7
7
  */
8
8
  import * as t from "react";
9
9
  import s from "prop-types";
10
- import { Card as N } from "../card/Card.mjs";
11
- import { CardHeader as b } from "../card/CardHeader.mjs";
12
- import { CardTitle as A } from "../card/CardTitle.mjs";
13
- import { CardSubtitle as D } from "../card/CardSubtitle.mjs";
14
- import { CardBody as h } from "../card/CardBody.mjs";
10
+ import { Card as C } from "../card/Card.mjs";
11
+ import { CardHeader as N } from "../card/CardHeader.mjs";
12
+ import { CardTitle as h } from "../card/CardTitle.mjs";
13
+ import { CardSubtitle as A } from "../card/CardSubtitle.mjs";
14
+ import { CardBody as D } from "../card/CardBody.mjs";
15
15
  import { CardImage as I } from "../card/CardImage.mjs";
16
16
  import { CardActions as g } from "../card/CardActions.mjs";
17
17
  import { classNames as u } from "@progress/kendo-react-common";
@@ -19,7 +19,7 @@ import { Reveal as y } from "@progress/kendo-react-animation";
19
19
  import { chevronRightIcon as T } from "@progress/kendo-svg-icons";
20
20
  import { Button as x } from "@progress/kendo-react-buttons";
21
21
  const O = (e) => {
22
- const { title: E, subtitle: l, actions: i, images: o, description: v } = e.eventData, [c, k] = t.useState(e.eventData.opened || !1), [r, m] = t.useState(e.eventData.opened || !!e.collapsible), f = (a) => {
22
+ const { title: v, subtitle: l, actions: i, images: o, description: E } = e.eventData, [c, k] = t.useState(e.eventData.opened || !1), [r, m] = t.useState(e.eventData.opened || !!e.collapsible), f = (a) => {
23
23
  if (k(!c), e.onChange) {
24
24
  const n = {
25
25
  syntheticEvent: a,
@@ -28,7 +28,7 @@ const O = (e) => {
28
28
  };
29
29
  e.onChange.call(void 0, n);
30
30
  }
31
- }, C = (a) => {
31
+ }, b = (a) => {
32
32
  if (e.onActionClick) {
33
33
  const n = {
34
34
  syntheticEvent: a,
@@ -37,13 +37,13 @@ const O = (e) => {
37
37
  };
38
38
  e.onActionClick.call(void 0, n);
39
39
  }
40
- }, d = () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(h, null, /* @__PURE__ */ t.createElement("div", { className: "k-card-description" }, /* @__PURE__ */ t.createElement("p", null, v), o && o.map((a, n) => /* @__PURE__ */ t.createElement(I, { key: n, src: a.src })))), i && /* @__PURE__ */ t.createElement(g, null, i.map((a, n) => /* @__PURE__ */ t.createElement(
40
+ }, d = () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(D, null, /* @__PURE__ */ t.createElement("div", { className: "k-card-description" }, /* @__PURE__ */ t.createElement("p", null, E), o && o.map((a, n) => /* @__PURE__ */ t.createElement(I, { key: n, src: a.src })))), i && /* @__PURE__ */ t.createElement(g, null, i.map((a, n) => /* @__PURE__ */ t.createElement(
41
41
  "a",
42
42
  {
43
43
  key: n,
44
44
  href: a.url,
45
45
  className: "k-button k-button-md k-rounded-md k-button-flat k-button-flat-primary",
46
- onClick: C
46
+ onClick: b
47
47
  },
48
48
  a.text
49
49
  ))));
@@ -54,14 +54,15 @@ const O = (e) => {
54
54
  className: u("k-timeline-card", { "k-collapsed": e.collapsible && r })
55
55
  },
56
56
  /* @__PURE__ */ t.createElement(
57
- N,
57
+ C,
58
58
  {
59
- "aria-live": "polite",
59
+ id: e.panelId,
60
+ "aria-label": e.ariaLabel,
61
+ "aria-live": e.horizontal ? void 0 : "polite",
60
62
  "aria-describedby": e.id,
61
- "aria-atomic": "true",
62
63
  tabIndex: e.tabindex,
63
64
  role: e.horizontal ? "tabpanel" : "button",
64
- "aria-expanded": e.collapsible && r,
65
+ "aria-expanded": e.collapsible ? r : void 0,
65
66
  className: "k-card-with-callout",
66
67
  onClick: (a) => f(a)
67
68
  },
@@ -78,7 +79,7 @@ const O = (e) => {
78
79
  )
79
80
  }
80
81
  ),
81
- /* @__PURE__ */ t.createElement("div", { className: "k-card-inner" }, /* @__PURE__ */ t.createElement(b, null, /* @__PURE__ */ t.createElement(A, null, /* @__PURE__ */ t.createElement("span", { className: "k-event-title" }, E), e.collapsible && /* @__PURE__ */ t.createElement(
82
+ /* @__PURE__ */ t.createElement("div", { className: "k-card-inner" }, /* @__PURE__ */ t.createElement(N, null, /* @__PURE__ */ t.createElement(h, null, /* @__PURE__ */ t.createElement("span", { className: "k-event-title" }, v), e.collapsible && /* @__PURE__ */ t.createElement(
82
83
  x,
83
84
  {
84
85
  className: "k-event-collapse",
@@ -86,7 +87,7 @@ const O = (e) => {
86
87
  size: "xs",
87
88
  svgIcon: T
88
89
  }
89
- )), l && /* @__PURE__ */ t.createElement(D, null, l)), e.collapsible ? /* @__PURE__ */ t.createElement(
90
+ )), l && /* @__PURE__ */ t.createElement(A, null, l)), e.collapsible ? /* @__PURE__ */ t.createElement(
90
91
  y,
91
92
  {
92
93
  transitionEnterDuration: e.transitionDuration || 400,
@@ -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 ve=require("react"),he=require("prop-types"),ge=require("./TimelineCard.js"),Te=require("./utils.js"),M=require("@progress/kendo-svg-icons"),ke=require("@progress/kendo-react-intl"),b=require("@progress/kendo-react-common"),B=require("@progress/kendo-react-buttons");function Ee(l){const p=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const h in l)if(h!=="default"){const I=Object.getOwnPropertyDescriptor(l,h);Object.defineProperty(p,h,I.get?I:{enumerable:!0,get:()=>l[h]})}}return p.default=l,Object.freeze(p)}const s=Ee(ve),K=l=>{const I=ke.useInternationalization(),[A,X]=s.useState(!1),[L,Y]=s.useState(!0),[G,J]=s.useState(),[f,D]=s.useState(0),[y,Q]=s.useState(),[u,Z]=s.useState(0),[v,ee]=s.useState(0),[a,F]=s.useState(1),[d,R]=s.useState(),[i,te]=s.useState(),[_,W]=s.useState([0,0,0]),[C,U]=s.useState(0),[ne,se]=s.useState(1),m=s.useRef(null),c=s.useRef(null),P=s.useRef(null),{eventsData:re,dateFormat:ae,navigatable:oe,onActionClick:ce}=l,x=y?`${y}%`:"150px",g=s.useRef(new b.Navigation({tabIndex:0,root:m,selectors:[".k-timeline-scrollable-wrap"]}));s.useEffect(()=>{m.current&&l.navigatable&&(setTimeout(()=>{const e=g.current.first;e&&e.setAttribute("tabindex",String(0))},0),g.current.keyboardEvents={keydown:{ArrowRight:le,ArrowLeft:ue,End:de,Home:fe}})},[l.navigatable,a,u]),s.useEffect(()=>{g.current.update()});const ie=e=>{oe&&g.current&&g.current.triggerKeyboardEvent(e)};s.useEffect(()=>{var r;const e=b.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(w),t=c.current,n=((r=m==null?void 0:m.current)==null?void 0:r.offsetWidth)||0;return e&&t&&e.observe(t),V(),w(),W([n,0,-n]),()=>{e&&e.disconnect()}},[]),s.useEffect(()=>{const e=c.current,t=e&&e.children[a];if(t){const n=t.offsetWidth,r=!(f>=0);if(X(r),i){const o=i.length*n>u*n*((f*-1+100)/100);Y(o)}(e==null?void 0:e.offsetWidth)*-f/100>=e.children.length*n&&(V(),w(),D((t.offsetLeft-t.offsetWidth)/(u*t.offsetWidth)*100*-1)),q(t)}},[u,y,a]);const le=(e,t,n)=>{if(c.current){const r=c.current.children[a+1],o=r&&r.classList.contains("k-timeline-flag-wrap")?a+2:a+1;if(i&&i.length<=o)return;u+v<=o&&j(),k(o,n)}},ue=(e,t,n)=>{if(c.current){const r=c.current&&c.current.children[a-1],o=r&&r.classList.contains("k-timeline-flag-wrap")?a-2:a-1;if(o<=0)return;o<v&&$(),k(o,n)}},fe=(e,t,n)=>{if(c.current){if(a<=1)return;const r=1;N(!0,r,0,0),k(r,n)}},de=(e,t,n)=>{if(c.current){const r=c.current&&c.current.children.length-1;if(r<=a)return;const o=Math.floor(r/u),E=o*-100,O=o*u;N(!0,r,O,E),k(r,n)}},V=()=>{const e=Te.addYearsFlags(re);te(e),R([e[a-1],e[a],e[a+1]])},$=()=>{var t;if(c.current&&i){const n=v-u,r=v-1,o=i[r]&&((t=i[r])!=null&&t.yearFlag)?r-1:r,E=f+100>0?0:f+100;N(!1,o,n,E)}},j=()=>{if(c.current&&i){const t=v+u,n=i[t]&&i[t].yearFlag?t+1:t,r=f-100;N(!0,n,t,r)}},N=(e,t,n,r)=>{S(e,t),w(),ee(n),D(r),F(t)},S=(e,t)=>{if(d&&i){const n=T(e,ne),r=Object.assign([],d,{[n]:i[t]});R(r),se(n),U(e?-100:100),setTimeout(()=>{var H;const o=(H=m.current)==null?void 0:H.offsetWidth,E=Object.assign([],_,{[n]:0,[T(!0,n)]:o,[T(!1,n)]:o&&-o}),O=Object.assign([],r,{[T(!0,n)]:{},[T(!1,n)]:{}});R(O),W(E),U(0)},l.transitionDuration||300)}},T=(e,t)=>{const n=e?t+1:t-1;return d?n<0?d.length-1:n%d.length:0},q=e=>{var n,r;const t=(a-v)*e.offsetWidth+e.offsetWidth/2+(((r=(n=P.current)==null?void 0:n.element)==null?void 0:r.clientWidth)||0);J(t)},k=(e,t)=>{t.preventDefault(),e>a?S(!0,e):e<a&&S(!1,e),F(e)},w=s.useCallback(()=>{const e=c.current,t=e&&e.children[a];if(e instanceof HTMLElement&&t){const n=Math.round(e.offsetWidth/150);q(t),Q(100/n),Z(n)}},[]),me=()=>({transitionDuration:"300ms"}),z=e=>({transform:`translateX(${e}%)`,transformOrigin:"left top"});return s.createElement(s.Fragment,null,s.createElement("div",{className:"k-timeline-track-wrap",ref:m,onKeyDown:ie},s.createElement(B.Button,{ref:P,"aria-hidden":"true",rounded:"full",svgIcon:M.chevronLeftIcon,icon:"chevron-left",onClick:()=>A&&$(),className:b.classNames("k-timeline-arrow","k-timeline-arrow-left",{"k-disabled":!A})}),s.createElement(B.Button,{"aria-hidden":"true",rounded:"full",svgIcon:M.chevronRightIcon,icon:"chevron-right",onClick:()=>L&&j(),className:b.classNames("k-timeline-arrow","k-timeline-arrow-right",{"k-disabled":!L})}),s.createElement("div",{className:"k-timeline-track"},s.createElement("ul",{ref:c,className:"k-timeline-scrollable-wrap",role:"tablist",tabIndex:0,style:{transform:`translateX(${f}%)`}},i&&i.map((e,t)=>e.yearFlag?s.createElement("li",{role:"none",className:"k-timeline-track-item k-timeline-flag-wrap",style:{flex:`1 0 ${x}`},key:t},s.createElement("span",{className:"k-timeline-flag"},e.yearFlag)):s.createElement("li",{role:"tab",className:b.classNames("k-timeline-track-item",{"k-focus":t===a}),"aria-selected":t===a,style:{flex:`1 0 ${x}`},key:t},s.createElement("div",{className:"k-timeline-date-wrap"},s.createElement("span",{className:"k-timeline-date"},I.formatDate(e.date,ae))),s.createElement("span",{onClick:n=>k(t,n),className:"k-timeline-circle"})))))),s.createElement("div",{className:"k-timeline-events-list"},s.createElement("ul",{className:"k-timeline-scrollable-wrap",style:C===0?{...z(C)}:{...z(C),...me()}},d&&d.map((e,t)=>s.createElement("li",{key:t,className:"k-timeline-event",style:{transform:`translate3d(${_[t]}px, 0px, 0px)`}},e&&s.createElement(ge.TimelineCard,{tabindex:_[t]===0?0:-1,eventData:e,onActionClick:ce,horizontal:!0,collapsible:!1,calloutStyle:{left:`${G}px`}}))))))};K.propTypes={onActionClick:he.func};exports.TimelineHorizontal=K;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ve=require("react"),ge=require("prop-types"),Te=require("./TimelineCard.js"),be=require("./utils.js"),X=require("@progress/kendo-svg-icons"),ke=require("@progress/kendo-react-intl"),v=require("@progress/kendo-react-common"),Y=require("@progress/kendo-react-buttons");function Ee(l){const I=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const g in l)if(g!=="default"){const T=Object.getOwnPropertyDescriptor(l,g);Object.defineProperty(I,g,T.get?T:{enumerable:!0,get:()=>l[g]})}}return I.default=l,Object.freeze(I)}const s=Ee(ve),G=l=>{const T=ke.useInternationalization(),[A,J]=s.useState(!1),[O,Q]=s.useState(!0),[Z,ee]=s.useState(),[f,L]=s.useState(0),[y,te]=s.useState(),[u,ne]=s.useState(0),[h,se]=s.useState(0),[a,D]=s.useState(1),[d,R]=s.useState(),[i,re]=s.useState(),[F,W]=s.useState([0,0,0]),[_,U]=s.useState(0),[P,ae]=s.useState(1),V=v.useId(),m=s.useRef(null),c=s.useRef(null),x=s.useRef(null),{eventsData:oe,dateFormat:$,navigatable:ie,onActionClick:ce}=l,j=y?`${y}%`:"150px",b=s.useRef(new v.Navigation({tabIndex:0,root:m,selectors:[".k-timeline-scrollable-wrap"]}));s.useEffect(()=>{m.current&&l.navigatable&&(setTimeout(()=>{const e=b.current.first;e&&e.setAttribute("tabindex",String(0))},0),b.current.keyboardEvents={keydown:{ArrowRight:ue,ArrowLeft:fe,End:me,Home:de}})},[l.navigatable,a,u]),s.useEffect(()=>{b.current.update()});const le=e=>{ie&&b.current&&b.current.triggerKeyboardEvent(e)};s.useEffect(()=>{var r;const e=v.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(w),t=c.current,n=((r=m==null?void 0:m.current)==null?void 0:r.offsetWidth)||0;return e&&t&&e.observe(t),q(),w(),W([n,0,-n]),()=>{e&&e.disconnect()}},[]),s.useEffect(()=>{const e=c.current,t=e&&e.children[a];if(t){const n=t.offsetWidth,r=!(f>=0);if(J(r),i){const o=i.length*n>u*n*((f*-1+100)/100);Q(o)}(e==null?void 0:e.offsetWidth)*-f/100>=e.children.length*n&&(q(),w(),L((t.offsetLeft-t.offsetWidth)/(u*t.offsetWidth)*100*-1)),M(t)}},[u,y,a]);const ue=(e,t,n)=>{if(c.current){const r=c.current.children[a+1],o=r&&r.classList.contains("k-timeline-flag-wrap")?a+2:a+1;if(i&&i.length<=o)return;u+h<=o&&H(),E(o,n)}},fe=(e,t,n)=>{if(c.current){const r=c.current&&c.current.children[a-1],o=r&&r.classList.contains("k-timeline-flag-wrap")?a-2:a-1;if(o<=0)return;o<h&&z(),E(o,n)}},de=(e,t,n)=>{if(c.current){if(a<=1)return;const r=1;N(!0,r,0,0),E(r,n)}},me=(e,t,n)=>{if(c.current){const r=c.current&&c.current.children.length-1;if(r<=a)return;const o=Math.floor(r/u),p=o*-100,S=o*u;N(!0,r,S,p),E(r,n)}},q=()=>{const e=be.addYearsFlags(oe);re(e),R([e[a-1],e[a],e[a+1]])},z=()=>{var t;if(c.current&&i){const n=h-u,r=h-1,o=i[r]&&((t=i[r])!=null&&t.yearFlag)?r-1:r,p=f+100>0?0:f+100;N(!1,o,n,p)}},H=()=>{if(c.current&&i){const t=h+u,n=i[t]&&i[t].yearFlag?t+1:t,r=f-100;N(!0,n,t,r)}},N=(e,t,n,r)=>{C(e,t),w(),se(n),L(r),D(t)},C=(e,t)=>{if(d&&i){const n=k(e,P),r=Object.assign([],d,{[n]:i[t]});R(r),ae(n),U(e?-100:100),setTimeout(()=>{var K;const o=(K=m.current)==null?void 0:K.offsetWidth,p=Object.assign([],F,{[n]:0,[k(!0,n)]:o,[k(!1,n)]:o&&-o}),S=Object.assign([],r,{[k(!0,n)]:{},[k(!1,n)]:{}});R(S),W(p),U(0)},l.transitionDuration||300)}},k=(e,t)=>{const n=e?t+1:t-1;return d?n<0?d.length-1:n%d.length:0},M=e=>{var n,r;const t=(a-h)*e.offsetWidth+e.offsetWidth/2+(((r=(n=x.current)==null?void 0:n.element)==null?void 0:r.clientWidth)||0);ee(t)},E=(e,t)=>{t.preventDefault(),e>a?C(!0,e):e<a&&C(!1,e),D(e)},w=s.useCallback(()=>{const e=c.current,t=e&&e.children[a];if(e instanceof HTMLElement&&t){const n=Math.round(e.offsetWidth/150);M(t),te(100/n),ne(n)}},[]),he=()=>({transitionDuration:"300ms"}),B=e=>({transform:`translateX(${e}%)`,transformOrigin:"left top"});return s.createElement(s.Fragment,null,s.createElement("div",{className:"k-timeline-track-wrap",ref:m,onKeyDown:le},s.createElement(Y.Button,{ref:x,"aria-hidden":"true",rounded:"full",svgIcon:X.chevronLeftIcon,icon:"chevron-left",onClick:()=>A&&z(),className:v.classNames("k-timeline-arrow","k-timeline-arrow-left",{"k-disabled":!A})}),s.createElement(Y.Button,{"aria-hidden":"true",rounded:"full",svgIcon:X.chevronRightIcon,icon:"chevron-right",onClick:()=>O&&H(),className:v.classNames("k-timeline-arrow","k-timeline-arrow-right",{"k-disabled":!O})}),s.createElement("div",{className:"k-timeline-track"},s.createElement("ul",{ref:c,className:"k-timeline-scrollable-wrap",role:"tablist",tabIndex:0,style:{transform:`translateX(${f}%)`}},i==null?void 0:i.map((e,t)=>e.yearFlag?s.createElement("li",{role:"none","aria-hidden":"true",className:"k-timeline-track-item k-timeline-flag-wrap",style:{flex:`1 0 ${j}`},key:t},s.createElement("span",{className:"k-timeline-flag"},e.yearFlag)):s.createElement("li",{role:"tab",className:v.classNames("k-timeline-track-item",{"k-focus":t===a}),"aria-selected":t===a||void 0,"aria-describedby":t===a?V:void 0,style:{flex:`1 0 ${j}`},key:t},s.createElement("div",{className:"k-timeline-date-wrap"},s.createElement("span",{className:"k-timeline-date"},T.formatDate(e.date,$))),s.createElement("span",{onClick:n=>E(t,n),className:"k-timeline-circle"})))))),s.createElement("div",{className:"k-timeline-events-list"},s.createElement("ul",{className:"k-timeline-scrollable-wrap",style:_===0?{...B(_)}:{...B(_),...he()}},d&&d.map((e,t)=>t===P?s.createElement("li",{key:t,className:"k-timeline-event",style:{transform:`translate3d(${F[t]}px, 0px, 0px)`}},e&&s.createElement(Te.TimelineCard,{tabindex:0,panelId:V,eventData:e,ariaLabel:e.date?T.formatDate(e.date,$):void 0,onActionClick:ce,horizontal:!0,collapsible:!1,calloutStyle:{left:`${Z}px`}})):null))))};G.propTypes={onActionClick:ge.func};exports.TimelineHorizontal=G;
@@ -6,16 +6,16 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as s from "react";
9
- import ft from "prop-types";
10
- import { TimelineCard as ut } from "./TimelineCard.mjs";
11
- import { addYearsFlags as mt } from "./utils.mjs";
12
- import { chevronLeftIcon as dt, chevronRightIcon as ht } from "@progress/kendo-svg-icons";
13
- import { useInternationalization as vt } from "@progress/kendo-react-intl";
14
- import { Navigation as Tt, canUseDOM as Et, classNames as _ } from "@progress/kendo-react-common";
15
- import { Button as z } from "@progress/kendo-react-buttons";
16
- const gt = (g) => {
17
- const M = vt(), [y, j] = s.useState(!1), [A, K] = s.useState(!0), [X, Y] = s.useState(), [f, S] = s.useState(0), [b, B] = s.useState(), [l, q] = s.useState(0), [d, G] = s.useState(0), [a, L] = s.useState(1), [u, I] = s.useState(), [c, J] = s.useState(), [w, O] = s.useState([0, 0, 0]), [N, F] = s.useState(0), [Q, Z] = s.useState(1), m = s.useRef(null), i = s.useRef(null), W = s.useRef(null), { eventsData: tt, dateFormat: et, navigatable: nt, onActionClick: st } = g, D = b ? `${b}%` : "150px", h = s.useRef(
18
- new Tt({
9
+ import ut from "prop-types";
10
+ import { TimelineCard as mt } from "./TimelineCard.mjs";
11
+ import { addYearsFlags as dt } from "./utils.mjs";
12
+ import { chevronLeftIcon as ht, chevronRightIcon as vt } from "@progress/kendo-svg-icons";
13
+ import { useInternationalization as Et } from "@progress/kendo-react-intl";
14
+ import { useId as Tt, Navigation as gt, canUseDOM as pt, classNames as C } from "@progress/kendo-react-common";
15
+ import { Button as X } from "@progress/kendo-react-buttons";
16
+ const kt = (g) => {
17
+ const R = Et(), [_, Y] = s.useState(!1), [A, B] = s.useState(!0), [q, G] = s.useState(), [f, S] = s.useState(0), [b, J] = s.useState(), [l, Q] = s.useState(0), [d, Z] = s.useState(0), [a, L] = s.useState(1), [u, I] = s.useState(), [i, tt] = s.useState(), [F, O] = s.useState([0, 0, 0]), [w, W] = s.useState(0), [U, et] = s.useState(1), D = Tt(), m = s.useRef(null), c = s.useRef(null), V = s.useRef(null), { eventsData: nt, dateFormat: x, navigatable: st, onActionClick: rt } = g, P = b ? `${b}%` : "150px", h = s.useRef(
18
+ new gt({
19
19
  tabIndex: 0,
20
20
  root: m,
21
21
  selectors: [".k-timeline-scrollable-wrap"]
@@ -27,156 +27,157 @@ const gt = (g) => {
27
27
  t && t.setAttribute("tabindex", String(0));
28
28
  }, 0), h.current.keyboardEvents = {
29
29
  keydown: {
30
- ArrowRight: at,
31
- ArrowLeft: ot,
32
- End: ct,
33
- Home: it
30
+ ArrowRight: ot,
31
+ ArrowLeft: it,
32
+ End: lt,
33
+ Home: ct
34
34
  }
35
35
  });
36
36
  }, [g.navigatable, a, l]), s.useEffect(() => {
37
37
  h.current.update();
38
38
  });
39
- const rt = (t) => {
40
- nt && h.current && h.current.triggerKeyboardEvent(t);
39
+ const at = (t) => {
40
+ st && h.current && h.current.triggerKeyboardEvent(t);
41
41
  };
42
42
  s.useEffect(() => {
43
43
  var r;
44
- const t = Et && window.ResizeObserver && new window.ResizeObserver(p), e = i.current, n = ((r = m == null ? void 0 : m.current) == null ? void 0 : r.offsetWidth) || 0;
45
- return t && e && t.observe(e), U(), p(), O([n, 0, -n]), () => {
44
+ const t = pt && window.ResizeObserver && new window.ResizeObserver(k), e = c.current, n = ((r = m == null ? void 0 : m.current) == null ? void 0 : r.offsetWidth) || 0;
45
+ return t && e && t.observe(e), $(), k(), O([n, 0, -n]), () => {
46
46
  t && t.disconnect();
47
47
  };
48
48
  }, []), s.useEffect(() => {
49
- const t = i.current, e = t && t.children[a];
49
+ const t = c.current, e = t && t.children[a];
50
50
  if (e) {
51
51
  const n = e.offsetWidth, r = !(f >= 0);
52
- if (j(r), c) {
53
- const o = c.length * n > l * n * ((f * -1 + 100) / 100);
54
- K(o);
52
+ if (Y(r), i) {
53
+ const o = i.length * n > l * n * ((f * -1 + 100) / 100);
54
+ B(o);
55
55
  }
56
- (t == null ? void 0 : t.offsetWidth) * -f / 100 >= t.children.length * n && (U(), p(), S(
56
+ (t == null ? void 0 : t.offsetWidth) * -f / 100 >= t.children.length * n && ($(), k(), S(
57
57
  (e.offsetLeft - e.offsetWidth) / (l * e.offsetWidth) * 100 * -1
58
- )), V(e);
58
+ )), M(e);
59
59
  }
60
60
  }, [l, b, a]);
61
- const at = (t, e, n) => {
62
- if (i.current) {
63
- const r = i.current.children[a + 1], o = r && r.classList.contains("k-timeline-flag-wrap") ? a + 2 : a + 1;
64
- if (c && c.length <= o)
61
+ const ot = (t, e, n) => {
62
+ if (c.current) {
63
+ const r = c.current.children[a + 1], o = r && r.classList.contains("k-timeline-flag-wrap") ? a + 2 : a + 1;
64
+ if (i && i.length <= o)
65
65
  return;
66
- l + d <= o && P(), T(o, n);
66
+ l + d <= o && z(), E(o, n);
67
67
  }
68
- }, ot = (t, e, n) => {
69
- if (i.current) {
70
- const r = i.current && i.current.children[a - 1], o = r && r.classList.contains("k-timeline-flag-wrap") ? a - 2 : a - 1;
68
+ }, it = (t, e, n) => {
69
+ if (c.current) {
70
+ const r = c.current && c.current.children[a - 1], o = r && r.classList.contains("k-timeline-flag-wrap") ? a - 2 : a - 1;
71
71
  if (o <= 0)
72
72
  return;
73
- o < d && x(), T(o, n);
73
+ o < d && H(), E(o, n);
74
74
  }
75
- }, it = (t, e, n) => {
76
- if (i.current) {
75
+ }, ct = (t, e, n) => {
76
+ if (c.current) {
77
77
  if (a <= 1)
78
78
  return;
79
79
  const r = 1;
80
- k(!0, r, 0, 0), T(r, n);
80
+ p(!0, r, 0, 0), E(r, n);
81
81
  }
82
- }, ct = (t, e, n) => {
83
- if (i.current) {
84
- const r = i.current && i.current.children.length - 1;
82
+ }, lt = (t, e, n) => {
83
+ if (c.current) {
84
+ const r = c.current && c.current.children.length - 1;
85
85
  if (r <= a)
86
86
  return;
87
- const o = Math.floor(r / l), E = o * -100, R = o * l;
88
- k(!0, r, R, E), T(r, n);
87
+ const o = Math.floor(r / l), T = o * -100, y = o * l;
88
+ p(!0, r, y, T), E(r, n);
89
89
  }
90
- }, U = () => {
91
- const t = mt(tt);
92
- J(t), I([t[a - 1], t[a], t[a + 1]]);
93
- }, x = () => {
90
+ }, $ = () => {
91
+ const t = dt(nt);
92
+ tt(t), I([t[a - 1], t[a], t[a + 1]]);
93
+ }, H = () => {
94
94
  var e;
95
- if (i.current && c) {
96
- const n = d - l, r = d - 1, o = c[r] && ((e = c[r]) != null && e.yearFlag) ? r - 1 : r, E = f + 100 > 0 ? 0 : f + 100;
97
- k(!1, o, n, E);
95
+ if (c.current && i) {
96
+ const n = d - l, r = d - 1, o = i[r] && ((e = i[r]) != null && e.yearFlag) ? r - 1 : r, T = f + 100 > 0 ? 0 : f + 100;
97
+ p(!1, o, n, T);
98
98
  }
99
- }, P = () => {
100
- if (i.current && c) {
101
- const e = d + l, n = c[e] && c[e].yearFlag ? e + 1 : e, r = f - 100;
102
- k(!0, n, e, r);
99
+ }, z = () => {
100
+ if (c.current && i) {
101
+ const e = d + l, n = i[e] && i[e].yearFlag ? e + 1 : e, r = f - 100;
102
+ p(!0, n, e, r);
103
103
  }
104
- }, k = (t, e, n, r) => {
105
- C(t, e), p(), G(n), S(r), L(e);
106
- }, C = (t, e) => {
107
- if (u && c) {
108
- const n = v(t, Q), r = Object.assign([], u, { [n]: c[e] });
109
- I(r), Z(n), F(t ? -100 : 100), setTimeout(() => {
110
- var H;
111
- const o = (H = m.current) == null ? void 0 : H.offsetWidth, E = Object.assign([], w, {
104
+ }, p = (t, e, n, r) => {
105
+ N(t, e), k(), Z(n), S(r), L(e);
106
+ }, N = (t, e) => {
107
+ if (u && i) {
108
+ const n = v(t, U), r = Object.assign([], u, { [n]: i[e] });
109
+ I(r), et(n), W(t ? -100 : 100), setTimeout(() => {
110
+ var K;
111
+ const o = (K = m.current) == null ? void 0 : K.offsetWidth, T = Object.assign([], F, {
112
112
  [n]: 0,
113
113
  [v(!0, n)]: o,
114
114
  [v(!1, n)]: o && -o
115
- }), R = Object.assign([], r, {
115
+ }), y = Object.assign([], r, {
116
116
  [v(!0, n)]: {},
117
117
  [v(!1, n)]: {}
118
118
  });
119
- I(R), O(E), F(0);
119
+ I(y), O(T), W(0);
120
120
  }, g.transitionDuration || 300);
121
121
  }
122
122
  }, v = (t, e) => {
123
123
  const n = t ? e + 1 : e - 1;
124
124
  return u ? n < 0 ? u.length - 1 : n % u.length : 0;
125
- }, V = (t) => {
125
+ }, M = (t) => {
126
126
  var n, r;
127
- const e = (a - d) * t.offsetWidth + t.offsetWidth / 2 + (((r = (n = W.current) == null ? void 0 : n.element) == null ? void 0 : r.clientWidth) || 0);
128
- Y(e);
129
- }, T = (t, e) => {
130
- e.preventDefault(), t > a ? C(!0, t) : t < a && C(!1, t), L(t);
131
- }, p = s.useCallback(() => {
132
- const t = i.current, e = t && t.children[a];
127
+ const e = (a - d) * t.offsetWidth + t.offsetWidth / 2 + (((r = (n = V.current) == null ? void 0 : n.element) == null ? void 0 : r.clientWidth) || 0);
128
+ G(e);
129
+ }, E = (t, e) => {
130
+ e.preventDefault(), t > a ? N(!0, t) : t < a && N(!1, t), L(t);
131
+ }, k = s.useCallback(() => {
132
+ const t = c.current, e = t && t.children[a];
133
133
  if (t instanceof HTMLElement && e) {
134
134
  const n = Math.round(t.offsetWidth / 150);
135
- V(e), B(100 / n), q(n);
135
+ M(e), J(100 / n), Q(n);
136
136
  }
137
- }, []), lt = () => ({
137
+ }, []), ft = () => ({
138
138
  transitionDuration: "300ms"
139
- }), $ = (t) => ({
139
+ }), j = (t) => ({
140
140
  transform: `translateX(${t}%)`,
141
141
  transformOrigin: "left top"
142
142
  });
143
- return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("div", { className: "k-timeline-track-wrap", ref: m, onKeyDown: rt }, /* @__PURE__ */ s.createElement(
144
- z,
143
+ return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("div", { className: "k-timeline-track-wrap", ref: m, onKeyDown: at }, /* @__PURE__ */ s.createElement(
144
+ X,
145
145
  {
146
- ref: W,
146
+ ref: V,
147
147
  "aria-hidden": "true",
148
148
  rounded: "full",
149
- svgIcon: dt,
149
+ svgIcon: ht,
150
150
  icon: "chevron-left",
151
- onClick: () => y && x(),
152
- className: _("k-timeline-arrow", "k-timeline-arrow-left", { "k-disabled": !y })
151
+ onClick: () => _ && H(),
152
+ className: C("k-timeline-arrow", "k-timeline-arrow-left", { "k-disabled": !_ })
153
153
  }
154
154
  ), /* @__PURE__ */ s.createElement(
155
- z,
155
+ X,
156
156
  {
157
157
  "aria-hidden": "true",
158
158
  rounded: "full",
159
- svgIcon: ht,
159
+ svgIcon: vt,
160
160
  icon: "chevron-right",
161
- onClick: () => A && P(),
162
- className: _("k-timeline-arrow", "k-timeline-arrow-right", { "k-disabled": !A })
161
+ onClick: () => A && z(),
162
+ className: C("k-timeline-arrow", "k-timeline-arrow-right", { "k-disabled": !A })
163
163
  }
164
164
  ), /* @__PURE__ */ s.createElement("div", { className: "k-timeline-track" }, /* @__PURE__ */ s.createElement(
165
165
  "ul",
166
166
  {
167
- ref: i,
167
+ ref: c,
168
168
  className: "k-timeline-scrollable-wrap",
169
169
  role: "tablist",
170
170
  tabIndex: 0,
171
171
  style: { transform: `translateX(${f}%)` }
172
172
  },
173
- c && c.map(
173
+ i == null ? void 0 : i.map(
174
174
  (t, e) => t.yearFlag ? /* @__PURE__ */ s.createElement(
175
175
  "li",
176
176
  {
177
177
  role: "none",
178
+ "aria-hidden": "true",
178
179
  className: "k-timeline-track-item k-timeline-flag-wrap",
179
- style: { flex: `1 0 ${D}` },
180
+ style: { flex: `1 0 ${P}` },
180
181
  key: e
181
182
  },
182
183
  /* @__PURE__ */ s.createElement("span", { className: "k-timeline-flag" }, t.yearFlag)
@@ -184,47 +185,50 @@ const gt = (g) => {
184
185
  "li",
185
186
  {
186
187
  role: "tab",
187
- className: _("k-timeline-track-item", {
188
+ className: C("k-timeline-track-item", {
188
189
  "k-focus": e === a
189
190
  }),
190
- "aria-selected": e === a,
191
- style: { flex: `1 0 ${D}` },
191
+ "aria-selected": e === a || void 0,
192
+ "aria-describedby": e === a ? D : void 0,
193
+ style: { flex: `1 0 ${P}` },
192
194
  key: e
193
195
  },
194
- /* @__PURE__ */ s.createElement("div", { className: "k-timeline-date-wrap" }, /* @__PURE__ */ s.createElement("span", { className: "k-timeline-date" }, M.formatDate(t.date, et))),
195
- /* @__PURE__ */ s.createElement("span", { onClick: (n) => T(e, n), className: "k-timeline-circle" })
196
+ /* @__PURE__ */ s.createElement("div", { className: "k-timeline-date-wrap" }, /* @__PURE__ */ s.createElement("span", { className: "k-timeline-date" }, R.formatDate(t.date, x))),
197
+ /* @__PURE__ */ s.createElement("span", { onClick: (n) => E(e, n), className: "k-timeline-circle" })
196
198
  )
197
199
  )
198
200
  ))), /* @__PURE__ */ s.createElement("div", { className: "k-timeline-events-list" }, /* @__PURE__ */ s.createElement(
199
201
  "ul",
200
202
  {
201
203
  className: "k-timeline-scrollable-wrap",
202
- style: N === 0 ? { ...$(N) } : { ...$(N), ...lt() }
204
+ style: w === 0 ? { ...j(w) } : { ...j(w), ...ft() }
203
205
  },
204
- u && u.map((t, e) => /* @__PURE__ */ s.createElement(
206
+ u && u.map((t, e) => e === U ? /* @__PURE__ */ s.createElement(
205
207
  "li",
206
208
  {
207
209
  key: e,
208
210
  className: "k-timeline-event",
209
- style: { transform: `translate3d(${w[e]}px, 0px, 0px)` }
211
+ style: { transform: `translate3d(${F[e]}px, 0px, 0px)` }
210
212
  },
211
213
  t && /* @__PURE__ */ s.createElement(
212
- ut,
214
+ mt,
213
215
  {
214
- tabindex: w[e] === 0 ? 0 : -1,
216
+ tabindex: 0,
217
+ panelId: D,
215
218
  eventData: t,
216
- onActionClick: st,
219
+ ariaLabel: t.date ? R.formatDate(t.date, x) : void 0,
220
+ onActionClick: rt,
217
221
  horizontal: !0,
218
222
  collapsible: !1,
219
- calloutStyle: { left: `${X}px` }
223
+ calloutStyle: { left: `${q}px` }
220
224
  }
221
225
  )
222
- ))
226
+ ) : null)
223
227
  )));
224
228
  };
225
- gt.propTypes = {
226
- onActionClick: ft.func
229
+ kt.propTypes = {
230
+ onActionClick: ut.func
227
231
  };
228
232
  export {
229
- gt as TimelineHorizontal
233
+ kt as TimelineHorizontal
230
234
  };