@progress/kendo-react-layout 10.2.0-develop.1 → 10.2.0-develop.10

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.
@@ -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 Q=require("react"),m=require("prop-types"),V=require("@progress/kendo-react-animation"),x=require("@progress/kendo-react-common"),K=require("./ActionSheetItem.js"),H=require("./ActionSheetHeader.js"),W=require("./ActionSheetFooter.js"),X=require("./ActionSheetContent.js");function Y(e){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const d=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(u,r,d.get?d:{enumerable:!0,get:()=>e[r]})}}return u.default=e,Object.freeze(u)}const n=Y(Q),C=n.forwardRef((e,u)=>{var q,_;const{navigatableElements:r=S.navigatableElements,navigatable:d=S.navigatable,position:F=S.position,animationDuration:o=300,prefixActions:D,suffixActions:I,filter:O}=e,L=(t,i,a)=>{a.preventDefault(),a.shiftKey?i.focusPrevious(t):i.focusNext(t)},M=(t,i,a)=>{if(t.ariaDisabled)return;const E=t.className&&t.className.indexOf?t.className.indexOf("k-actionsheet-item")!==-1:!1,v=i.elements.filter(c=>c.className.indexOf("k-actionsheet-item")!==-1);if(E&&e.onItemClick){a.preventDefault();const c=e.items[v.indexOf(t)];e.onItemClick.call(void 0,{syntheticEvent:a,item:c,title:c&&c.title})}if(E&&e.onItemSelect){a.preventDefault();const c=e.items[v.indexOf(t)];e.onItemSelect.call(void 0,{syntheticEvent:a,item:c,title:c&&c.title})}e.animation||f()},$=(t,i,a)=>{e.onOverlayClick&&(a.preventDefault(),e.onOverlayClick.call(void 0,a)),e.onClose&&(a.preventDefault(),e.onClose.call(void 0,a)),e.animation||f()},f=()=>{h({show:!1})},B=t=>{d&&b.current.triggerKeyboardEvent(t)},z=t=>{e.onOverlayClick&&e.onOverlayClick.call(void 0,t),e.onClose&&e.onClose.call(void 0,t),e.animation||f()},R=t=>{e.onItemClick&&e.onItemClick.call(void 0,t),e.onItemSelect&&e.onItemSelect.call(void 0,t),e.animation||f()},U=t=>{const i={};return n.Children.forEach(t,a=>{a&&(i[a.type.displayName]=a)}),i},w=n.useRef(null),N=n.useRef(null);n.useImperativeHandle(w,()=>({props:e})),n.useImperativeHandle(u,()=>w.current);const b=n.useRef(),g=n.useRef({bottom:"0",width:"100%"}),A=n.useRef(),[l,G]=n.useState({show:!1,slide:!1}),h=t=>{G(i=>({...i,...t}))};n.useEffect(()=>{e.expand&&!l.show&&h({show:!0})},[]),n.useEffect(()=>{const t=N.current;if(e.expand&&!l.show&&h({show:!0}),e.expand&&l.show&&!l.slide&&h({slide:!0}),!e.expand&&l.show&&l.slide&&h({slide:!1}),A!==l&&l.slide&&t&&!e.className&&(t.style.setProperty("--kendo-actionsheet-height","auto"),t.style.setProperty("--kendo-actionsheet-max-height","none")),t&&d){const a=[".k-actionsheet-item",...[".k-actionsheet-footer",".k-actionsheet-content",".k-actionsheet-titlebar"].map(E=>x.FOCUSABLE_ELEMENTS.concat(r).map(v=>`${E} ${v}`)).flat()];b.current=new x.Navigation({tabIndex:e.tabIndex||0,root:N,rovingTabIndex:!1,selectors:a,keyboardEvents:{keydown:{Tab:L,Enter:M,Escape:$}}}),b.current.focusElement(b.current.first,null)}A.current={...l}});const T="k-actionsheet-title",P=T,s=(q=e.items)==null?void 0:q.filter(t=>!t.group||t.group==="top"),k=(_=e.items)==null?void 0:_.filter(t=>t.group==="bottom"),J=s&&s.length>0&&k&&k.length>0,y=U(e.children),j=l.slide&&n.createElement("div",{className:x.classNames(`k-actionsheet k-actionsheet-${F}`,e.className),role:"dialog","aria-modal":"true","aria-hidden":!1,"aria-labelledby":P,ref:N,onKeyDown:B},y[H.headerDisplayName]&&!e.title&&!e.subTitle&&y[H.headerDisplayName],(e.title||e.subTitle)&&n.createElement("div",{className:"k-actionsheet-titlebar"},n.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},D&&n.createElement("div",{className:"k-actionsheet-actions"},D),n.createElement("div",{className:T,id:P},n.createElement("div",{className:"k-text-center"},e.title),e.subTitle&&n.createElement("div",{className:"k-actionsheet-subtitle k-text-center"},e.subTitle)),I&&n.createElement("div",{className:"k-actionsheet-actions"},I)),O&&n.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},O)),y[X.contentDisplayName]||n.createElement("div",{className:"k-actionsheet-content"},n.createElement("div",{className:"k-list-ul",role:"group"},s&&s.map((t,i)=>n.createElement(K.ActionSheetItem,{...t,id:i,key:i,item:t,tabIndex:e.tabIndex||0,onClick:R})),J&&n.createElement("hr",{className:"k-hr"}),k&&k.map((t,i)=>n.createElement(K.ActionSheetItem,{...t,id:i+((s==null?void 0:s.length)||0),key:i,item:t,tabIndex:e.tabIndex||0,onClick:R})))),y[W.footerDisplayName]);return n.createElement(n.Fragment,null,e.expand||l.show?n.createElement("div",{className:"k-actionsheet-container"},n.createElement("div",{className:"k-overlay",onClick:z}),e.animation?n.createElement(V.Animation,{transitionName:l.slide?"slide-up":"slide-down",onExited:f,transitionEnterDuration:typeof o=="object"&&Object.keys(o).length>0&&o.openDuration?Number(o.openDuration):Number(o),transitionExitDuration:typeof o=="object"&&Object.keys(o).length>0&&o.closeDuration?Number(o.closeDuration):Number(o),animationEnteringStyle:e.animationStyles||g.current,animationEnteredStyle:e.animationStyles||g.current,animationExitingStyle:e.animationStyles||g.current,exit:!0,enter:!0,appear:!1},j):j):null)}),S={navigatable:!0,navigatableElements:[],position:"bottom"};C.propTypes={items:m.array,subTitle:m.string,title:m.string,navigatable:m.bool,navigatableElements:m.array,position:m.oneOf(["top","bottom","left","right","fullscreen"])};C.displayName="KendoReactActionSheet";exports.ActionSheet=C;exports.actionSheetDefaultProps=S;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("react"),m=require("prop-types"),V=require("@progress/kendo-react-animation"),x=require("@progress/kendo-react-common"),K=require("./ActionSheetItem.js"),H=require("./ActionSheetHeader.js"),W=require("./ActionSheetFooter.js"),X=require("./ActionSheetContent.js");function Y(e){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const d=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(u,r,d.get?d:{enumerable:!0,get:()=>e[r]})}}return u.default=e,Object.freeze(u)}const n=Y(Q),C=n.forwardRef((e,u)=>{var q,_;const{navigatableElements:r=S.navigatableElements,navigatable:d=S.navigatable,position:F=S.position,animationDuration:o=300,prefixActions:D,suffixActions:I,filter:O}=e,L=(t,i,a)=>{a.preventDefault(),a.shiftKey?i.focusPrevious(t):i.focusNext(t)},M=(t,i,a)=>{if(t.ariaDisabled)return;const v=t.className&&t.className.indexOf?t.className.indexOf("k-actionsheet-item")!==-1:!1,E=i.elements.filter(c=>c.className.indexOf("k-actionsheet-item")!==-1);if(v&&e.onItemClick){a.preventDefault();const c=e.items[E.indexOf(t)];e.onItemClick.call(void 0,{syntheticEvent:a,item:c,title:c&&c.title})}if(v&&e.onItemSelect){a.preventDefault();const c=e.items[E.indexOf(t)];e.onItemSelect.call(void 0,{syntheticEvent:a,item:c,title:c&&c.title})}e.animation||f()},$=(t,i,a)=>{e.onOverlayClick&&(a.preventDefault(),e.onOverlayClick.call(void 0,a)),e.onClose&&(a.preventDefault(),e.onClose.call(void 0,a)),e.animation||f()},f=()=>{h({show:!1})},B=t=>{d&&b.current.triggerKeyboardEvent(t)},z=t=>{e.onOverlayClick&&e.onOverlayClick.call(void 0,t),e.onClose&&e.onClose.call(void 0,t),e.animation||f()},R=t=>{e.onItemClick&&e.onItemClick.call(void 0,t),e.onItemSelect&&e.onItemSelect.call(void 0,t),e.animation||f()},U=t=>{const i={};return n.Children.forEach(t,a=>{a&&(i[a.type.displayName]=a)}),i},w=n.useRef(null),N=n.useRef(null);n.useImperativeHandle(w,()=>({props:e})),n.useImperativeHandle(u,()=>w.current);const b=n.useRef(void 0),g=n.useRef({bottom:"0",width:"100%"}),A=n.useRef(void 0),[l,G]=n.useState({show:!1,slide:!1}),h=t=>{G(i=>({...i,...t}))};n.useEffect(()=>{e.expand&&!l.show&&h({show:!0})},[]),n.useEffect(()=>{const t=N.current;if(e.expand&&!l.show&&h({show:!0}),e.expand&&l.show&&!l.slide&&h({slide:!0}),!e.expand&&l.show&&l.slide&&h({slide:!1}),A!==l&&l.slide&&t&&!e.className&&(t.style.setProperty("--kendo-actionsheet-height","auto"),t.style.setProperty("--kendo-actionsheet-max-height","none")),t&&d){const a=[".k-actionsheet-item",...[".k-actionsheet-footer",".k-actionsheet-content",".k-actionsheet-titlebar"].map(v=>x.FOCUSABLE_ELEMENTS.concat(r).map(E=>`${v} ${E}`)).flat()];b.current=new x.Navigation({tabIndex:e.tabIndex||0,root:N,rovingTabIndex:!1,selectors:a,keyboardEvents:{keydown:{Tab:L,Enter:M,Escape:$}}}),b.current.focusElement(b.current.first,null)}A.current={...l}});const T="k-actionsheet-title",P=T,s=(q=e.items)==null?void 0:q.filter(t=>!t.group||t.group==="top"),k=(_=e.items)==null?void 0:_.filter(t=>t.group==="bottom"),J=s&&s.length>0&&k&&k.length>0,y=U(e.children),j=l.slide&&n.createElement("div",{className:x.classNames(`k-actionsheet k-actionsheet-${F}`,e.className),role:"dialog","aria-modal":"true","aria-hidden":!1,"aria-labelledby":P,ref:N,onKeyDown:B},y[H.headerDisplayName]&&!e.title&&!e.subTitle&&y[H.headerDisplayName],(e.title||e.subTitle)&&n.createElement("div",{className:"k-actionsheet-titlebar"},n.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},D&&n.createElement("div",{className:"k-actionsheet-actions"},D),n.createElement("div",{className:T,id:P},n.createElement("div",{className:"k-text-center"},e.title),e.subTitle&&n.createElement("div",{className:"k-actionsheet-subtitle k-text-center"},e.subTitle)),I&&n.createElement("div",{className:"k-actionsheet-actions"},I)),O&&n.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},O)),y[X.contentDisplayName]||n.createElement("div",{className:"k-actionsheet-content"},n.createElement("div",{className:"k-list-ul",role:"group"},s&&s.map((t,i)=>n.createElement(K.ActionSheetItem,{...t,id:i,key:i,item:t,tabIndex:e.tabIndex||0,onClick:R})),J&&n.createElement("hr",{className:"k-hr"}),k&&k.map((t,i)=>n.createElement(K.ActionSheetItem,{...t,id:i+((s==null?void 0:s.length)||0),key:i,item:t,tabIndex:e.tabIndex||0,onClick:R})))),y[W.footerDisplayName]);return n.createElement(n.Fragment,null,e.expand||l.show?n.createElement("div",{className:"k-actionsheet-container"},n.createElement("div",{className:"k-overlay",onClick:z}),e.animation?n.createElement(V.Animation,{transitionName:l.slide?"slide-up":"slide-down",onExited:f,transitionEnterDuration:typeof o=="object"&&Object.keys(o).length>0&&o.openDuration?Number(o.openDuration):Number(o),transitionExitDuration:typeof o=="object"&&Object.keys(o).length>0&&o.closeDuration?Number(o.closeDuration):Number(o),animationEnteringStyle:e.animationStyles||g.current,animationEnteredStyle:e.animationStyles||g.current,animationExitingStyle:e.animationStyles||g.current,exit:!0,enter:!0,appear:!1},j):j):null)}),S={navigatable:!0,navigatableElements:[],position:"bottom"};C.propTypes={items:m.array,subTitle:m.string,title:m.string,navigatable:m.bool,navigatableElements:m.array,position:m.oneOf(["top","bottom","left","right","fullscreen"])};C.displayName="KendoReactActionSheet";exports.ActionSheet=C;exports.actionSheetDefaultProps=S;
@@ -68,7 +68,7 @@ const j = n.forwardRef((e, _) => {
68
68
  _,
69
69
  () => I.current
70
70
  );
71
- const d = n.useRef(), v = n.useRef({ bottom: "0", width: "100%" }), D = n.useRef(), [l, z] = n.useState({ show: !1, slide: !1 }), f = (t) => {
71
+ const d = n.useRef(void 0), v = n.useRef({ bottom: "0", width: "100%" }), D = n.useRef(void 0), [l, z] = n.useState({ show: !1, slide: !1 }), f = (t) => {
72
72
  z((i) => ({ ...i, ...t }));
73
73
  };
74
74
  n.useEffect(() => {