@progress/kendo-react-layout 8.1.0-develop.2 → 8.1.0-develop.21
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/dist/cdn/js/kendo-react-layout.js +1 -1
- package/index.d.mts +17 -10
- package/index.d.ts +17 -10
- package/package-metadata.mjs +1 -1
- package/package.json +6 -6
- package/splitter/SplitterBar.js +1 -1
- package/splitter/SplitterBar.mjs +72 -46
- package/stepper/Step.js +1 -1
- package/stepper/Step.mjs +74 -77
- package/stepper/Stepper.js +1 -1
- package/stepper/Stepper.mjs +179 -163
- package/tabstrip/TabStrip.js +1 -1
- package/tabstrip/TabStrip.mjs +94 -111
- package/tabstrip/TabStripContent.js +1 -1
- package/tabstrip/TabStripContent.mjs +2 -1
- package/tabstrip/TabStripNavigationItem.js +1 -1
- package/tabstrip/TabStripNavigationItem.mjs +36 -24
package/stepper/Step.mjs
CHANGED
|
@@ -8,79 +8,79 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import a from "prop-types";
|
|
11
|
-
import { StepperContext as
|
|
12
|
-
import { focusFirstFocusableChild as
|
|
13
|
-
import { useLocalization as
|
|
14
|
-
import { checkOutlineIcon as
|
|
15
|
-
import { DEFAULT_ANIMATION_DURATION as
|
|
16
|
-
import { messages as
|
|
17
|
-
const
|
|
11
|
+
import { StepperContext as Y } from "./context/StepperContext.mjs";
|
|
12
|
+
import { focusFirstFocusableChild as Z, dispatchEvent as T, classNames as ee, IconWrap as L, toIconName as te } from "@progress/kendo-react-common";
|
|
13
|
+
import { useLocalization as ae } from "@progress/kendo-react-intl";
|
|
14
|
+
import { checkOutlineIcon as se, exclamationCircleIcon as oe } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { DEFAULT_ANIMATION_DURATION as ne, NO_ANIMATION as ce } from "./contants.mjs";
|
|
16
|
+
import { messages as le, optionalText as ie } from "./messages/index.mjs";
|
|
17
|
+
const x = e.forwardRef((O, R) => {
|
|
18
18
|
const {
|
|
19
19
|
// content
|
|
20
|
-
children:
|
|
21
|
-
className:
|
|
20
|
+
children: V,
|
|
21
|
+
className: E,
|
|
22
22
|
current: d,
|
|
23
|
-
disabled:
|
|
24
|
-
focused:
|
|
23
|
+
disabled: o,
|
|
24
|
+
focused: h,
|
|
25
25
|
icon: r,
|
|
26
26
|
svgIcon: C,
|
|
27
27
|
index: s,
|
|
28
28
|
isValid: t,
|
|
29
|
-
label:
|
|
29
|
+
label: n,
|
|
30
30
|
optional: m,
|
|
31
31
|
style: y,
|
|
32
|
-
tabIndex:
|
|
33
|
-
text:
|
|
34
|
-
...
|
|
35
|
-
} =
|
|
36
|
-
animationDuration:
|
|
37
|
-
isVertical:
|
|
38
|
-
item:
|
|
39
|
-
linear:
|
|
40
|
-
mode:
|
|
32
|
+
tabIndex: me,
|
|
33
|
+
text: S,
|
|
34
|
+
...z
|
|
35
|
+
} = O, {
|
|
36
|
+
animationDuration: u,
|
|
37
|
+
isVertical: k,
|
|
38
|
+
item: D,
|
|
39
|
+
linear: H,
|
|
40
|
+
mode: F,
|
|
41
41
|
numOfSteps: c,
|
|
42
42
|
value: l,
|
|
43
|
-
onChange:
|
|
44
|
-
onFocus:
|
|
45
|
-
successIcon:
|
|
46
|
-
errorIcon:
|
|
47
|
-
successSVGIcon:
|
|
48
|
-
errorSVGIcon:
|
|
49
|
-
} = e.useContext(
|
|
43
|
+
onChange: b,
|
|
44
|
+
onFocus: f,
|
|
45
|
+
successIcon: P,
|
|
46
|
+
errorIcon: _,
|
|
47
|
+
successSVGIcon: w,
|
|
48
|
+
errorSVGIcon: B
|
|
49
|
+
} = e.useContext(Y), p = e.useRef(null), A = e.useCallback(
|
|
50
50
|
() => {
|
|
51
|
-
p.current &&
|
|
51
|
+
p.current && Z(p.current);
|
|
52
52
|
},
|
|
53
53
|
[]
|
|
54
54
|
), v = e.useCallback(
|
|
55
55
|
() => ({
|
|
56
56
|
element: p.current,
|
|
57
|
-
focus:
|
|
57
|
+
focus: A
|
|
58
58
|
}),
|
|
59
|
-
[
|
|
59
|
+
[A]
|
|
60
60
|
);
|
|
61
|
-
e.useImperativeHandle(
|
|
62
|
-
const
|
|
61
|
+
e.useImperativeHandle(R, v);
|
|
62
|
+
const I = !H || s === l - 1 || s === l || s === l + 1, N = F === "labels" || !!r && !!n, G = ae(), U = ((i) => G.toLanguageString(i, le[i]))(ie), W = typeof u == "number" ? u : u !== !1 ? ne : ce, $ = e.useCallback(
|
|
63
63
|
(i) => {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
b && !o && T(
|
|
65
|
+
b,
|
|
66
66
|
i,
|
|
67
67
|
v(),
|
|
68
68
|
{ value: s }
|
|
69
69
|
);
|
|
70
70
|
},
|
|
71
|
-
[
|
|
72
|
-
),
|
|
71
|
+
[b, l, o]
|
|
72
|
+
), j = e.useCallback(
|
|
73
73
|
(i) => {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
f && !o && T(
|
|
75
|
+
f,
|
|
76
76
|
i,
|
|
77
77
|
v(),
|
|
78
78
|
void 0
|
|
79
79
|
);
|
|
80
80
|
},
|
|
81
|
-
[
|
|
82
|
-
),
|
|
83
|
-
() =>
|
|
81
|
+
[f, o]
|
|
82
|
+
), K = e.useMemo(
|
|
83
|
+
() => ee(
|
|
84
84
|
"k-step",
|
|
85
85
|
{
|
|
86
86
|
"k-step-first": s === 0,
|
|
@@ -89,70 +89,67 @@ const E = e.forwardRef((R, V) => {
|
|
|
89
89
|
"k-step-current": d,
|
|
90
90
|
"k-step-optional": m,
|
|
91
91
|
"k-step-error": t !== void 0 && !t,
|
|
92
|
-
"k-step-success": t
|
|
92
|
+
"k-step-success": t,
|
|
93
|
+
"k-disabled": o,
|
|
94
|
+
"k-focus": h
|
|
93
95
|
},
|
|
94
|
-
|
|
95
|
-
"k-disabled": n,
|
|
96
|
-
"k-focus": u
|
|
97
|
-
},
|
|
98
|
-
h
|
|
96
|
+
E
|
|
99
97
|
),
|
|
100
|
-
[s, c, l, d, m,
|
|
101
|
-
),
|
|
98
|
+
[s, c, l, d, m, o, h, t, E]
|
|
99
|
+
), q = e.useMemo(
|
|
102
100
|
() => ({
|
|
103
|
-
maxWidth:
|
|
104
|
-
maxHeight:
|
|
105
|
-
pointerEvents:
|
|
101
|
+
maxWidth: k ? void 0 : `calc(100% / ${c})`,
|
|
102
|
+
maxHeight: k ? `calc(100% / ${c})` : void 0,
|
|
103
|
+
pointerEvents: I ? void 0 : "none",
|
|
106
104
|
...y
|
|
107
105
|
}),
|
|
108
|
-
[
|
|
109
|
-
),
|
|
106
|
+
[k, c, y, I]
|
|
107
|
+
), M = t ? P : _, g = M ? /* @__PURE__ */ e.createElement(
|
|
110
108
|
"span",
|
|
111
109
|
{
|
|
112
|
-
className: "k-step-indicator-icon " +
|
|
110
|
+
className: "k-step-indicator-icon " + M,
|
|
113
111
|
"aria-hidden": "true"
|
|
114
112
|
}
|
|
115
113
|
) : /* @__PURE__ */ e.createElement(
|
|
116
|
-
|
|
114
|
+
L,
|
|
117
115
|
{
|
|
118
116
|
className: "k-step-indicator-icon",
|
|
119
117
|
name: t ? "check-circle" : "exclamation-circle",
|
|
120
|
-
icon: t ?
|
|
118
|
+
icon: t ? w || se : B || oe
|
|
121
119
|
}
|
|
122
|
-
),
|
|
120
|
+
), J = /* @__PURE__ */ e.createElement(e.Fragment, null, F !== "labels" ? /* @__PURE__ */ e.createElement(
|
|
123
121
|
"span",
|
|
124
122
|
{
|
|
125
123
|
className: "k-step-indicator",
|
|
126
124
|
"aria-hidden": !0,
|
|
127
|
-
style: { transitionDuration:
|
|
125
|
+
style: { transitionDuration: W + "ms" }
|
|
128
126
|
},
|
|
129
|
-
r || C ? !
|
|
130
|
-
) : null),
|
|
127
|
+
r || C ? !N && t !== void 0 ? g : /* @__PURE__ */ e.createElement(L, { className: "k-step-indicator-icon", name: r && te(r), icon: C }) : t !== void 0 ? g : /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-text" }, S || s + 1)
|
|
128
|
+
) : null), Q = (n || N || m) && /* @__PURE__ */ e.createElement("span", { className: "k-step-label" }, n && /* @__PURE__ */ e.createElement("span", { className: "k-step-text" }, n), N && t !== void 0 && g, m && /* @__PURE__ */ e.createElement("span", { className: "k-step-label-optional" }, U)), X = /* @__PURE__ */ e.createElement(e.Fragment, null, J, Q);
|
|
131
129
|
return /* @__PURE__ */ e.createElement(
|
|
132
130
|
"li",
|
|
133
131
|
{
|
|
134
132
|
ref: p,
|
|
135
|
-
className:
|
|
136
|
-
style:
|
|
137
|
-
...
|
|
133
|
+
className: K,
|
|
134
|
+
style: q,
|
|
135
|
+
...z
|
|
138
136
|
},
|
|
139
137
|
/* @__PURE__ */ e.createElement(
|
|
140
138
|
"a",
|
|
141
139
|
{
|
|
142
140
|
className: "k-step-link",
|
|
143
|
-
title:
|
|
144
|
-
onClick:
|
|
145
|
-
onFocus:
|
|
146
|
-
|
|
147
|
-
"aria-
|
|
148
|
-
"aria-disabled": n || !N || void 0,
|
|
141
|
+
title: n || void 0,
|
|
142
|
+
onClick: $,
|
|
143
|
+
onFocus: j,
|
|
144
|
+
"aria-current": d ? "step" : void 0,
|
|
145
|
+
"aria-disabled": o || !I || void 0,
|
|
149
146
|
"aria-invalid": t !== void 0 && !t || void 0
|
|
150
147
|
},
|
|
151
|
-
|
|
148
|
+
D ? V : X
|
|
152
149
|
)
|
|
153
150
|
);
|
|
154
151
|
});
|
|
155
|
-
|
|
152
|
+
x.propTypes = {
|
|
156
153
|
children: a.any,
|
|
157
154
|
className: a.string,
|
|
158
155
|
// content: PropTypes.any,
|
|
@@ -167,11 +164,11 @@ E.propTypes = {
|
|
|
167
164
|
tabIndex: a.number,
|
|
168
165
|
text: a.string
|
|
169
166
|
};
|
|
170
|
-
const
|
|
167
|
+
const re = {
|
|
171
168
|
tabIndex: 0
|
|
172
169
|
};
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
x.defaultProps = re;
|
|
171
|
+
x.displayName = "KendoStep";
|
|
175
172
|
export {
|
|
176
|
-
|
|
173
|
+
x as Step
|
|
177
174
|
};
|
package/stepper/Stepper.js
CHANGED
|
@@ -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 Z=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("react"),l=require("prop-types"),$=require("./context/StepperContext.js"),d=require("@progress/kendo-react-common"),ee=require("./Step.js"),te=require("@progress/kendo-react-progressbars"),q=require("./contants.js"),se=require("../package-metadata.js"),ne=require("@progress/kendo-react-intl"),D=require("./messages/index.js");function oe(p){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const f in p)if(f!=="default"){const I=Object.getOwnPropertyDescriptor(p,f);Object.defineProperty(y,f,I.get?I:{enumerable:!0,get:()=>p[f]})}}return y.default=p,Object.freeze(y)}const o=oe(Z),O=o.forwardRef((p,y)=>{d.validatePackage(se.packageMetadata);const{animationDuration:f,children:I,className:w,disabled:g,errorIcon:F,errorSVGIcon:L,item:P,items:b,linear:k,mode:z,orientation:S,style:R,successIcon:V,successSVGIcon:j,value:u=0,onChange:h,onFocus:x}=p,_=ne.useLocalization().toLanguageString(D.progBarAriaLabel,D.messages[D.progBarAriaLabel]),v=o.useRef(null),T=o.useCallback(()=>{v.current&&d.focusFirstFocusableChild(v.current)},[]),C=o.useCallback(()=>({element:v.current,focus:T}),[T]);o.useImperativeHandle(y,C);const[K,c]=o.useState(u),m=b?b.length:0,s=S==="vertical",N=d.useDir(v,p.dir),G=typeof f=="number"?f:f!==!1?q.DEFAULT_ANIMATION_DURATION:q.NO_ANIMATION;o.useEffect(()=>{c(u)},[u]);const A=o.useCallback((r,i)=>{const e=i===u-1,t=i===u,a=i===u+1;u!==i&&h&&!g&&(!k||e||t||a)&&(d.dispatchEvent(h,r,C(),{value:i}),c(i))},[u,k,h,g,c]),B=o.useCallback(r=>{let i=r.value,e=r.syntheticEvent;A(e,i)},[A]),H=o.useCallback(r=>{x&&!g&&d.dispatchEvent(x,r.syntheticEvent,C(),void 0)},[x,g]),E=o.useMemo(()=>{const r=N==="rtl",i=b.length-1;return new d.Navigation({root:v,selectors:["ol.k-step-list li.k-step a.k-step-link"],tabIndex:0,keyboardEvents:{keydown:{ArrowLeft:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);!s&&!r&&n>0?(t.focusPrevious(e),c(n-1)):!s&&r&&n<i&&(t.focusNext(e),c(n+1))},ArrowRight:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);!s&&!r&&n<i?(t.focusNext(e),c(n+1)):!s&&r&&n>0&&(t.focusPrevious(e),c(n-1))},ArrowUp:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);s&&!r&&n>0?(t.focusPrevious(e),c(n-1)):s&&r&&n>0&&(t.focusPrevious(e),c(n+1))},ArrowDown:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);s&&!r&&n<i?(t.focusNext(e),c(n+1)):s&&r&&n<i&&(t.focusNext(e),c(n-1))},Tab:(e,t,a)=>{a.preventDefault();const n=t.elements.indexOf(e);a.shiftKey?!s&&!r&&n>0?(t.focusPrevious(e),c(n-1)):!s&&r&&n<i&&(t.focusNext(e),c(n+1)):!s&&!r&&n<i?(t.focusNext(e),c(n+1)):!s&&r&&n>0&&(t.focusPrevious(e),c(n-1))},Home:(e,t,a)=>{a.preventDefault(),t.focusElement(t.first,e),c(0)},End:(e,t,a)=>{a.preventDefault(),t.focusElement(t.last,e),c(i)},Space:(e,t,a)=>{a.preventDefault(),e.children[0].click()},Enter:(e,t,a)=>{a.preventDefault(),e.children[0].click()}}}})},[N,b.length,s,c]);o.useEffect(()=>(E.initializeRovingTab(u),()=>E.removeFocusListener()),[]);const U=o.useCallback(E.triggerKeyboardEvent.bind(E),[]),J=o.useMemo(()=>d.classNames("k-stepper",{"k-stepper-linear":k},w),[k,w]),Q=o.useMemo(()=>({display:"grid",gridTemplateColumns:s?void 0:"repeat("+m*2+", 1fr)",gridTemplateRows:s?"repeat("+m+", 1fr)":void 0,...R}),[s,m,R]),W=o.useMemo(()=>d.classNames("k-step-list",{"k-step-list-horizontal":!s,"k-step-list-vertical":s}),[s]),X=o.useMemo(()=>({gridColumnStart:s?void 0:1,gridColumnEnd:s?void 0:-1,gridRowStart:s?1:void 0,gridRowEnd:s?-1:void 0}),[s]),Y=o.useMemo(()=>({gridColumnStart:s?void 0:2,gridColumnEnd:s?void 0:m*2,gridRowStart:s?1:void 0,gridRowEnd:s?m:void 0,top:s?17:void 0}),[s,m]),M=b&&b.map((r,i)=>{const e={index:i,disabled:g||r.disabled,focused:i===K,current:i===u,...r},t=P||ee.Step;return o.createElement(t,{key:i,...e})});return o.createElement($.StepperContext.Provider,{value:{animationDuration:f,isVertical:s,item:P,linear:k,mode:z,numOfSteps:m,value:u,successIcon:V,successSVGIcon:j,errorIcon:F,errorSVGIcon:L,onChange:B,onFocus:H}},o.createElement("nav",{className:J,style:Q,dir:N,role:"navigation",ref:v,onKeyDown:U},o.createElement("ol",{className:W,style:X},M||I),o.createElement(te.ProgressBar,{style:Y,labelPlacement:"start",animation:{duration:G},ariaLabel:_,"aria-hidden":!0,max:m-1,labelVisible:!1,orientation:S,reverse:S==="vertical",value:u,disabled:g,tabIndex:-1})))});O.propTypes={animationDuration:l.oneOfType([l.bool,l.number]),children:l.any,className:l.string,dir:l.string,disabled:l.bool,errorIcon:l.string,errorSVGIcon:d.svgIconPropType,item:l.any,items:l.any,linear:l.bool,mode:l.oneOf(["steps","labels"]),orientation:l.oneOf(["horizontal","vertical"]),style:l.object,successIcon:l.string,successSVGIcon:d.svgIconPropType,value:l.number.isRequired,onChange:l.func,onFocus:l.func};O.displayName="KendoStepper";exports.Stepper=O;
|