@progress/kendo-react-buttons 9.4.0-develop.2 → 9.4.0-develop.20

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 (63) hide show
  1. package/Button.js +1 -1
  2. package/Button.mjs +17 -18
  3. package/ButtonGroup.js +1 -1
  4. package/ButtonGroup.mjs +9 -10
  5. package/Chip/Chip.js +1 -1
  6. package/Chip/Chip.mjs +0 -1
  7. package/Chip/ChipList.js +1 -1
  8. package/Chip/ChipList.mjs +0 -1
  9. package/Chip/chip-list-contexts.js +1 -1
  10. package/Chip/chip-list-contexts.mjs +6 -7
  11. package/Chip/data-reducer.js +1 -1
  12. package/Chip/data-reducer.mjs +0 -1
  13. package/Chip/focus-reducer.js +1 -1
  14. package/Chip/focus-reducer.mjs +0 -1
  15. package/Chip/selection-reducer.js +1 -1
  16. package/Chip/selection-reducer.mjs +2 -3
  17. package/FloatingActionButton/FloatingActionButton.js +1 -1
  18. package/FloatingActionButton/FloatingActionButton.mjs +0 -1
  19. package/FloatingActionButton/FloatingActionButtonItem.js +1 -1
  20. package/FloatingActionButton/FloatingActionButtonItem.mjs +6 -7
  21. package/FloatingActionButton/utils.js +1 -1
  22. package/FloatingActionButton/utils.mjs +0 -1
  23. package/ListButton/ButtonItem.js +1 -1
  24. package/ListButton/ButtonItem.mjs +3 -4
  25. package/ListButton/DropDownButton.js +1 -1
  26. package/ListButton/DropDownButton.mjs +0 -1
  27. package/ListButton/DropDownButtonItem.js +1 -1
  28. package/ListButton/DropDownButtonItem.mjs +4 -5
  29. package/ListButton/SplitButton.js +1 -1
  30. package/ListButton/SplitButton.mjs +0 -1
  31. package/ListButton/SplitButtonItem.js +1 -1
  32. package/ListButton/SplitButtonItem.mjs +0 -1
  33. package/ListButton/utils/navigation.js +1 -1
  34. package/ListButton/utils/navigation.mjs +8 -9
  35. package/ListButton/utils/popup.js +1 -1
  36. package/ListButton/utils/popup.mjs +5 -6
  37. package/NOTICE.txt +40 -51
  38. package/dist/cdn/js/kendo-react-buttons.js +8 -1
  39. package/index.d.mts +49 -1
  40. package/index.d.ts +49 -1
  41. package/index.js +2 -1
  42. package/index.mjs +2 -2
  43. package/package-metadata.js +1 -1
  44. package/package-metadata.mjs +2 -3
  45. package/package.json +4 -4
  46. package/toolbar/Toolbar.js +1 -1
  47. package/toolbar/Toolbar.mjs +146 -93
  48. package/toolbar/messages/index.js +8 -0
  49. package/toolbar/messages/index.mjs +18 -0
  50. package/toolbar/tools/ToolbarItem.js +1 -1
  51. package/toolbar/tools/ToolbarItem.mjs +5 -6
  52. package/toolbar/tools/ToolbarOverflowSection.js +8 -0
  53. package/toolbar/tools/ToolbarOverflowSection.mjs +67 -0
  54. package/toolbar/tools/ToolbarScrollButton.js +8 -0
  55. package/toolbar/tools/ToolbarScrollButton.mjs +49 -0
  56. package/toolbar/tools/ToolbarScrollable.js +8 -0
  57. package/toolbar/tools/ToolbarScrollable.mjs +39 -0
  58. package/toolbar/tools/ToolbarSeparator.js +1 -1
  59. package/toolbar/tools/ToolbarSeparator.mjs +3 -4
  60. package/toolbar/tools/ToolbarSpacer.js +1 -1
  61. package/toolbar/tools/ToolbarSpacer.mjs +12 -13
  62. package/util.js +1 -1
  63. package/util.mjs +0 -1
package/index.d.mts CHANGED
@@ -2016,10 +2016,54 @@ export declare interface ToolbarItemProps extends KendoReactComponentBaseProps {
2016
2016
  style?: React_2.CSSProperties;
2017
2017
  }
2018
2018
 
2019
+ /**
2020
+ * @hidden
2021
+ */
2022
+ export declare interface ToolbarOverflowProps {
2023
+ /**
2024
+ * Represents the possible overflow mode options of the Toolbar.
2025
+ * Applicable when there is not enough space to render all tools.
2026
+ *
2027
+ * @default `section`
2028
+ */
2029
+ overflow?: 'none' | 'section' | 'scroll';
2030
+ /**
2031
+ * Determines the Toolbar scroll buttons visibility.
2032
+ * Applicable when the overflow property is set to `scroll`.
2033
+ *
2034
+ * @default `auto`
2035
+ */
2036
+ scrollButtons?: 'hidden' | 'visible' | 'auto';
2037
+ /**
2038
+ * Determines the Toolbar scroll buttons position.
2039
+ * Applicable when the overflow property is set to `scroll`.
2040
+ *
2041
+ * @default `split`
2042
+ */
2043
+ scrollButtonsPosition?: 'start' | 'end' | 'split';
2044
+ /**
2045
+ * Sets the Toolbar scroll speed in pixels when scrolling via clicking the previous or next button.
2046
+ * Applicable when the overflow property is set to `scroll`.
2047
+ *
2048
+ * @default 100
2049
+ */
2050
+ buttonScrollSpeed?: number;
2051
+ /**
2052
+ * Defines the custom component that will be rendered as a previous button.
2053
+ * To remove the button, set a function which returns null `() => null`.
2054
+ */
2055
+ prevButton?: React.ComponentType;
2056
+ /**
2057
+ * Defines the custom component that will be rendered as a next button.
2058
+ * To remove the button, set a function which returns null `() => null`.
2059
+ */
2060
+ nextButton?: React.ComponentType;
2061
+ }
2062
+
2019
2063
  /**
2020
2064
  * Represents the props of the [KendoReact Toolbar component]({% slug overview_toolbar %}).
2021
2065
  */
