@progress/kendo-react-buttons 14.5.0-develop.9 → 15.0.0-develop.1
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/Button.d.ts +6 -2
- package/Button.js +1 -1
- package/Button.mjs +85 -81
- package/Chip/Chip.d.ts +6 -0
- package/Chip/Chip.js +1 -1
- package/Chip/Chip.mjs +67 -63
- package/Chip/ChipList.js +1 -1
- package/Chip/ChipList.mjs +1 -1
- package/FloatingActionButton/FloatingActionButton.js +1 -1
- package/FloatingActionButton/FloatingActionButton.mjs +77 -78
- package/ListButton/DropDownButton.js +1 -1
- package/ListButton/DropDownButton.mjs +44 -44
- package/ListButton/SplitButton.js +1 -1
- package/ListButton/SplitButton.mjs +57 -53
- package/README.md +4 -4
- package/SpeechToTextButton/SpeechToTextButton.js +1 -1
- package/SpeechToTextButton/SpeechToTextButton.mjs +18 -18
- package/dist/cdn/js/kendo-react-buttons.js +1 -1
- package/messages/index.d.ts +5 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +8 -6
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +5 -5
- package/toolbar/Toolbar.js +1 -1
- package/toolbar/Toolbar.mjs +68 -62
- package/toolbar/tools/ToolbarOverflowSection.js +1 -1
- package/toolbar/tools/ToolbarOverflowSection.mjs +66 -40
- package/toolbar/tools/ToolbarScrollButton.js +1 -1
- package/toolbar/tools/ToolbarScrollButton.mjs +14 -16
package/toolbar/Toolbar.mjs
CHANGED
|
@@ -7,23 +7,24 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import n from "prop-types";
|
|
10
|
-
import { useDir as
|
|
11
|
-
import { toolbarButtons as
|
|
12
|
-
import { ToolbarScrollable as
|
|
13
|
-
import { ToolbarOverflowSection as
|
|
10
|
+
import { useDir as ee, usePaidChildrenWatermark as te, classNames as oe, kendoThemeMaps as re, WatermarkOverlay as ne, Keys as a } from "@progress/kendo-react-common";
|
|
11
|
+
import { toolbarButtons as se } from "../util.mjs";
|
|
12
|
+
import { ToolbarScrollable as le } from "./tools/ToolbarScrollable.mjs";
|
|
13
|
+
import { ToolbarOverflowSection as ce } from "./tools/ToolbarOverflowSection.mjs";
|
|
14
|
+
import { packageMetadata as ie } from "../package-metadata.mjs";
|
|
14
15
|
const N = t.forwardRef((i, A) => {
|
|
15
16
|
const {
|
|
16
|
-
children:
|
|
17
|
+
children: y,
|
|
17
18
|
className: K,
|
|
18
19
|
id: j,
|
|
19
20
|
ariaLabel: q,
|
|
20
21
|
keyboardNavigation: w,
|
|
21
|
-
role:
|
|
22
|
-
onResize:
|
|
22
|
+
role: C,
|
|
23
|
+
onResize: E,
|
|
23
24
|
style: D,
|
|
24
|
-
tabIndex:
|
|
25
|
+
tabIndex: W = f.tabIndex,
|
|
25
26
|
size: b = f.size,
|
|
26
|
-
fillMode:
|
|
27
|
+
fillMode: p = f.fillMode,
|
|
27
28
|
overflow: c,
|
|
28
29
|
scrollButtons: d = f.scrollButtons,
|
|
29
30
|
scrollButtonsPosition: $ = f.scrollButtonsPosition,
|
|
@@ -31,61 +32,65 @@ const N = t.forwardRef((i, A) => {
|
|
|
31
32
|
prevButton: _,
|
|
32
33
|
nextButton: G,
|
|
33
34
|
_ariaControls: J
|
|
34
|
-
} = i,
|
|
35
|
-
|
|
35
|
+
} = i, x = t.useRef(!1), r = t.useRef(null), m = t.useRef(null), h = t.useRef(0), S = t.useRef(0), l = t.useRef([]), I = t.useRef({ element: null, props: i }), [Q, U] = t.useState(!1), [B, O] = t.useState(!0), [M, P] = t.useState(!1), g = ee(r, i.dir), { showWatermark: V, licenseMessage: X } = te(
|
|
36
|
+
r,
|
|
37
|
+
ie,
|
|
38
|
+
"Toolbar"
|
|
39
|
+
), k = t.useMemo(() => i.buttons || se, [i.buttons]), Y = t.useMemo(() => k.map((e) => e + ":focus").join(","), [k]), z = () => {
|
|
40
|
+
const e = r.current && r.current.querySelector(Y);
|
|
36
41
|
return Math.max(
|
|
37
42
|
0,
|
|
38
|
-
|
|
43
|
+
l.current.findIndex((s) => s === e)
|
|
39
44
|
);
|
|
40
45
|
};
|
|
41
46
|
t.useImperativeHandle(
|
|
42
|
-
|
|
47
|
+
I,
|
|
43
48
|
() => ({
|
|
44
49
|
element: r.current,
|
|
45
50
|
props: i
|
|
46
51
|
})
|
|
47
|
-
), t.useImperativeHandle(A, () =>
|
|
48
|
-
r.current.querySelectorAll(
|
|
52
|
+
), t.useImperativeHandle(A, () => I.current), t.useEffect(() => (window.addEventListener("resize", L), r.current && (S.current = r.current.offsetWidth, h.current = r.current.offsetHeight, w !== !1 && (l.current = Array.from(
|
|
53
|
+
r.current.querySelectorAll(k.join(","))
|
|
49
54
|
), H(0))), () => {
|
|
50
|
-
window.removeEventListener("resize", L),
|
|
55
|
+
window.removeEventListener("resize", L), l.current.length = 0;
|
|
51
56
|
}), []), t.useEffect(() => {
|
|
52
|
-
if (
|
|
57
|
+
if (x.current) {
|
|
53
58
|
if (!r.current || w === !1)
|
|
54
59
|
return;
|
|
55
|
-
|
|
56
|
-
r.current.querySelectorAll(
|
|
57
|
-
), H(
|
|
60
|
+
l.current = Array.from(
|
|
61
|
+
r.current.querySelectorAll(k.join(","))
|
|
62
|
+
), H(z()), T();
|
|
58
63
|
} else
|
|
59
|
-
|
|
64
|
+
x.current = !0;
|
|
60
65
|
});
|
|
61
66
|
const H = (e) => {
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
l.current.forEach((s, o) => {
|
|
68
|
+
s.tabIndex = o === e ? W : -1;
|
|
64
69
|
});
|
|
65
|
-
},
|
|
66
|
-
const
|
|
67
|
-
!
|
|
70
|
+
}, Z = (e) => {
|
|
71
|
+
const s = e.keyCode === a.left || e.keyCode === a.right || e.keyCode === a.home || e.keyCode === a.end, o = z();
|
|
72
|
+
!s || e.defaultPrevented || l.current.findIndex((u) => u === e.target) === -1 || (e.keyCode === a.left ? v(
|
|
68
73
|
o,
|
|
69
|
-
o === 0 ?
|
|
70
|
-
) :
|
|
74
|
+
o === 0 ? l.current.length - 1 : o - 1
|
|
75
|
+
) : v(
|
|
71
76
|
o,
|
|
72
|
-
o ===
|
|
73
|
-
), e.keyCode ===
|
|
74
|
-
},
|
|
75
|
-
const o =
|
|
77
|
+
o === l.current.length - 1 ? 0 : o + 1
|
|
78
|
+
), e.keyCode === a.home && v(o, 0), e.keyCode === a.end && v(o, l.current.length - 1));
|
|
79
|
+
}, v = (e, s) => {
|
|
80
|
+
const o = l.current[s];
|
|
76
81
|
if (o) {
|
|
77
|
-
o.tabIndex =
|
|
78
|
-
const
|
|
79
|
-
|
|
82
|
+
o.tabIndex = W, o.focus();
|
|
83
|
+
const u = l.current[e];
|
|
84
|
+
u && (u.tabIndex = -1);
|
|
80
85
|
}
|
|
81
86
|
}, L = (e) => {
|
|
82
87
|
if (!r.current)
|
|
83
88
|
return;
|
|
84
|
-
const
|
|
85
|
-
if (S.current !==
|
|
86
|
-
S.current =
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
+
const s = r.current.offsetWidth, o = r.current.offsetHeight;
|
|
90
|
+
if (S.current !== s || h.current !== o) {
|
|
91
|
+
S.current = s, h.current = o;
|
|
92
|
+
const u = { offsetWidth: S.current, offsetHeight: h.current };
|
|
93
|
+
E && E.call(void 0, { target: I.current, ...u, nativeEvent: e });
|
|
89
94
|
}
|
|
90
95
|
T();
|
|
91
96
|
}, T = t.useCallback(() => {
|
|
@@ -93,46 +98,46 @@ const N = t.forwardRef((i, A) => {
|
|
|
93
98
|
e && U(
|
|
94
99
|
e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight
|
|
95
100
|
);
|
|
96
|
-
}, []),
|
|
101
|
+
}, []), R = t.useCallback(() => {
|
|
97
102
|
const e = m.current;
|
|
98
103
|
if (e) {
|
|
99
|
-
const
|
|
100
|
-
|
|
104
|
+
const s = e.scrollLeft === 0, o = g !== "rtl" ? e.scrollLeft + e.clientWidth === e.scrollWidth : e.clientWidth - e.scrollLeft === e.scrollWidth;
|
|
105
|
+
s && O(!0), o && P(!0), !s && !o && (O(!1), P(!1));
|
|
101
106
|
}
|
|
102
|
-
}, [
|
|
107
|
+
}, [g]);
|
|
103
108
|
return t.useEffect(() => {
|
|
104
109
|
const e = m.current;
|
|
105
110
|
if (e)
|
|
106
|
-
return e.addEventListener("scroll",
|
|
107
|
-
e.removeEventListener("scroll",
|
|
111
|
+
return e.addEventListener("scroll", R), () => {
|
|
112
|
+
e.removeEventListener("scroll", R);
|
|
108
113
|
};
|
|
109
|
-
}, [
|
|
114
|
+
}, [R]), /* @__PURE__ */ t.createElement(
|
|
110
115
|
"div",
|
|
111
116
|
{
|
|
112
117
|
id: j,
|
|
113
118
|
"aria-label": q,
|
|
114
119
|
"aria-controls": J,
|
|
115
|
-
className:
|
|
120
|
+
className: oe(
|
|
116
121
|
"k-toolbar",
|
|
117
122
|
{
|
|
118
|
-
[`k-toolbar-${
|
|
119
|
-
[`k-toolbar-${
|
|
123
|
+
[`k-toolbar-${re.sizeMap[b] || b}`]: b,
|
|
124
|
+
[`k-toolbar-${p}`]: p,
|
|
120
125
|
"k-toolbar-scrollable": c === "scroll",
|
|
121
126
|
"k-toolbar-scrollable-overlay": c === "scroll" && (d === "hidden" || d === void 0),
|
|
122
|
-
"k-toolbar-scrollable-start": c === "scroll" && d === "hidden" &&
|
|
123
|
-
"k-toolbar-scrollable-end": c === "scroll" && d === "hidden" &&
|
|
127
|
+
"k-toolbar-scrollable-start": c === "scroll" && d === "hidden" && B,
|
|
128
|
+
"k-toolbar-scrollable-end": c === "scroll" && d === "hidden" && M,
|
|
124
129
|
"k-toolbar-section": i.overflow && c === "section"
|
|
125
130
|
},
|
|
126
131
|
K
|
|
127
132
|
),
|
|
128
133
|
style: D,
|
|
129
|
-
role:
|
|
130
|
-
dir:
|
|
134
|
+
role: C !== void 0 ? C || void 0 : "toolbar",
|
|
135
|
+
dir: g,
|
|
131
136
|
ref: r,
|
|
132
|
-
onKeyDown: w !== !1 ?
|
|
137
|
+
onKeyDown: w !== !1 ? Z : void 0
|
|
133
138
|
},
|
|
134
139
|
c === "scroll" && /* @__PURE__ */ t.createElement(
|
|
135
|
-
|
|
140
|
+
le,
|
|
136
141
|
{
|
|
137
142
|
scrollButtons: d,
|
|
138
143
|
scrollButtonsPosition: $,
|
|
@@ -141,14 +146,15 @@ const N = t.forwardRef((i, A) => {
|
|
|
141
146
|
isOverflowing: Q,
|
|
142
147
|
scrollContentRef: m,
|
|
143
148
|
buttonScrollSpeed: F,
|
|
144
|
-
dir:
|
|
145
|
-
isScrollStartPosition:
|
|
146
|
-
isScrollEndPosition:
|
|
147
|
-
children:
|
|
149
|
+
dir: g,
|
|
150
|
+
isScrollStartPosition: B,
|
|
151
|
+
isScrollEndPosition: M,
|
|
152
|
+
children: y
|
|
148
153
|
}
|
|
149
154
|
),
|
|
150
|
-
c === "section" && /* @__PURE__ */ t.createElement(
|
|
151
|
-
(c === "none" || c === void 0) &&
|
|
155
|
+
c === "section" && /* @__PURE__ */ t.createElement(ce, { toolbarRef: r, fillMode: p, size: b }, y),
|
|
156
|
+
(c === "none" || c === void 0) && y,
|
|
157
|
+
V && /* @__PURE__ */ t.createElement(ne, { message: X })
|
|
152
158
|
);
|
|
153
159
|
}), f = {
|
|
154
160
|
tabIndex: 0,
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),x=require("@progress/kendo-react-popup"),A=require("@progress/kendo-svg-icons"),D=require("@progress/kendo-react-intl"),V=require("@progress/kendo-react-common"),$=require("./ToolbarSeparator.js"),k=require("../messages/index.js"),H=require("../../Button.js");function U(a){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const i in a)if(i!=="default"){const p=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(l,i,p.get?p:{enumerable:!0,get:()=>a[i]})}}return l.default=a,Object.freeze(l)}const t=U(L),G=a=>{var S;const{toolbarRef:l,children:i,fillMode:p,size:q}=a,[T,P]=t.useState(!1),c=t.useRef(t.Children.toArray(i).filter(e=>t.isValidElement(e)).map((e,r)=>t.cloneElement(e,{key:e.key||r}))),n=t.useRef([]),m=t.useRef(0),v=t.useRef(null),w=t.useRef(null),j=D.useLocalization(),[,R]=t.useReducer(e=>e+1,0),O=()=>{const e=l.current;if(!e)return null;const r=e.clientWidth,o=parseInt(window.getComputedStyle(e).gap||"0",10),u=Array.from(e.children).filter(s=>s.dataset.kendoWatermark===void 0),b=u.map(s=>Math.ceil(s.clientWidth)),f=b.reduce((s,W)=>s+W,0)+u.length*o+o*2;return{toolbarWidth:r,gap:o,childWidths:b,totalInnerWidth:f}},B=()=>{var C,E,I,z,M;const e=O();if(!e)return;const{toolbarWidth:r,gap:o,childWidths:u,totalInnerWidth:b}=e;let f=b,s=!1;const W=n.current.length>0,g=[...c.current],y=[...n.current];for(;f>r&&g.length>0;){const d=g.pop(),h=g.length;if(d&&y.unshift(d),h<u.length&&(f-=u[h]+o),!s&&!W){const _=Math.ceil((E=(C=w.current)==null?void 0:C.offsetWidth)!=null?E:0),F=Math.ceil((M=(z=(I=v.current)==null?void 0:I.element)==null?void 0:z.offsetWidth)!=null?M:0);f+=_+F+o*2}s=!0}if(s){c.current=g,n.current=y,m.current=r,R();return}if(n.current.length>0&&r>m.current+o*u.length){const d=[...n.current],h=d.shift();n.current=d,h&&(c.current=[...c.current,h]),m.current=r,R()}};t.useEffect(()=>{const e=new ResizeObserver(B),r=l.current;return r&&e.observe(r),()=>{r&&e.unobserve(r)}},[]),t.useLayoutEffect(()=>{if(!l.current||n.current.length===0||c.current.length===0)return;const e=O();if(!e||e.totalInnerWidth<=e.toolbarWidth)return;const r=[...c.current],o=r.pop();m.current=e.toolbarWidth,c.current=r,o&&(n.current=[o,...n.current]),R()});const N=()=>{P(!T)};return t.createElement(t.Fragment,null,c.current.length>0&&c.current,n.current.length>0&&t.createElement(t.Fragment,null,t.createElement($.ToolbarSeparator,{_ref:w,className:"k-toolbar-button-separator"}),t.createElement(H.Button,{ref:v,className:"k-toolbar-overflow-button",fillMode:"flat",svgIcon:A.moreHorizontalIcon,title:j.toLanguageString(k.moreButtonTitle,k.messages[k.moreButtonTitle]),onClick:N}),t.createElement(x.Popup,{anchor:l.current,show:T,popupClass:"k-toolbar-popup",style:{width:(S=l.current)==null?void 0:S.offsetWidth}},t.createElement("span",{className:`k-toolbar-items-list k-toolbar-items-list-${V.kendoThemeMaps.sizeMap[q]} k-toolbar-items-list-${p}`},n.current.length>0&&n.current))))};exports.ToolbarOverflowSection=G;
|
|
@@ -5,69 +5,95 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { Popup as W } from "@progress/kendo-react-popup";
|
|
9
8
|
import * as e from "react";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
import { Popup as V } from "@progress/kendo-react-popup";
|
|
10
|
+
import { moreHorizontalIcon as $ } from "@progress/kendo-svg-icons";
|
|
11
|
+
import { useLocalization as H } from "@progress/kendo-react-intl";
|
|
12
|
+
import { kendoThemeMaps as U } from "@progress/kendo-react-common";
|
|
13
|
+
import { ToolbarSeparator as _ } from "./ToolbarSeparator.mjs";
|
|
14
|
+
import { moreButtonTitle as y, messages as j } from "../messages/index.mjs";
|
|
15
|
+
import { Button as q } from "../../Button.mjs";
|
|
16
|
+
const Z = (M) => {
|
|
17
|
+
var k;
|
|
18
|
+
const { toolbarRef: i, children: O, fillMode: S, size: F } = M, [g, L] = e.useState(!1), l = e.useRef(
|
|
19
|
+
e.Children.toArray(O).filter((t) => e.isValidElement(t)).map((t, r) => e.cloneElement(t, { key: t.key || r }))
|
|
20
|
+
), o = e.useRef([]), h = e.useRef(0), W = e.useRef(null), R = e.useRef(null), N = H(), [, p] = e.useReducer((t) => t + 1, 0), w = () => {
|
|
21
|
+
const t = i.current;
|
|
22
|
+
if (!t)
|
|
23
|
+
return null;
|
|
24
|
+
const r = t.clientWidth, n = parseInt(window.getComputedStyle(t).gap || "0", 10), c = Array.from(t.children).filter(
|
|
25
|
+
(s) => s.dataset.kendoWatermark === void 0
|
|
26
|
+
), m = c.map((s) => Math.ceil(s.clientWidth)), a = m.reduce((s, b) => s + b, 0) + c.length * n + n * 2;
|
|
27
|
+
return { toolbarWidth: r, gap: n, childWidths: m, totalInnerWidth: a };
|
|
28
|
+
}, P = () => {
|
|
29
|
+
var T, E, C, z, I;
|
|
30
|
+
const t = w();
|
|
31
|
+
if (!t)
|
|
22
32
|
return;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
const { toolbarWidth: r, gap: n, childWidths: c, totalInnerWidth: m } = t;
|
|
34
|
+
let a = m, s = !1;
|
|
35
|
+
const b = o.current.length > 0, d = [...l.current], v = [...o.current];
|
|
36
|
+
for (; a > r && d.length > 0; ) {
|
|
37
|
+
const u = d.pop(), f = d.length;
|
|
38
|
+
if (u && v.unshift(u), f < c.length && (a -= c[f] + n), !s && !b) {
|
|
39
|
+
const A = Math.ceil((E = (T = R.current) == null ? void 0 : T.offsetWidth) != null ? E : 0), B = Math.ceil((I = (z = (C = W.current) == null ? void 0 : C.element) == null ? void 0 : z.offsetWidth) != null ? I : 0);
|
|
40
|
+
a += A + B + n * 2;
|
|
41
|
+
}
|
|
42
|
+
s = !0;
|
|
43
|
+
}
|
|
44
|
+
if (s) {
|
|
45
|
+
l.current = d, o.current = v, h.current = r, p();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (o.current.length > 0 && r > h.current + n * c.length) {
|
|
49
|
+
const u = [...o.current], f = u.shift();
|
|
50
|
+
o.current = u, f && (l.current = [...l.current, f]), h.current = r, p();
|
|
31
51
|
}
|
|
32
|
-
E();
|
|
33
52
|
};
|
|
34
53
|
e.useEffect(() => {
|
|
35
|
-
|
|
36
|
-
const t = new ResizeObserver(f), r = o.current;
|
|
54
|
+
const t = new ResizeObserver(P), r = i.current;
|
|
37
55
|
return r && t.observe(r), () => {
|
|
38
56
|
r && t.unobserve(r);
|
|
39
57
|
};
|
|
40
|
-
}, [])
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
}, []), e.useLayoutEffect(() => {
|
|
59
|
+
if (!i.current || o.current.length === 0 || l.current.length === 0)
|
|
60
|
+
return;
|
|
61
|
+
const t = w();
|
|
62
|
+
if (!t || t.totalInnerWidth <= t.toolbarWidth)
|
|
63
|
+
return;
|
|
64
|
+
const r = [...l.current], n = r.pop();
|
|
65
|
+
h.current = t.toolbarWidth, l.current = r, n && (o.current = [n, ...o.current]), p();
|
|
66
|
+
});
|
|
67
|
+
const x = () => {
|
|
68
|
+
L(!g);
|
|
43
69
|
};
|
|
44
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
45
|
-
|
|
70
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, l.current.length > 0 && l.current, o.current.length > 0 && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(_, { _ref: R, className: "k-toolbar-button-separator" }), /* @__PURE__ */ e.createElement(
|
|
71
|
+
q,
|
|
46
72
|
{
|
|
47
|
-
ref:
|
|
73
|
+
ref: W,
|
|
48
74
|
className: "k-toolbar-overflow-button",
|
|
49
75
|
fillMode: "flat",
|
|
50
|
-
svgIcon:
|
|
51
|
-
title:
|
|
52
|
-
onClick:
|
|
76
|
+
svgIcon: $,
|
|
77
|
+
title: N.toLanguageString(y, j[y]),
|
|
78
|
+
onClick: x
|
|
53
79
|
}
|
|
54
80
|
), /* @__PURE__ */ e.createElement(
|
|
55
|
-
|
|
81
|
+
V,
|
|
56
82
|
{
|
|
57
|
-
anchor:
|
|
58
|
-
show:
|
|
83
|
+
anchor: i.current,
|
|
84
|
+
show: g,
|
|
59
85
|
popupClass: "k-toolbar-popup",
|
|
60
|
-
style: { width: (
|
|
86
|
+
style: { width: (k = i.current) == null ? void 0 : k.offsetWidth }
|
|
61
87
|
},
|
|
62
88
|
/* @__PURE__ */ e.createElement(
|
|
63
89
|
"span",
|
|
64
90
|
{
|
|
65
|
-
className: `k-toolbar-items-list k-toolbar-items-list-${
|
|
91
|
+
className: `k-toolbar-items-list k-toolbar-items-list-${U.sizeMap[F]} k-toolbar-items-list-${S}`
|
|
66
92
|
},
|
|
67
|
-
|
|
93
|
+
o.current.length > 0 && o.current
|
|
68
94
|
)
|
|
69
95
|
)));
|
|
70
96
|
};
|
|
71
97
|
export {
|
|
72
|
-
|
|
98
|
+
Z as ToolbarOverflowSection
|
|
73
99
|
};
|
|
@@ -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 p=require("react"),l=require("@progress/kendo-react-common"),m=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),s=require("@progress/kendo-svg-icons");function f(t){const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),l=require("@progress/kendo-react-common"),m=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),s=require("@progress/kendo-svg-icons");function f(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const e=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,e.get?e:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const i=f(p),v=t=>{const o=m.useLocalization(),{disabled:n,type:e,scrollContentRef:c,buttonScrollSpeed:a,prevButton:u,nextButton:d}=t,b=S=>{c&&c.current&&a&&c.current.scrollBy({left:e==="next"?a:-a,behavior:"smooth"})},g=e==="prev"?u||"span":d||"span";return i.createElement(g,{className:l.classNames("k-button","k-icon-button",`k-toolbar-${e}`),title:`${e==="prev"?o.toLanguageString(r.prevArrowTitle,r.messages[r.prevArrowTitle]):o.toLanguageString(r.nextArrowTitle,r.messages[r.nextArrowTitle])}`,"aria-hidden":!0,tabIndex:n?-1:void 0,onClick:b},i.createElement(l.SvgIcon,{icon:e==="prev"?s.chevronLeftIcon:s.chevronRightIcon,className:"k-button-icon"}))};exports.ToolbarScrollButton=v;
|
|
@@ -5,33 +5,31 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { classNames as
|
|
10
|
-
import { useLocalization as
|
|
11
|
-
import { prevArrowTitle as
|
|
12
|
-
import { chevronLeftIcon as
|
|
13
|
-
const L = (
|
|
14
|
-
const n =
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import { classNames as b, SvgIcon as f } from "@progress/kendo-react-common";
|
|
10
|
+
import { useLocalization as g } from "@progress/kendo-react-intl";
|
|
11
|
+
import { prevArrowTitle as a, messages as c, nextArrowTitle as l } from "../messages/index.mjs";
|
|
12
|
+
import { chevronLeftIcon as d, chevronRightIcon as h } from "@progress/kendo-svg-icons";
|
|
13
|
+
const L = (i) => {
|
|
14
|
+
const n = g(), { disabled: s, type: t, scrollContentRef: o, buttonScrollSpeed: e, prevButton: m, nextButton: p } = i, u = (S) => {
|
|
15
15
|
o && o.current && e && o.current.scrollBy({
|
|
16
16
|
left: t === "next" ? e : -e,
|
|
17
17
|
behavior: "smooth"
|
|
18
18
|
});
|
|
19
|
-
},
|
|
19
|
+
}, v = t === "prev" ? m || "span" : p || "span";
|
|
20
20
|
return (
|
|
21
21
|
// Using span instead of real Button component is intentional.
|
|
22
22
|
// Ref: https://progresssoftware.atlassian.net/wiki/spaces/DE/pages/edit-v2/544997922#Hidden-interactive-elements
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
23
|
+
/* @__PURE__ */ r.createElement(
|
|
24
|
+
v,
|
|
25
25
|
{
|
|
26
|
-
className:
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
title: `${t === "prev" ? n.toLanguageString(c, l[c]) : n.toLanguageString(i, l[i])}`,
|
|
26
|
+
className: b("k-button", "k-icon-button", `k-toolbar-${t}`),
|
|
27
|
+
title: `${t === "prev" ? n.toLanguageString(a, c[a]) : n.toLanguageString(l, c[l])}`,
|
|
30
28
|
"aria-hidden": !0,
|
|
31
|
-
tabIndex:
|
|
29
|
+
tabIndex: s ? -1 : void 0,
|
|
32
30
|
onClick: u
|
|
33
31
|
},
|
|
34
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ r.createElement(f, { icon: t === "prev" ? d : h, className: "k-button-icon" })
|
|
35
33
|
)
|
|
36
34
|
);
|
|
37
35
|
};
|