@progress/kendo-react-layout 9.0.0-develop.8 → 9.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 +148 -146
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/index.d.mts +43 -41
- package/index.d.ts +43 -41
- package/index.js +1 -1
- package/index.mjs +39 -38
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +134 -154
|
@@ -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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react"),f=require("prop-types"),G=require("@progress/kendo-react-animation"),v=require("@progress/kendo-react-common"),J=require("../package-metadata.js"),q=require("./ActionSheetItem.js"),_=require("./ActionSheetHeader.js"),Q=require("./ActionSheetFooter.js"),V=require("./ActionSheetContent.js");function W(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const m=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,m.get?m:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const n=W(U),x=n.forwardRef((e,r)=>{var A,P;v.validatePackage(J.packageMetadata);const{navigatableElements:s=N.navigatableElements,navigatable:m=N.navigatable}=e,j=(t,i,a)=>{a.preventDefault(),a.shiftKey?i.focusPrevious(t):i.focusNext(t)},K=(t,i,a)=>{if(t.ariaDisabled)return;const y=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(y&&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(y&&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||u()},M=(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||u()},u=()=>{d({show:!1})},H=t=>{m&&h.current.triggerKeyboardEvent(t)},F=t=>{e.onOverlayClick&&e.onOverlayClick.call(void 0,t),e.onClose&&e.onClose.call(void 0,t),e.animation||u()},C=t=>{e.onItemClick&&e.onItemClick.call(void 0,t),e.onItemSelect&&e.onItemSelect.call(void 0,t),e.animation||u()},L=t=>{const i={};return n.Children.forEach(t,a=>{a&&(i[a.type.displayName]=a)}),i},I=n.useRef(null),S=n.useRef(null);n.useImperativeHandle(I,()=>({props:e})),n.useImperativeHandle(r,()=>I.current);const h=n.useRef(),B=n.useRef(e.animationDuration||300),g=n.useRef({bottom:"0",width:"100%"}),D=n.useRef(),[l,$]=n.useState({show:!1,slide:!1}),d=t=>{$(i=>({...i,...t}))};n.useEffect(()=>{e.expand&&!l.show&&d({show:!0})},[]),n.useEffect(()=>{const t=S.current;if(e.expand&&!l.show&&d({show:!0}),e.expand&&l.show&&!l.slide&&d({slide:!0}),!e.expand&&l.show&&l.slide&&d({slide:!1}),D!==l&&l.slide&&t&&!e.className&&(t.style.setProperty("--kendo-actionsheet-height","auto"),t.style.setProperty("--kendo-actionsheet-max-height","none")),t&&m){const a=[".k-actionsheet-item",...[".k-actionsheet-footer",".k-actionsheet-content",".k-actionsheet-titlebar"].map(y=>v.FOCUSABLE_ELEMENTS.concat(s).map(E=>`${y} ${E}`)).flat()];h.current=new v.Navigation({tabIndex:e.tabIndex||0,root:S,rovingTabIndex:!1,selectors:a,keyboardEvents:{keydown:{Tab:j,Enter:K,Escape:M}}}),h.current.focusElement(h.current.first,null)}D.current={...l}});const R="k-actionsheet-title",w=R,o=(A=e.items)==null?void 0:A.filter(t=>!t.group||t.group==="top"),b=(P=e.items)==null?void 0:P.filter(t=>t.group==="bottom"),z=o&&o.length>0&&b&&b.length>0,k=L(e.children),O=e.animationDuration||B.current,T=l.slide&&n.createElement("div",{className:v.classNames("k-actionsheet",e.className,{"k-actionsheet-bottom":!e.className}),role:"dialog","aria-modal":"true","aria-hidden":!1,"aria-labelledby":w,ref:S,onKeyDown:H},k[_.headerDisplayName]&&!e.title&&!e.subTitle&&k[_.headerDisplayName],(e.title||e.subTitle)&&n.createElement("div",{className:"k-actionsheet-titlebar k-text-center"},n.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},n.createElement("div",{className:R,id:w},e.title&&n.createElement("div",null,e.title),e.subTitle&&n.createElement("div",{className:"k-actionsheet-subtitle"},e.subTitle)))),k[V.contentDisplayName]||n.createElement("div",{className:"k-actionsheet-content"},n.createElement("div",{className:"k-list-ul",role:"group"},o&&o.map((t,i)=>n.createElement(q.ActionSheetItem,{...t,id:i,key:i,item:t,tabIndex:e.tabIndex||0,onClick:C}))),z&&n.createElement("hr",{className:"k-hr"}),n.createElement("div",{className:"k-list-ul",role:"group"},b&&b.map((t,i)=>n.createElement(q.ActionSheetItem,{...t,id:i+((o==null?void 0:o.length)||0),key:i,item:t,tabIndex:e.tabIndex||0,onClick:C})))),k[Q.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:F}),e.animation?n.createElement(G.Animation,{transitionName:l.slide?"slide-up":"slide-down",onExited:u,transitionEnterDuration:O,transitionExitDuration:O,animationEnteringStyle:e.animationStyles||g.current,animationEnteredStyle:e.animationStyles||g.current,animationExitingStyle:e.animationStyles||g.current,exit:!0,enter:!0,appear:!1},T):T):null)}),N={navigatable:!0,navigatableElements:[]};x.propTypes={items:f.array,subTitle:f.string,title:f.string,navigatable:f.bool,navigatableElements:f.array};x.displayName="KendoReactActionSheet";exports.ActionSheet=x;exports.actionSheetDefaultProps=N;
|
|
@@ -6,166 +6,168 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { Animation as
|
|
12
|
-
import { validatePackage as
|
|
13
|
-
import { packageMetadata as
|
|
14
|
-
import { ActionSheetItem as
|
|
15
|
-
import { headerDisplayName as
|
|
16
|
-
import { footerDisplayName as
|
|
17
|
-
import { contentDisplayName as
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import r from "prop-types";
|
|
11
|
+
import { Animation as q } from "@progress/kendo-react-animation";
|
|
12
|
+
import { validatePackage as z, FOCUSABLE_ELEMENTS as G, Navigation as J, classNames as Q } from "@progress/kendo-react-common";
|
|
13
|
+
import { packageMetadata as V } from "../package-metadata.mjs";
|
|
14
|
+
import { ActionSheetItem as w } from "./ActionSheetItem.mjs";
|
|
15
|
+
import { headerDisplayName as T } from "./ActionSheetHeader.mjs";
|
|
16
|
+
import { footerDisplayName as W } from "./ActionSheetFooter.mjs";
|
|
17
|
+
import { contentDisplayName as X } from "./ActionSheetContent.mjs";
|
|
18
|
+
const P = n.forwardRef((e, A) => {
|
|
19
|
+
var D, R;
|
|
20
|
+
z(V);
|
|
21
|
+
const {
|
|
22
|
+
navigatableElements: K = O.navigatableElements,
|
|
23
|
+
navigatable: b = O.navigatable
|
|
24
|
+
} = e, _ = (t, i, a) => {
|
|
25
|
+
a.preventDefault(), a.shiftKey ? i.focusPrevious(t) : i.focusNext(t);
|
|
26
|
+
}, H = (t, i, a) => {
|
|
27
|
+
if (t.ariaDisabled)
|
|
28
|
+
return;
|
|
29
|
+
const h = t.className && t.className.indexOf ? t.className.indexOf("k-actionsheet-item") !== -1 : !1, E = i.elements.filter((o) => o.className.indexOf("k-actionsheet-item") !== -1);
|
|
30
|
+
if (h && e.onItemClick) {
|
|
31
|
+
a.preventDefault();
|
|
32
|
+
const o = e.items[E.indexOf(t)];
|
|
33
|
+
e.onItemClick.call(void 0, {
|
|
34
|
+
syntheticEvent: a,
|
|
35
|
+
item: o,
|
|
36
|
+
title: o && o.title
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (h && e.onItemSelect) {
|
|
40
|
+
a.preventDefault();
|
|
41
|
+
const o = e.items[E.indexOf(t)];
|
|
42
|
+
e.onItemSelect.call(void 0, {
|
|
43
|
+
syntheticEvent: a,
|
|
44
|
+
item: o,
|
|
45
|
+
title: o && o.title
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
e.animation || s();
|
|
49
|
+
}, L = (t, i, a) => {
|
|
50
|
+
e.onOverlayClick && (a.preventDefault(), e.onOverlayClick.call(void 0, a)), e.onClose && (a.preventDefault(), e.onClose.call(void 0, a)), e.animation || s();
|
|
51
|
+
}, s = () => {
|
|
52
|
+
m({ show: !1 });
|
|
53
|
+
}, B = (t) => {
|
|
54
|
+
b && d.current.triggerKeyboardEvent(t);
|
|
55
|
+
}, F = (t) => {
|
|
56
|
+
e.onOverlayClick && e.onOverlayClick.call(void 0, t), e.onClose && e.onClose.call(void 0, t), e.animation || s();
|
|
57
|
+
}, y = (t) => {
|
|
58
|
+
e.onItemClick && e.onItemClick.call(void 0, t), e.onItemSelect && e.onItemSelect.call(void 0, t), e.animation || s();
|
|
59
|
+
}, M = (t) => {
|
|
60
|
+
const i = {};
|
|
61
|
+
return n.Children.forEach(t, (a) => {
|
|
62
|
+
a && (i[a.type.displayName] = a);
|
|
63
|
+
}), i;
|
|
64
|
+
}, N = n.useRef(null), k = n.useRef(null);
|
|
65
|
+
n.useImperativeHandle(N, () => ({ props: e })), n.useImperativeHandle(
|
|
66
|
+
A,
|
|
67
|
+
() => N.current
|
|
68
|
+
);
|
|
69
|
+
const d = n.useRef(), $ = n.useRef(e.animationDuration || 300), v = n.useRef({ bottom: "0", width: "100%" }), g = n.useRef(), [l, U] = n.useState({ show: !1, slide: !1 }), m = (t) => {
|
|
70
|
+
U((i) => ({ ...i, ...t }));
|
|
71
|
+
};
|
|
72
|
+
n.useEffect(() => {
|
|
73
|
+
e.expand && !l.show && m({ show: !0 });
|
|
74
|
+
}, []), n.useEffect(() => {
|
|
75
|
+
const t = k.current;
|
|
76
|
+
if (e.expand && !l.show && m({ show: !0 }), e.expand && l.show && !l.slide && m({ slide: !0 }), !e.expand && l.show && l.slide && m({ slide: !1 }), g !== l && l.slide && t && !e.className && (t.style.setProperty("--kendo-actionsheet-height", "auto"), t.style.setProperty("--kendo-actionsheet-max-height", "none")), t && b) {
|
|
77
|
+
const a = [".k-actionsheet-item", ...[
|
|
75
78
|
".k-actionsheet-footer",
|
|
76
79
|
".k-actionsheet-content",
|
|
77
80
|
".k-actionsheet-titlebar"
|
|
78
|
-
].map((
|
|
79
|
-
(
|
|
81
|
+
].map((h) => G.concat(K).map(
|
|
82
|
+
(E) => `${h} ${E}`
|
|
80
83
|
)).flat()];
|
|
81
|
-
|
|
82
|
-
tabIndex:
|
|
83
|
-
root:
|
|
84
|
+
d.current = new J({
|
|
85
|
+
tabIndex: e.tabIndex || 0,
|
|
86
|
+
root: k,
|
|
84
87
|
rovingTabIndex: !1,
|
|
85
|
-
selectors:
|
|
88
|
+
selectors: a,
|
|
86
89
|
keyboardEvents: {
|
|
87
90
|
keydown: {
|
|
88
|
-
Tab:
|
|
89
|
-
Enter:
|
|
90
|
-
Escape:
|
|
91
|
+
Tab: _,
|
|
92
|
+
Enter: H,
|
|
93
|
+
Escape: L
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
|
-
}),
|
|
96
|
+
}), d.current.focusElement(d.current.first, null);
|
|
94
97
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
g.current = { ...l };
|
|
99
|
+
});
|
|
100
|
+
const S = "k-actionsheet-title", x = S, c = (D = e.items) == null ? void 0 : D.filter(
|
|
101
|
+
(t) => !t.group || t.group === "top"
|
|
102
|
+
), f = (R = e.items) == null ? void 0 : R.filter(
|
|
103
|
+
(t) => t.group === "bottom"
|
|
104
|
+
), j = c && c.length > 0 && f && f.length > 0, u = M(e.children), C = e.animationDuration || $.current, I = l.slide && /* @__PURE__ */ n.createElement(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
className: Q("k-actionsheet", e.className, {
|
|
108
|
+
"k-actionsheet-bottom": !e.className
|
|
109
|
+
}),
|
|
110
|
+
role: "dialog",
|
|
111
|
+
"aria-modal": "true",
|
|
112
|
+
"aria-hidden": !1,
|
|
113
|
+
"aria-labelledby": x,
|
|
114
|
+
ref: k,
|
|
115
|
+
onKeyDown: B
|
|
116
|
+
},
|
|
117
|
+
u[T] && !e.title && !e.subTitle && u[T],
|
|
118
|
+
(e.title || e.subTitle) && /* @__PURE__ */ n.createElement("div", { className: "k-actionsheet-titlebar k-text-center" }, /* @__PURE__ */ n.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ n.createElement("div", { className: S, id: x }, e.title && /* @__PURE__ */ n.createElement("div", null, e.title), e.subTitle && /* @__PURE__ */ n.createElement("div", { className: "k-actionsheet-subtitle" }, e.subTitle)))),
|
|
119
|
+
u[X] || /* @__PURE__ */ n.createElement("div", { className: "k-actionsheet-content" }, /* @__PURE__ */ n.createElement("div", { className: "k-list-ul", role: "group" }, c && c.map((t, i) => /* @__PURE__ */ n.createElement(
|
|
120
|
+
w,
|
|
104
121
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
f[v] && !n && !t && f[v],
|
|
116
|
-
(n || t) && /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-titlebar k-text-center" }, /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ e.createElement("div", { className: this.actionSheetTitleClass, id: this.ariaLabeledBy }, n && /* @__PURE__ */ e.createElement("div", null, n), t && /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-subtitle" }, t)))),
|
|
117
|
-
f[w] || /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-content" }, /* @__PURE__ */ e.createElement("div", { className: "k-list-ul", role: "group" }, r && r.map((o, c) => /* @__PURE__ */ e.createElement(
|
|
118
|
-
E,
|
|
119
|
-
{
|
|
120
|
-
...o,
|
|
121
|
-
id: c,
|
|
122
|
-
key: c,
|
|
123
|
-
item: o,
|
|
124
|
-
tabIndex: l || 0,
|
|
125
|
-
onClick: this.handleItemClick
|
|
126
|
-
}
|
|
127
|
-
))), y && /* @__PURE__ */ e.createElement("hr", { className: "k-hr" }), /* @__PURE__ */ e.createElement("div", { className: "k-list-ul", role: "group" }, d && d.map((o, c) => /* @__PURE__ */ e.createElement(
|
|
128
|
-
E,
|
|
129
|
-
{
|
|
130
|
-
...o,
|
|
131
|
-
id: c + ((r == null ? void 0 : r.length) || 0),
|
|
132
|
-
key: c,
|
|
133
|
-
item: o,
|
|
134
|
-
tabIndex: l || 0,
|
|
135
|
-
onClick: this.handleItemClick
|
|
136
|
-
}
|
|
137
|
-
)))),
|
|
138
|
-
f[I]
|
|
139
|
-
);
|
|
140
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, h || this.state.show ? /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-container" }, /* @__PURE__ */ e.createElement("div", { className: "k-overlay", onClick: this.handleOverlayClick }), i ? /* @__PURE__ */ e.createElement(
|
|
141
|
-
g,
|
|
122
|
+
...t,
|
|
123
|
+
id: i,
|
|
124
|
+
key: i,
|
|
125
|
+
item: t,
|
|
126
|
+
tabIndex: e.tabIndex || 0,
|
|
127
|
+
onClick: y
|
|
128
|
+
}
|
|
129
|
+
))), j && /* @__PURE__ */ n.createElement("hr", { className: "k-hr" }), /* @__PURE__ */ n.createElement("div", { className: "k-list-ul", role: "group" }, f && f.map((t, i) => /* @__PURE__ */ n.createElement(
|
|
130
|
+
w,
|
|
142
131
|
{
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
132
|
+
...t,
|
|
133
|
+
id: i + ((c == null ? void 0 : c.length) || 0),
|
|
134
|
+
key: i,
|
|
135
|
+
item: t,
|
|
136
|
+
tabIndex: e.tabIndex || 0,
|
|
137
|
+
onClick: y
|
|
138
|
+
}
|
|
139
|
+
)))),
|
|
140
|
+
u[W]
|
|
141
|
+
);
|
|
142
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null, e.expand || l.show ? /* @__PURE__ */ n.createElement("div", { className: "k-actionsheet-container" }, /* @__PURE__ */ n.createElement("div", { className: "k-overlay", onClick: F }), e.animation ? /* @__PURE__ */ n.createElement(
|
|
143
|
+
q,
|
|
144
|
+
{
|
|
145
|
+
transitionName: l.slide ? "slide-up" : "slide-down",
|
|
146
|
+
onExited: s,
|
|
147
|
+
transitionEnterDuration: C,
|
|
148
|
+
transitionExitDuration: C,
|
|
149
|
+
animationEnteringStyle: e.animationStyles || v.current,
|
|
150
|
+
animationEnteredStyle: e.animationStyles || v.current,
|
|
151
|
+
animationExitingStyle: e.animationStyles || v.current,
|
|
152
|
+
exit: !0,
|
|
153
|
+
enter: !0,
|
|
154
|
+
appear: !1
|
|
155
|
+
},
|
|
156
|
+
I
|
|
157
|
+
) : I) : null);
|
|
158
|
+
}), O = {
|
|
165
159
|
navigatable: !0,
|
|
166
160
|
navigatableElements: []
|
|
167
161
|
};
|
|
168
|
-
|
|
162
|
+
P.propTypes = {
|
|
163
|
+
items: r.array,
|
|
164
|
+
subTitle: r.string,
|
|
165
|
+
title: r.string,
|
|
166
|
+
navigatable: r.bool,
|
|
167
|
+
navigatableElements: r.array
|
|
168
|
+
};
|
|
169
|
+
P.displayName = "KendoReactActionSheet";
|
|
169
170
|
export {
|
|
170
|
-
|
|
171
|
+
P as ActionSheet,
|
|
172
|
+
O as actionSheetDefaultProps
|
|
171
173
|
};
|