2022
- export declare interface ToolbarProps extends KendoReactComponentBaseProps {
2066
+ export declare interface ToolbarProps extends KendoReactComponentBaseProps, ToolbarOverflowProps {
2023
2067
  /**
2024
2068
  * Sets additional classes to the Toolbar.
2025
2069
  */
@@ -2123,6 +2167,10 @@ declare interface ToolbarSeparatorProps {
2123
2167
  * Sets additional classes to the ToolbarSeparator component.
2124
2168
  */
2125
2169
  className?: string;
2170
+ /**
2171
+ * @hidden
2172
+ */
2173
+ _ref?: React_2.Ref<HTMLDivElement>;
2126
2174
  }
2127
2175
 
2128
2176
  /**
package/index.d.ts CHANGED
@@ -2016,10 +2016,54 @@ export declare interface ToolbarItemProps extends KendoReactComponentBaseProps {
2016
2016
  style?: React_2.CSSProperties;
2017
2017
  }
2018
2018
 
2019
+ /**
2020
+ * @hidden
2021
+ */
2022
+ export declare interface ToolbarOverflowProps {
2023
+ /**
2024
+ * Represents the possible overflow mode options of the Toolbar.
2025
+ * Applicable when there is not enough space to render all tools.
2026
+ *
2027
+ * @default `section`
2028
+ */
2029
+ overflow?: 'none' | 'section' | 'scroll';
2030
+ /**
2031
+ * Determines the Toolbar scroll buttons visibility.
2032
+ * Applicable when the overflow property is set to `scroll`.
2033
+ *
2034
+ * @default `auto`
2035
+ */
2036
+ scrollButtons?: 'hidden' | 'visible' | 'auto';
2037
+ /**
2038
+ * Determines the Toolbar scroll buttons position.
2039
+ * Applicable when the overflow property is set to `scroll`.
2040
+ *
2041
+ * @default `split`
2042
+ */
2043
+ scrollButtonsPosition?: 'start' | 'end' | 'split';
2044
+ /**
2045
+ * Sets the Toolbar scroll speed in pixels when scrolling via clicking the previous or next button.
2046
+ * Applicable when the overflow property is set to `scroll`.
2047
+ *
2048
+ * @default 100
2049
+ */
2050
+ buttonScrollSpeed?: number;
2051
+ /**
2052
+ * Defines the custom component that will be rendered as a previous button.
2053
+ * To remove the button, set a function which returns null `() => null`.
2054
+ */
2055
+ prevButton?: React.ComponentType;
2056
+ /**
2057
+ * Defines the custom component that will be rendered as a next button.
2058
+ * To remove the button, set a function which returns null `() => null`.
2059
+ */
2060
+ nextButton?: React.ComponentType;
2061
+ }
2062
+
2019
2063
  /**
2020
2064
  * Represents the props of the [KendoReact Toolbar component]({% slug overview_toolbar %}).
2021
2065
  */
2022
- export declare interface ToolbarProps extends KendoReactComponentBaseProps {
2066
+ export declare interface ToolbarProps extends KendoReactComponentBaseProps, ToolbarOverflowProps {
2023
2067
  /**
2024
2068
  * Sets additional classes to the Toolbar.
2025
2069
  */
@@ -2123,6 +2167,10 @@ declare interface ToolbarSeparatorProps {
2123
2167
  * Sets additional classes to the ToolbarSeparator component.
2124
2168
  */
2125
2169
  className?: string;
2170
+ /**
2171
+ * @hidden
2172
+ */
2173
+ _ref?: React_2.Ref<HTMLDivElement>;
2126
2174
  }
2127
2175
 
2128
2176
  /**
package/index.js CHANGED
@@ -5,4 +5,5 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./Button.js"),i=require("./ButtonGroup.js"),t=require("./ListButton/SplitButton.js"),a=require("./ListButton/SplitButtonItem.js"),o=require("./ListButton/DropDownButton.js"),p=require("./ListButton/DropDownButtonItem.js"),l=require("./toolbar/Toolbar.js"),B=require("./toolbar/tools/ToolbarItem.js"),c=require("./toolbar/tools/ToolbarSeparator.js"),s=require("./toolbar/tools/ToolbarSpacer.js"),D=require("./util.js"),m=require("./Chip/Chip.js"),S=require("./Chip/ChipList.js"),b=require("./FloatingActionButton/FloatingActionButton.js"),q=require("./FloatingActionButton/FloatingActionButtonItem.js"),n=require("@progress/kendo-react-common"),r=n.withIdHOC(o.DropDownButton);r.displayName="KendoReactDropDownButton";const e=n.withIdHOC(t.SplitButton);e.displayName="KendoReactSplitButton";exports.Button=u.Button;exports.ButtonGroup=i.ButtonGroup;exports.SplitButtonClassComponent=t.SplitButton;exports.SplitButtonItem=a.SplitButtonItem;exports.DropDownButtonClassComponent=o.DropDownButton;exports.DropDownButtonItem=p.DropDownButtonItem;exports.Toolbar=l.Toolbar;exports.ToolbarItem=B.ToolbarItem;exports.ToolbarSeparator=c.ToolbarSeparator;exports.ToolbarSpacer=s.ToolbarSpacer;exports.toolbarButtons=D.toolbarButtons;exports.Chip=m.Chip;exports.ChipList=S.ChipList;exports.FloatingActionButton=b.FloatingActionButton;exports.FloatingActionButtonItem=q.FloatingActionButtonItem;exports.DropDownButton=r;exports.SplitButton=e;
8
+ "use client";
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./Button.js"),i=require("./ButtonGroup.js"),t=require("./ListButton/SplitButton.js"),a=require("./ListButton/SplitButtonItem.js"),o=require("./ListButton/DropDownButton.js"),p=require("./ListButton/DropDownButtonItem.js"),l=require("./toolbar/Toolbar.js"),B=require("./toolbar/tools/ToolbarItem.js"),c=require("./toolbar/tools/ToolbarSeparator.js"),s=require("./toolbar/tools/ToolbarSpacer.js"),D=require("./util.js"),m=require("./Chip/Chip.js"),S=require("./Chip/ChipList.js"),b=require("./FloatingActionButton/FloatingActionButton.js"),q=require("./FloatingActionButton/FloatingActionButtonItem.js"),n=require("@progress/kendo-react-common"),r=n.withIdHOC(o.DropDownButton);r.displayName="KendoReactDropDownButton";const e=n.withIdHOC(t.SplitButton);e.displayName="KendoReactSplitButton";exports.Button=u.Button;exports.ButtonGroup=i.ButtonGroup;exports.SplitButtonClassComponent=t.SplitButton;exports.SplitButtonItem=a.SplitButtonItem;exports.DropDownButtonClassComponent=o.DropDownButton;exports.DropDownButtonItem=p.DropDownButtonItem;exports.Toolbar=l.Toolbar;exports.ToolbarItem=B.ToolbarItem;exports.ToolbarSeparator=c.ToolbarSeparator;exports.ToolbarSpacer=s.ToolbarSpacer;exports.toolbarButtons=D.toolbarButtons;exports.Chip=m.Chip;exports.ChipList=S.ChipList;exports.FloatingActionButton=b.FloatingActionButton;exports.FloatingActionButtonItem=q.FloatingActionButtonItem;exports.DropDownButton=r;exports.SplitButton=e;
package/index.mjs CHANGED
@@ -11,7 +11,7 @@ import { ButtonGroup as f } from "./ButtonGroup.mjs";
11
11
  import { SplitButton as t } from "./ListButton/SplitButton.mjs";
12
12
  import { SplitButtonItem as x } from "./ListButton/SplitButtonItem.mjs";
13
13
  import { DropDownButton as r } from "./ListButton/DropDownButton.mjs";
14
- import { DropDownButtonItem as c } from "./ListButton/DropDownButtonItem.mjs";
14
+ import { DropDownButtonItem as S } from "./ListButton/DropDownButtonItem.mjs";
15
15
  import { Toolbar as w } from "./toolbar/Toolbar.mjs";
16
16
  import { ToolbarItem as b } from "./toolbar/tools/ToolbarItem.mjs";
17
17
  import { ToolbarSeparator as I } from "./toolbar/tools/ToolbarSeparator.mjs";
@@ -37,7 +37,7 @@ export {
37
37
  N as ChipList,
38
38
  p as DropDownButton,
39
39
  r as DropDownButtonClassComponent,
40
- c as DropDownButtonItem,
40
+ S as DropDownButtonItem,
41
41
  $ as FloatingActionButton,
42
42
  H as FloatingActionButtonItem,
43
43
  n as SplitButton,
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1737713685,version:"9.4.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1738846682,version:"9.4.0-develop.20",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
@@ -5,14 +5,13 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";
9
8
  const e = {
10
9
  name: "@progress/kendo-react-buttons",
11
10
  productName: "KendoReact",
12
11
  productCode: "KENDOUIREACT",
13
12
  productCodes: ["KENDOUIREACT"],
14
- publishDate: 1737713685,
15
- version: "9.4.0-develop.2",
13
+ publishDate: 1738846682,
14
+ version: "9.4.0-develop.20",
16
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
17
16
  };
18
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-buttons",
3
- "version": "9.4.0-develop.2",
3
+ "version": "9.4.0-develop.20",
4
4
  "description": "All you need in React Button in one package: disabled/enabled states, built-in styles and more. KendoReact Buttons package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,8 +26,8 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.3.4",
29
- "@progress/kendo-react-common": "9.4.0-develop.2",
30
- "@progress/kendo-react-popup": "9.4.0-develop.2",
29
+ "@progress/kendo-react-common": "9.4.0-develop.20",
30
+ "@progress/kendo-react-popup": "9.4.0-develop.20",
31
31
  "@progress/kendo-svg-icons": "^4.0.0",
32
32
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
33
33
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
@@ -53,7 +53,7 @@
53
53
  "package": {
54
54
  "productName": "KendoReact",
55
55
  "productCode": "KENDOUIREACT",
56
- "publishDate": 1737713685,
56
+ "publishDate": 1738846682,
57
57
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
58
58
  }
59
59
  },
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("react"),c=require("prop-types"),a=require("@progress/kendo-react-common"),P=require("../util.js"),W=require("../package-metadata.js");function A(o){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const i in o)if(i!=="default"){const d=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(f,i,d.get?d:{enumerable:!0,get:()=>o[i]})}}return f.default=o,Object.freeze(f)}const r=A(H),I=r.forwardRef((o,f)=>{a.validatePackage(W.packageMetadata);const{children:i,className:d,id:q,ariaLabel:S,keyboardNavigation:h,role:M,onResize:x,dir:T,style:C,tabIndex:z=p.tabIndex,size:k=p.size,fillMode:v=p.fillMode}=o,w=r.useRef(!1),n=r.useRef(null),b=r.useRef(0),y=r.useRef(0),s=r.useRef([]),m=r.useMemo(()=>o.buttons||P.toolbarButtons,[o.buttons]),N=r.useMemo(()=>m.map(e=>e+":focus").join(","),[m]),K=()=>{const e=n.current&&n.current.querySelector(N);return Math.max(0,s.current.findIndex(u=>u===e))},R=r.useRef({element:null,props:o});r.useImperativeHandle(R,()=>({element:n.current,props:o})),r.useImperativeHandle(f,()=>R.current),r.useEffect(()=>(window.addEventListener("resize",j),n.current&&(y.current=n.current.offsetWidth,b.current=n.current.offsetHeight,h!==!1&&(s.current=Array.from(n.current.querySelectorAll(m.join(","))),O(0))),()=>{window.removeEventListener("resize",j),s.current.length=0}),[]),r.useEffect(()=>{if(w.current){if(!n.current||h===!1)return;s.current=Array.from(n.current.querySelectorAll(m.join(","))),O(K())}else w.current=!0});const O=e=>{s.current.forEach((u,t)=>{u.tabIndex=t===e?z:-1})},E=e=>{const u=e.keyCode===a.Keys.left||e.keyCode===a.Keys.right||e.keyCode===a.Keys.home||e.keyCode===a.Keys.end,t=K();!u||e.defaultPrevented||s.current.findIndex(l=>l===e.target)===-1||(e.keyCode===a.Keys.left?g(t,t===0?s.current.length-1:t-1):g(t,t===s.current.length-1?0:t+1),e.keyCode===a.Keys.home&&g(t,0),e.keyCode===a.Keys.end&&g(t,s.current.length-1))},g=(e,u)=>{const t=s.current[u];if(t){t.tabIndex=z,t.focus();const l=s.current[e];l&&(l.tabIndex=-1)}},j=e=>{if(!n.current)return;const u=n.current.offsetWidth,t=n.current.offsetHeight;if(y.current!==u||b.current!==t){y.current=u,b.current=t;const l={offsetWidth:y.current,offsetHeight:b.current};x&&x.call(void 0,{target:R.current,...l,nativeEvent:e})}};return r.createElement("div",{id:q,"aria-label":S,className:a.classNames("k-toolbar",{[`k-toolbar-${a.kendoThemeMaps.sizeMap[k]||k}`]:k,[`k-toolbar-${v}`]:v},d),style:C,role:M!==void 0?M||void 0:"toolbar",dir:T,ref:n,onKeyDown:h!==!1?E:void 0},i)}),p={tabIndex:0,size:"medium",fillMode:"solid"};I.displayName="KendoReactToolbar";I.propTypes={tabIndex:c.number,dir:c.string,keyboardNavigation:c.bool,style:c.object,className:c.string,role:c.string,onResize:c.func,buttons:c.arrayOf(c.string.isRequired),size:c.oneOf([null,"small","medium","large"]),fillMode:c.oneOf([null,"solid","flat","outline"])};exports.Toolbar=I;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),n=require("prop-types"),i=require("@progress/kendo-react-common"),Y=require("../util.js"),Z=require("../package-metadata.js"),ee=require("./tools/ToolbarScrollable.js"),te=require("./tools/ToolbarOverflowSection.js");function oe(l){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const a in l)if(a!=="default"){const y=Object.getOwnPropertyDescriptor(l,a);Object.defineProperty(b,a,y.get?y:{enumerable:!0,get:()=>l[a]})}}return b.default=l,Object.freeze(b)}const t=oe(X),E=t.forwardRef((l,b)=>{i.validatePackage(Z.packageMetadata);const{children:a,className:y,id:N,ariaLabel:A,keyboardNavigation:R,role:P,onResize:x,style:D,tabIndex:B=d.tabIndex,size:h=d.size,fillMode:p=d.fillMode,overflow:u,scrollButtons:m=d.scrollButtons,scrollButtonsPosition:_=d.scrollButtonsPosition,buttonScrollSpeed:$=d.buttonScrollSpeed,prevButton:F,nextButton:G}=l,M=t.useRef(!1),r=t.useRef(null),S=t.useRef(null),g=t.useRef(0),v=t.useRef(0),c=t.useRef([]),I=t.useRef({element:null,props:l}),[J,Q]=t.useState(!1),[T,z]=t.useState(!0),[W,q]=t.useState(!1),k=i.useDir(r,l.dir),w=t.useMemo(()=>l.buttons||Y.toolbarButtons,[l.buttons]),U=t.useMemo(()=>w.map(e=>e+":focus").join(","),[w]),K=()=>{const e=r.current&&r.current.querySelector(U);return Math.max(0,c.current.findIndex(s=>s===e))};t.useImperativeHandle(I,()=>({element:r.current,props:l})),t.useImperativeHandle(b,()=>I.current),t.useEffect(()=>(window.addEventListener("resize",H),r.current&&(v.current=r.current.offsetWidth,g.current=r.current.offsetHeight,R!==!1&&(c.current=Array.from(r.current.querySelectorAll(w.join(","))),j(0))),()=>{window.removeEventListener("resize",H),c.current.length=0}),[]),t.useEffect(()=>{if(M.current){if(!r.current||R===!1)return;c.current=Array.from(r.current.querySelectorAll(w.join(","))),j(K()),L()}else M.current=!0});const j=e=>{c.current.forEach((s,o)=>{s.tabIndex=o===e?B:-1})},V=e=>{const s=e.keyCode===i.Keys.left||e.keyCode===i.Keys.right||e.keyCode===i.Keys.home||e.keyCode===i.Keys.end,o=K();!s||e.defaultPrevented||c.current.findIndex(f=>f===e.target)===-1||(e.keyCode===i.Keys.left?O(o,o===0?c.current.length-1:o-1):O(o,o===c.current.length-1?0:o+1),e.keyCode===i.Keys.home&&O(o,0),e.keyCode===i.Keys.end&&O(o,c.current.length-1))},O=(e,s)=>{const o=c.current[s];if(o){o.tabIndex=B,o.focus();const f=c.current[e];f&&(f.tabIndex=-1)}},H=e=>{if(!r.current)return;const s=r.current.offsetWidth,o=r.current.offsetHeight;if(v.current!==s||g.current!==o){v.current=s,g.current=o;const f={offsetWidth:v.current,offsetHeight:g.current};x&&x.call(void 0,{target:I.current,...f,nativeEvent:e})}L()},L=t.useCallback(()=>{const e=S.current;e&&Q(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)},[]),C=t.useCallback(()=>{const e=S.current;if(e){const s=e.scrollLeft===0,o=k!=="rtl"?e.scrollLeft+e.clientWidth===e.scrollWidth:e.clientWidth-e.scrollLeft===e.scrollWidth;s&&z(!0),o&&q(!0),!s&&!o&&(z(!1),q(!1))}},[k]);return t.useEffect(()=>{const e=S.current;if(e)return e.addEventListener("scroll",C),()=>{e.removeEventListener("scroll",C)}},[C]),t.createElement("div",{id:N,"aria-label":A,className:i.classNames("k-toolbar",{[`k-toolbar-${i.kendoThemeMaps.sizeMap[h]||h}`]:h,[`k-toolbar-${p}`]:p,"k-toolbar-scrollable":u==="scroll","k-toolbar-scrollable-overlay":u==="scroll"&&(m==="hidden"||m===void 0),"k-toolbar-scrollable-start":u==="scroll"&&m==="hidden"&&T,"k-toolbar-scrollable-end":u==="scroll"&&m==="hidden"&&W,"k-toolbar-section":l.overflow&&u==="section"},y),style:D,role:P!==void 0?P||void 0:"toolbar",dir:k,ref:r,onKeyDown:R!==!1?V:void 0},u==="scroll"&&t.createElement(ee.ToolbarScrollable,{scrollButtons:m,scrollButtonsPosition:_,prevButton:F,nextButton:G,isOverflowing:J,scrollContentRef:S,buttonScrollSpeed:$,dir:k,isScrollStartPosition:T,isScrollEndPosition:W,children:a}),u==="section"&&t.createElement(te.ToolbarOverflowSection,{toolbarRef:r,fillMode:p,size:h},a),(u==="none"||u===void 0)&&a)}),d={tabIndex:0,size:"medium",fillMode:"solid",scrollButtons:"auto",scrollButtonsPosition:"split",buttonScrollSpeed:100};E.displayName="KendoReactToolbar";E.propTypes={tabIndex:n.number,dir:n.string,keyboardNavigation:n.bool,style:n.object,className:n.string,role:n.string,onResize:n.func,buttons:n.arrayOf(n.string.isRequired),size:n.oneOf([null,"small","medium","large"]),fillMode:n.oneOf([null,"solid","flat","outline"]),overflow:n.oneOf(["none","section","scroll"]),scrollButtons:n.oneOf(["hidden","visible","auto"]),scrollButtonsPosition:n.oneOf(["start","end","split"]),buttonScrollSpeed:n.number};exports.Toolbar=E;
@@ -5,123 +5,176 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";
9
- import * as r from "react";
10
- import s from "prop-types";
11
- import { validatePackage as j, classNames as q, kendoThemeMaps as A, Keys as u } from "@progress/kendo-react-common";
12
- import { toolbarButtons as B } from "../util.mjs";
13
- import { packageMetadata as P } from "../package-metadata.mjs";
14
- const v = r.forwardRef((a, C) => {
15
- j(P);
8
+ import * as t from "react";
9
+ import n from "prop-types";
10
+ import { validatePackage as Y, useDir as Z, classNames as _, kendoThemeMaps as ee, Keys as u } from "@progress/kendo-react-common";
11
+ import { toolbarButtons as te } from "../util.mjs";
12
+ import { packageMetadata as oe } from "../package-metadata.mjs";
13
+ import { ToolbarScrollable as re } from "./tools/ToolbarScrollable.mjs";
14
+ import { ToolbarOverflowSection as ne } from "./tools/ToolbarOverflowSection.mjs";
15
+ const N = t.forwardRef((i, A) => {
16
+ Y(oe);
16
17
  const {
17
- children: E,
18
- className: H,
19
- id: N,
20
- ariaLabel: T,
21
- keyboardNavigation: b,
22
- role: k,
23
- onResize: x,
24
- dir: W,
25
- style: K,
26
- tabIndex: I = h.tabIndex,
27
- size: y = h.size,
28
- fillMode: R = h.fillMode
29
- } = a, p = r.useRef(!1), n = r.useRef(null), f = r.useRef(0), l = r.useRef(0), o = r.useRef([]), d = r.useMemo(() => a.buttons || B, [a.buttons]), O = r.useMemo(() => d.map((e) => e + ":focus").join(","), [d]), z = () => {
30
- const e = n.current && n.current.querySelector(O);
18
+ children: k,
19
+ className: K,
20
+ id: j,
21
+ ariaLabel: q,
22
+ keyboardNavigation: p,
23
+ role: x,
24
+ onResize: E,
25
+ style: D,
26
+ tabIndex: B = f.tabIndex,
27
+ size: b = f.size,
28
+ fillMode: w = f.fillMode,
29
+ overflow: c,
30
+ scrollButtons: d = f.scrollButtons,
31
+ scrollButtonsPosition: $ = f.scrollButtonsPosition,
32
+ buttonScrollSpeed: F = f.buttonScrollSpeed,
33
+ prevButton: G,
34
+ nextButton: J
35
+ } = i, C = t.useRef(!1), r = t.useRef(null), m = t.useRef(null), h = t.useRef(0), S = t.useRef(0), s = t.useRef([]), I = t.useRef({ element: null, props: i }), [Q, U] = t.useState(!1), [O, P] = t.useState(!0), [W, z] = t.useState(!1), g = Z(r, i.dir), y = t.useMemo(() => i.buttons || te, [i.buttons]), V = t.useMemo(() => y.map((e) => e + ":focus").join(","), [y]), M = () => {
36
+ const e = r.current && r.current.querySelector(V);
31
37
  return Math.max(
32
38
  0,
33
- o.current.findIndex((c) => c === e)
39
+ s.current.findIndex((l) => l === e)
34
40
  );
35
- }, g = r.useRef({ element: null, props: a });
36
- r.useImperativeHandle(
37
- g,
41
+ };
42
+ t.useImperativeHandle(
43
+ I,
38
44
  () => ({
39
- element: n.current,
40
- props: a
45
+ element: r.current,
46
+ props: i
41
47
  })
42
- ), r.useImperativeHandle(C, () => g.current), r.useEffect(() => (window.addEventListener("resize", w), n.current && (l.current = n.current.offsetWidth, f.current = n.current.offsetHeight, b !== !1 && (o.current = Array.from(
43
- n.current.querySelectorAll(d.join(","))
44
- ), M(0))), () => {
45
- window.removeEventListener("resize", w), o.current.length = 0;
46
- }), []), r.useEffect(() => {
47
- if (p.current) {
48
- if (!n.current || b === !1)
48
+ ), t.useImperativeHandle(A, () => I.current), t.useEffect(() => (window.addEventListener("resize", L), r.current && (S.current = r.current.offsetWidth, h.current = r.current.offsetHeight, p !== !1 && (s.current = Array.from(
49
+ r.current.querySelectorAll(y.join(","))
50
+ ), H(0))), () => {
51
+ window.removeEventListener("resize", L), s.current.length = 0;
52
+ }), []), t.useEffect(() => {
53
+ if (C.current) {
54
+ if (!r.current || p === !1)
49
55
  return;
50
- o.current = Array.from(
51
- n.current.querySelectorAll(d.join(","))
52
- ), M(z());
56
+ s.current = Array.from(
57
+ r.current.querySelectorAll(y.join(","))
58
+ ), H(M()), T();
53
59
  } else
54
- p.current = !0;
60
+ C.current = !0;
55
61
  });
56
- const M = (e) => {
57
- o.current.forEach((c, t) => {
58
- c.tabIndex = t === e ? I : -1;
62
+ const H = (e) => {
63
+ s.current.forEach((l, o) => {
64
+ l.tabIndex = o === e ? B : -1;
59
65
  });
60
- }, S = (e) => {
61
- const c = e.keyCode === u.left || e.keyCode === u.right || e.keyCode === u.home || e.keyCode === u.end, t = z();
62
- !c || e.defaultPrevented || o.current.findIndex((i) => i === e.target) === -1 || (e.keyCode === u.left ? m(
63
- t,
64
- t === 0 ? o.current.length - 1 : t - 1
65
- ) : m(
66
- t,
67
- t === o.current.length - 1 ? 0 : t + 1
68
- ), e.keyCode === u.home && m(t, 0), e.keyCode === u.end && m(t, o.current.length - 1));
69
- }, m = (e, c) => {
70
- const t = o.current[c];
71
- if (t) {
72
- t.tabIndex = I, t.focus();
73
- const i = o.current[e];
74
- i && (i.tabIndex = -1);
66
+ }, X = (e) => {
67
+ const l = e.keyCode === u.left || e.keyCode === u.right || e.keyCode === u.home || e.keyCode === u.end, o = M();
68
+ !l || e.defaultPrevented || s.current.findIndex((a) => a === e.target) === -1 || (e.keyCode === u.left ? v(
69
+ o,
70
+ o === 0 ? s.current.length - 1 : o - 1
71
+ ) : v(
72
+ o,
73
+ o === s.current.length - 1 ? 0 : o + 1
74
+ ), e.keyCode === u.home && v(o, 0), e.keyCode === u.end && v(o, s.current.length - 1));
75
+ }, v = (e, l) => {
76
+ const o = s.current[l];
77
+ if (o) {
78
+ o.tabIndex = B, o.focus();
79
+ const a = s.current[e];
80
+ a && (a.tabIndex = -1);
75
81
  }
76
- }, w = (e) => {
77
- if (!n.current)
82
+ }, L = (e) => {
83
+ if (!r.current)
78
84
  return;
79
- const c = n.current.offsetWidth, t = n.current.offsetHeight;
80
- if (l.current !== c || f.current !== t) {
81
- l.current = c, f.current = t;
82
- const i = { offsetWidth: l.current, offsetHeight: f.current };
83
- x && x.call(void 0, { target: g.current, ...i, nativeEvent: e });
85
+ const l = r.current.offsetWidth, o = r.current.offsetHeight;
86
+ if (S.current !== l || h.current !== o) {
87
+ S.current = l, h.current = o;
88
+ const a = { offsetWidth: S.current, offsetHeight: h.current };
89
+ E && E.call(void 0, { target: I.current, ...a, nativeEvent: e });
84
90
  }
85
- };
86
- return /* @__PURE__ */ r.createElement(
91
+ T();
92
+ }, T = t.useCallback(() => {
93
+ const e = m.current;
94
+ e && U(
95
+ e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight
96
+ );
97
+ }, []), R = t.useCallback(() => {
98
+ const e = m.current;
99
+ if (e) {
100
+ const l = e.scrollLeft === 0, o = g !== "rtl" ? e.scrollLeft + e.clientWidth === e.scrollWidth : e.clientWidth - e.scrollLeft === e.scrollWidth;
101
+ l && P(!0), o && z(!0), !l && !o && (P(!1), z(!1));
102
+ }
103
+ }, [g]);
104
+ return t.useEffect(() => {
105
+ const e = m.current;
106
+ if (e)
107
+ return e.addEventListener("scroll", R), () => {
108
+ e.removeEventListener("scroll", R);
109
+ };
110
+ }, [R]), /* @__PURE__ */ t.createElement(
87
111
  "div",
88
112
  {
89
- id: N,
90
- "aria-label": T,
91
- className: q(
113
+ id: j,
114
+ "aria-label": q,
115
+ className: _(
92
116
  "k-toolbar",
93
117
  {
94
- [`k-toolbar-${A.sizeMap[y] || y}`]: y,
95
- [`k-toolbar-${R}`]: R
118
+ [`k-toolbar-${ee.sizeMap[b] || b}`]: b,
119
+ [`k-toolbar-${w}`]: w,
120
+ "k-toolbar-scrollable": c === "scroll",
121
+ "k-toolbar-scrollable-overlay": c === "scroll" && (d === "hidden" || d === void 0),
122
+ "k-toolbar-scrollable-start": c === "scroll" && d === "hidden" && O,
123
+ "k-toolbar-scrollable-end": c === "scroll" && d === "hidden" && W,
124
+ "k-toolbar-section": i.overflow && c === "section"
96
125
  },
97
- H
126
+ K
98
127
  ),
99
- style: K,
100
- role: k !== void 0 ? k || void 0 : "toolbar",
101
- dir: W,
102
- ref: n,
103
- onKeyDown: b !== !1 ? S : void 0
128
+ style: D,
129
+ role: x !== void 0 ? x || void 0 : "toolbar",
130
+ dir: g,
131
+ ref: r,
132
+ onKeyDown: p !== !1 ? X : void 0
104
133
  },
105
- E
134
+ c === "scroll" && /* @__PURE__ */ t.createElement(
135
+ re,
136
+ {
137
+ scrollButtons: d,
138
+ scrollButtonsPosition: $,
139
+ prevButton: G,
140
+ nextButton: J,
141
+ isOverflowing: Q,
142
+ scrollContentRef: m,
143
+ buttonScrollSpeed: F,
144
+ dir: g,
145
+ isScrollStartPosition: O,
146
+ isScrollEndPosition: W,
147
+ children: k
148
+ }
149
+ ),
150
+ c === "section" && /* @__PURE__ */ t.createElement(ne, { toolbarRef: r, fillMode: w, size: b }, k),
151
+ (c === "none" || c === void 0) && k
106
152
  );
107
- }), h = {
153
+ }), f = {
108
154
  tabIndex: 0,
109
155
  size: "medium",
110
- fillMode: "solid"
156
+ fillMode: "solid",
157
+ scrollButtons: "auto",
158
+ scrollButtonsPosition: "split",
159
+ buttonScrollSpeed: 100
111
160
  };
112
- v.displayName = "KendoReactToolbar";
113
- v.propTypes = {
114
- tabIndex: s.number,
115
- dir: s.string,
116
- keyboardNavigation: s.bool,
117
- style: s.object,
118
- className: s.string,
119
- role: s.string,
120
- onResize: s.func,
121
- buttons: s.arrayOf(s.string.isRequired),
122
- size: s.oneOf([null, "small", "medium", "large"]),
123
- fillMode: s.oneOf([null, "solid", "flat", "outline"])
161
+ N.displayName = "KendoReactToolbar";
162
+ N.propTypes = {
163
+ tabIndex: n.number,
164
+ dir: n.string,
165
+ keyboardNavigation: n.bool,
166
+ style: n.object,
167
+ className: n.string,
168
+ role: n.string,
169
+ onResize: n.func,
170
+ buttons: n.arrayOf(n.string.isRequired),
171
+ size: n.oneOf([null, "small", "medium", "large"]),
172
+ fillMode: n.oneOf([null, "solid", "flat", "outline"]),
173
+ overflow: n.oneOf(["none", "section", "scroll"]),
174
+ scrollButtons: n.oneOf(["hidden", "visible", "auto"]),
175
+ scrollButtonsPosition: n.oneOf(["start", "end", "split"]),
176
+ buttonScrollSpeed: n.number
124
177
  };
125
178
  export {
126
- v as Toolbar
179
+ N as Toolbar
127
180
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="prevArrow.title",e="nextArrow.title",o="moreButtonTitle.title",r={[t]:"Previous scroll button",[e]:"Next scroll button",[o]:"More button"};exports.messages=r;exports.moreButtonTitle=o;exports.nextArrowTitle=e;exports.prevArrowTitle=t;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ const t = "prevArrow.title", o = "nextArrow.title", e = "moreButtonTitle.title", r = {
9
+ [t]: "Previous scroll button",
10
+ [o]: "Next scroll button",
11
+ [e]: "More button"
12
+ };
13
+ export {
14
+ r as messages,
15
+ e as moreButtonTitle,
16
+ o as nextArrowTitle,
17
+ t as prevArrowTitle
18
+ };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),u=require("prop-types"),m=require("@progress/kendo-react-common");function d(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=d(i),a=n.forwardRef((e,r)=>{const{id:t,className:o,style:s,children:l}=e,c=n.useRef(null);return n.useImperativeHandle(r,()=>({element:c.current})),n.createElement("div",{id:t,className:m.classNames("k-toolbar-item",o),style:s,ref:c},l)});a.displayName="KendoReactToolbarItem";a.propTypes={className:u.string};exports.ToolbarItem=a;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),u=require("prop-types"),m=require("@progress/kendo-react-common");function d(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=d(i),a=n.forwardRef((e,r)=>{const{id:t,className:o,style:s,children:l}=e,c=n.useRef(null);return n.useImperativeHandle(r,()=>({element:c.current})),n.createElement("div",{id:t,className:m.classNames("k-toolbar-item",o),style:s,ref:c},l)});a.displayName="KendoReactToolbarItem";a.propTypes={className:u.string};exports.ToolbarItem=a;
@@ -5,18 +5,17 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";
9
8
  import * as e from "react";
10
9
  import c from "prop-types";
11
- import { classNames as i } from "@progress/kendo-react-common";
12
- const t = e.forwardRef((s, a) => {
13
- const { id: o, className: m, style: l, children: n } = s, r = e.useRef(null);
10
+ import { classNames as p } from "@progress/kendo-react-common";
11
+ const t = e.forwardRef((a, o) => {
12
+ const { id: s, className: m, style: l, children: n } = a, r = e.useRef(null);
14
13
  return e.useImperativeHandle(
15
- a,
14
+ o,
16
15
  () => ({
17
16
  element: r.current
18
17
  })
19
- ), /* @__PURE__ */ e.createElement("div", { id: o, className: i("k-toolbar-item", m), style: l, ref: r }, n);
18
+ ), /* @__PURE__ */ e.createElement("div", { id: s, className: p("k-toolbar-item", m), style: l, ref: r }, n);
20
19
  });
21
20
  t.displayName = "KendoReactToolbarItem";
22
21
  t.propTypes = {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("@progress/kendo-react-popup"),O=require("react"),q=require("./ToolbarSeparator.js"),M=require("../../Button.js"),P=require("@progress/kendo-svg-icons"),W=require("@progress/kendo-react-intl"),m=require("../messages/index.js"),I=require("@progress/kendo-react-common");function j(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const u=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,u.get?u:{enumerable:!0,get:()=>n[s]})}}return t.default=n,Object.freeze(t)}const e=j(O),_=n=>{var h;const{toolbarRef:t,children:s,fillMode:u,size:R}=n,[b,k]=e.useState(!1),a=e.useRef(e.Children.toArray(s).filter(r=>e.isValidElement(r)).map((r,i)=>e.cloneElement(r,{key:r.key||i}))),c=e.useRef([]),f=e.useRef(0),w=e.useRef(null),T=e.useRef(null),S=W.useLocalization(),[B,v]=e.useReducer(r=>r+1,0),d=()=>{if(!t.current)return;let r=0;const i=t.current.clientWidth,p=parseInt(window.getComputedStyle(t.current).gap||"0",10),E=Array.from(t.current.children).reduce((o,l,L)=>(o+=Math.ceil(l.clientWidth),o),0),g=Array.from(t.current.children).length,z=p*2;if(r=E+g*p+z,r>i){const o=[...a.current],l=o.pop();f.current=i,a.current=o,l&&(c.current=[l,...c.current])}else if(i>f.current+p*g){const o=[...c.current],l=o.shift();c.current=o,l&&(a.current=[...a.current,l]),f.current=i}v()};e.useEffect(()=>(d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)),[]);const y=()=>{k(!b)};return e.createElement(e.Fragment,null,a.current.length>0&&a.current,c.current.length>0&&e.createElement(e.Fragment,null,e.createElement(q.ToolbarSeparator,{_ref:T,className:"k-toolbar-button-separator"}),e.createElement(M.Button,{ref:w,className:"k-toolbar-overflow-button",fillMode:"flat",svgIcon:P.moreHorizontalIcon,title:S.toLanguageString(m.moreButtonTitle,m.messages[m.moreButtonTitle]),onClick:y}),e.createElement(C.Popup,{anchor:t.current,show:b,popupClass:"k-toolbar-popup",style:{width:(h=t.current)==null?void 0:h.offsetWidth}},e.createElement("span",{className:`k-toolbar-items-list k-toolbar-items-list-${I.kendoThemeMaps.sizeMap[R]} k-toolbar-items-list-${u}`},c.current.length>0&&c.current))))};exports.ToolbarOverflowSection=_;