@progress/kendo-react-layout 11.0.0-develop.9 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actionsheet/ActionSheet.js +1 -1
- package/actionsheet/ActionSheet.mjs +24 -24
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/index.d.mts +4 -2
- package/index.d.ts +4 -2
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/tilelayout/InternalTile.js +1 -1
- package/tilelayout/InternalTile.mjs +109 -86
- package/tilelayout/TileLayout.js +1 -1
- package/tilelayout/TileLayout.mjs +61 -48
|
@@ -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"),d=require("prop-types"),W=require("@progress/kendo-react-animation"),I=require("@progress/kendo-react-common"),K=require("./ActionSheetItem.js"),F=require("./ActionSheetHeader.js"),X=require("./ActionSheetFooter.js"),Y=require("./ActionSheetContent.js"),H=require("./ActionSheetView.js");function Z(e){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const m in e)if(m!=="default"){const h=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(f,m,h.get?h:{enumerable:!0,get:()=>e[m]})}}return f.default=e,Object.freeze(f)}const n=Z(Q),w=n.forwardRef((e,f)=>{var q,_;const{navigatableElements:m=N.navigatableElements,navigatable:h=N.navigatable,position:V=N.position,animationDuration:o=300,prefixActions:g,suffixActions:x,filter:D}=e,L=(t,i,a)=>{a.preventDefault(),a.shiftKey?i.focusPrevious(t):i.focusNext(t)},M=(t,i,a)=>{if(t.ariaDisabled)return;const c=t.className&&t.className.indexOf?t.className.indexOf("k-actionsheet-item")!==-1:!1,S=i.elements.filter(s=>s.className.indexOf("k-actionsheet-item")!==-1);if(c&&e.onItemClick){a.preventDefault();const s=e.items[S.indexOf(t)];e.onItemClick.call(void 0,{syntheticEvent:a,item:s,title:s&&s.title})}if(c&&e.onItemSelect){a.preventDefault();const s=e.items[S.indexOf(t)];e.onItemSelect.call(void 0,{syntheticEvent:a,item:s,title:s&&s.title})}e.animation||b()},$=(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||b()},b=()=>{y({show:!1})},B=t=>{h&&E.current.triggerKeyboardEvent(t)},z=t=>{e.onOverlayClick&&e.onOverlayClick.call(void 0,t),e.onClose&&e.onClose.call(void 0,t),e.animation||b()},A=t=>{e.onItemClick&&e.onItemClick.call(void 0,t),e.onItemSelect&&e.onItemSelect.call(void 0,t),e.animation||b()},U=t=>{const i={},a=[];return n.Children.forEach(t,c=>{c&&(c.type.displayName===H.ActionSheetViewDisplayName?a.push(c):i[c.type.displayName]=c)}),a.length>0?a:i},O=n.useRef(null),k=n.useRef(null);n.useImperativeHandle(O,()=>({props:e,element:k.current})),n.useImperativeHandle(f,()=>O.current);const E=n.useRef(void 0),C=n.useRef({bottom:"0",width:"100%"}),R=n.useRef(void 0),[l,G]=n.useState({show:!1,slide:!1}),y=t=>{G(i=>({...i,...t}))};n.useEffect(()=>{e.expand&&!l.show&&y({show:!0})},[]),n.useEffect(()=>{const t=k.current;if(e.expand&&!l.show&&y({show:!0}),e.expand&&l.show&&!l.slide&&y({slide:!0}),!e.expand&&l.show&&l.slide&&y({slide:!1}),R!==l&&l.slide&&t&&!e.className&&(t.style.setProperty("--kendo-actionsheet-height","auto"),t.style.setProperty("--kendo-actionsheet-max-height","none")),t&&h){const a=[".k-actionsheet-item",...[".k-actionsheet-footer",".k-actionsheet-content",".k-actionsheet-view",".k-actionsheet-titlebar"].map(c=>I.FOCUSABLE_ELEMENTS.concat(m).map(S=>`${c} ${S}`)).flat()];E.current=new I.Navigation({tabIndex:e.tabIndex||0,root:k,rovingTabIndex:!1,selectors:a,keyboardEvents:{keydown:{Tab:L,Enter:M,Escape:$}}}),E.current.focusElement(E.current.first,null)}R.current={...l}});const T="k-actionsheet-title",P=T,r=(q=e.items)==null?void 0:q.filter(t=>!t.group||t.group==="top"),v=(_=e.items)==null?void 0:_.filter(t=>t.group==="bottom"),J=r&&r.length>0&&v&&v.length>0,u=U(e.children),j=l.slide&&n.createElement("div",{className:I.classNames(`k-actionsheet k-actionsheet-${V}`,e.className),role:"dialog","aria-modal":"true",style:e.style,"aria-hidden":!1,"aria-labelledby":P,ref:k,onKeyDown:B},Array.isArray(u)?n.createElement(n.Fragment,null,u.map(t=>t)):n.createElement(H.ActionSheetView,null,u[F.headerDisplayName]&&!e.title&&!e.subTitle&&u[F.headerDisplayName],(e.title||e.subTitle||g||x||D)&&n.createElement("div",{className:"k-actionsheet-titlebar"},n.createElement("div",{className:"k-actionsheet-titlebar-group"},g&&n.createElement("div",{className:"k-actionsheet-actions"},g),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)),x&&n.createElement("div",{className:"k-actionsheet-actions"},x)),D&&n.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},D)),u[Y.contentDisplayName]||n.createElement("div",{className:"k-actionsheet-content"},n.createElement("div",{className:"k-list-ul",role:"group"},r&&r.map((t,i)=>n.createElement(K.ActionSheetItem,{...t,id:i,key:i,item:t,tabIndex:e.tabIndex||0,onClick:A})),J&&n.createElement("hr",{className:"k-hr"}),v&&v.map((t,i)=>n.createElement(K.ActionSheetItem,{...t,id:i+((r==null?void 0:r.length)||0),key:i,item:t,tabIndex:e.tabIndex||0,onClick:A})))),u[X.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(W.Animation,{transitionName:l.slide?"slide-up":"slide-down",onExited:b,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||C.current,animationEnteredStyle:e.animationStyles||C.current,animationExitingStyle:e.animationStyles||C.current,exit:!0,enter:!0,appear:!1},j):j):null)}),N={navigatable:!0,navigatableElements:[],position:"bottom"};w.propTypes={items:d.array,subTitle:d.
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("react"),d=require("prop-types"),W=require("@progress/kendo-react-animation"),I=require("@progress/kendo-react-common"),K=require("./ActionSheetItem.js"),F=require("./ActionSheetHeader.js"),X=require("./ActionSheetFooter.js"),Y=require("./ActionSheetContent.js"),H=require("./ActionSheetView.js");function Z(e){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const m in e)if(m!=="default"){const h=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(f,m,h.get?h:{enumerable:!0,get:()=>e[m]})}}return f.default=e,Object.freeze(f)}const n=Z(Q),w=n.forwardRef((e,f)=>{var q,_;const{navigatableElements:m=N.navigatableElements,navigatable:h=N.navigatable,position:V=N.position,animationDuration:o=300,prefixActions:g,suffixActions:x,filter:D}=e,L=(t,i,a)=>{a.preventDefault(),a.shiftKey?i.focusPrevious(t):i.focusNext(t)},M=(t,i,a)=>{if(t.ariaDisabled)return;const c=t.className&&t.className.indexOf?t.className.indexOf("k-actionsheet-item")!==-1:!1,S=i.elements.filter(s=>s.className.indexOf("k-actionsheet-item")!==-1);if(c&&e.onItemClick){a.preventDefault();const s=e.items[S.indexOf(t)];e.onItemClick.call(void 0,{syntheticEvent:a,item:s,title:s&&s.title})}if(c&&e.onItemSelect){a.preventDefault();const s=e.items[S.indexOf(t)];e.onItemSelect.call(void 0,{syntheticEvent:a,item:s,title:s&&s.title})}e.animation||b()},$=(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||b()},b=()=>{y({show:!1})},B=t=>{h&&E.current.triggerKeyboardEvent(t)},z=t=>{e.onOverlayClick&&e.onOverlayClick.call(void 0,t),e.onClose&&e.onClose.call(void 0,t),e.animation||b()},A=t=>{e.onItemClick&&e.onItemClick.call(void 0,t),e.onItemSelect&&e.onItemSelect.call(void 0,t),e.animation||b()},U=t=>{const i={},a=[];return n.Children.forEach(t,c=>{c&&(c.type.displayName===H.ActionSheetViewDisplayName?a.push(c):i[c.type.displayName]=c)}),a.length>0?a:i},O=n.useRef(null),k=n.useRef(null);n.useImperativeHandle(O,()=>({props:e,element:k.current})),n.useImperativeHandle(f,()=>O.current);const E=n.useRef(void 0),C=n.useRef({bottom:"0",width:"100%"}),R=n.useRef(void 0),[l,G]=n.useState({show:!1,slide:!1}),y=t=>{G(i=>({...i,...t}))};n.useEffect(()=>{e.expand&&!l.show&&y({show:!0})},[]),n.useEffect(()=>{const t=k.current;if(e.expand&&!l.show&&y({show:!0}),e.expand&&l.show&&!l.slide&&y({slide:!0}),!e.expand&&l.show&&l.slide&&y({slide:!1}),R!==l&&l.slide&&t&&!e.className&&(t.style.setProperty("--kendo-actionsheet-height","auto"),t.style.setProperty("--kendo-actionsheet-max-height","none")),t&&h){const a=[".k-actionsheet-item",...[".k-actionsheet-footer",".k-actionsheet-content",".k-actionsheet-view",".k-actionsheet-titlebar"].map(c=>I.FOCUSABLE_ELEMENTS.concat(m).map(S=>`${c} ${S}`)).flat()];E.current=new I.Navigation({tabIndex:e.tabIndex||0,root:k,rovingTabIndex:!1,selectors:a,keyboardEvents:{keydown:{Tab:L,Enter:M,Escape:$}}}),E.current.focusElement(E.current.first,null)}R.current={...l}});const T="k-actionsheet-title",P=T,r=(q=e.items)==null?void 0:q.filter(t=>!t.group||t.group==="top"),v=(_=e.items)==null?void 0:_.filter(t=>t.group==="bottom"),J=r&&r.length>0&&v&&v.length>0,u=U(e.children),j=l.slide&&n.createElement("div",{className:I.classNames(`k-actionsheet k-actionsheet-${V}`,e.className),role:"dialog","aria-modal":"true",style:e.style,"aria-hidden":!1,"aria-labelledby":P,ref:k,onKeyDown:B},Array.isArray(u)?n.createElement(n.Fragment,null,u.map(t=>t)):n.createElement(H.ActionSheetView,null,u[F.headerDisplayName]&&!e.title&&!e.subTitle&&u[F.headerDisplayName],(e.title||e.subTitle||g||x||D)&&n.createElement("div",{className:"k-actionsheet-titlebar"},n.createElement("div",{className:"k-actionsheet-titlebar-group"},g&&n.createElement("div",{className:"k-actionsheet-actions"},g),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)),x&&n.createElement("div",{className:"k-actionsheet-actions"},x)),D&&n.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},D)),u[Y.contentDisplayName]||n.createElement("div",{className:"k-actionsheet-content"},n.createElement("div",{className:"k-list-ul",role:"group"},r&&r.map((t,i)=>n.createElement(K.ActionSheetItem,{...t,id:i,key:i,item:t,tabIndex:e.tabIndex||0,onClick:A})),J&&n.createElement("hr",{className:"k-hr"}),v&&v.map((t,i)=>n.createElement(K.ActionSheetItem,{...t,id:i+((r==null?void 0:r.length)||0),key:i,item:t,tabIndex:e.tabIndex||0,onClick:A})))),u[X.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(W.Animation,{transitionName:l.slide?"slide-up":"slide-down",onExited:b,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||C.current,animationEnteredStyle:e.animationStyles||C.current,animationExitingStyle:e.animationStyles||C.current,exit:!0,enter:!0,appear:!1},j):j):null)}),N={navigatable:!0,navigatableElements:[],position:"bottom"};w.propTypes={items:d.array,subTitle:d.node,title:d.node,navigatable:d.bool,navigatableElements:d.array,position:d.oneOf(["top","bottom","left","right","fullscreen"])};w.displayName="KendoReactActionSheet";exports.ActionSheet=w;exports.actionSheetDefaultProps=N;
|
|
@@ -17,9 +17,9 @@ import { ActionSheetView as Z, ActionSheetViewDisplayName as p } from "./ActionS
|
|
|
17
17
|
const j = n.forwardRef((e, _) => {
|
|
18
18
|
var A, T;
|
|
19
19
|
const {
|
|
20
|
-
navigatableElements: F =
|
|
21
|
-
navigatable: x =
|
|
22
|
-
position: H =
|
|
20
|
+
navigatableElements: F = g.navigatableElements,
|
|
21
|
+
navigatable: x = g.navigatable,
|
|
22
|
+
position: H = g.position,
|
|
23
23
|
animationDuration: o = 300,
|
|
24
24
|
prefixActions: k,
|
|
25
25
|
suffixActions: v,
|
|
@@ -29,23 +29,23 @@ const j = n.forwardRef((e, _) => {
|
|
|
29
29
|
}, V = (t, i, a) => {
|
|
30
30
|
if (t.ariaDisabled)
|
|
31
31
|
return;
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
32
|
+
const c = t.className && t.className.indexOf ? t.className.indexOf("k-actionsheet-item") !== -1 : !1, E = i.elements.filter((s) => s.className.indexOf("k-actionsheet-item") !== -1);
|
|
33
|
+
if (c && e.onItemClick) {
|
|
34
34
|
a.preventDefault();
|
|
35
|
-
const
|
|
35
|
+
const s = e.items[E.indexOf(t)];
|
|
36
36
|
e.onItemClick.call(void 0, {
|
|
37
37
|
syntheticEvent: a,
|
|
38
|
-
item:
|
|
39
|
-
title:
|
|
38
|
+
item: s,
|
|
39
|
+
title: s && s.title
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
if (
|
|
42
|
+
if (c && e.onItemSelect) {
|
|
43
43
|
a.preventDefault();
|
|
44
|
-
const
|
|
44
|
+
const s = e.items[E.indexOf(t)];
|
|
45
45
|
e.onItemSelect.call(void 0, {
|
|
46
46
|
syntheticEvent: a,
|
|
47
|
-
item:
|
|
48
|
-
title:
|
|
47
|
+
item: s,
|
|
48
|
+
title: s && s.title
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
e.animation || d();
|
|
@@ -61,8 +61,8 @@ const j = n.forwardRef((e, _) => {
|
|
|
61
61
|
e.onItemClick && e.onItemClick.call(void 0, t), e.onItemSelect && e.onItemSelect.call(void 0, t), e.animation || d();
|
|
62
62
|
}, U = (t) => {
|
|
63
63
|
const i = {}, a = [];
|
|
64
|
-
return n.Children.forEach(t, (
|
|
65
|
-
|
|
64
|
+
return n.Children.forEach(t, (c) => {
|
|
65
|
+
c && (c.type.displayName === p ? a.push(c) : i[c.type.displayName] = c);
|
|
66
66
|
}), a.length > 0 ? a : i;
|
|
67
67
|
}, I = n.useRef(null), h = n.useRef(null);
|
|
68
68
|
n.useImperativeHandle(
|
|
@@ -72,7 +72,7 @@ const j = n.forwardRef((e, _) => {
|
|
|
72
72
|
_,
|
|
73
73
|
() => I.current
|
|
74
74
|
);
|
|
75
|
-
const y = n.useRef(void 0),
|
|
75
|
+
const y = n.useRef(void 0), S = n.useRef({ bottom: "0", width: "100%" }), w = n.useRef(void 0), [l, q] = n.useState({ show: !1, slide: !1 }), u = (t) => {
|
|
76
76
|
q((i) => ({ ...i, ...t }));
|
|
77
77
|
};
|
|
78
78
|
n.useEffect(() => {
|
|
@@ -85,8 +85,8 @@ const j = n.forwardRef((e, _) => {
|
|
|
85
85
|
".k-actionsheet-content",
|
|
86
86
|
".k-actionsheet-view",
|
|
87
87
|
".k-actionsheet-titlebar"
|
|
88
|
-
].map((
|
|
89
|
-
(E) => `${
|
|
88
|
+
].map((c) => J.concat(F).map(
|
|
89
|
+
(E) => `${c} ${E}`
|
|
90
90
|
)).flat()];
|
|
91
91
|
y.current = new Q({
|
|
92
92
|
tabIndex: e.tabIndex || 0,
|
|
@@ -149,24 +149,24 @@ const j = n.forwardRef((e, _) => {
|
|
|
149
149
|
onExited: d,
|
|
150
150
|
transitionEnterDuration: typeof o == "object" && Object.keys(o).length > 0 && o.openDuration ? Number(o.openDuration) : Number(o),
|
|
151
151
|
transitionExitDuration: typeof o == "object" && Object.keys(o).length > 0 && o.closeDuration ? Number(o.closeDuration) : Number(o),
|
|
152
|
-
animationEnteringStyle: e.animationStyles ||
|
|
153
|
-
animationEnteredStyle: e.animationStyles ||
|
|
154
|
-
animationExitingStyle: e.animationStyles ||
|
|
152
|
+
animationEnteringStyle: e.animationStyles || S.current,
|
|
153
|
+
animationEnteredStyle: e.animationStyles || S.current,
|
|
154
|
+
animationExitingStyle: e.animationStyles || S.current,
|
|
155
155
|
exit: !0,
|
|
156
156
|
enter: !0,
|
|
157
157
|
appear: !1
|
|
158
158
|
},
|
|
159
159
|
O
|
|
160
160
|
) : O) : null);
|
|
161
|
-
}),
|
|
161
|
+
}), g = {
|
|
162
162
|
navigatable: !0,
|
|
163
163
|
navigatableElements: [],
|
|
164
164
|
position: "bottom"
|
|
165
165
|
};
|
|
166
166
|
j.propTypes = {
|
|
167
167
|
items: f.array,
|
|
168
|
-
subTitle: f.
|
|
169
|
-
title: f.
|
|
168
|
+
subTitle: f.node,
|
|
169
|
+
title: f.node,
|
|
170
170
|
navigatable: f.bool,
|
|
171
171
|
navigatableElements: f.array,
|
|
172
172
|
position: f.oneOf(["top", "bottom", "left", "right", "fullscreen"])
|
|
@@ -174,5 +174,5 @@ j.propTypes = {
|
|
|
174
174
|
j.displayName = "KendoReactActionSheet";
|
|
175
175
|
export {
|
|
176
176
|
j as ActionSheet,
|
|
177
|
-
|
|
177
|
+
g as actionSheetDefaultProps
|
|
178
178
|
};
|