@progress/kendo-react-buttons 14.5.0-develop.1 → 14.5.0-develop.11
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 +2 -2
- package/Button.js +1 -1
- package/Button.mjs +31 -33
- package/Chip/Chip.js +1 -1
- package/Chip/Chip.mjs +36 -36
- package/FloatingActionButton/FloatingActionButton.js +1 -1
- package/FloatingActionButton/FloatingActionButton.mjs +72 -82
- package/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +1 -7
- package/FloatingActionButton/models/size.d.ts +2 -1
- package/FloatingActionButton/models/theme-color.d.ts +2 -8
- package/ListButton/DropDownButton.js +1 -1
- package/ListButton/DropDownButton.mjs +0 -2
- package/ListButton/SplitButton.js +1 -1
- package/ListButton/SplitButton.mjs +2 -4
- package/ListButton/models/ListButtonProps.d.ts +2 -2
- package/SegmentedControl/SegmentedControl.js +1 -1
- package/SegmentedControl/SegmentedControl.mjs +28 -27
- package/SpeechToTextButton/SpeechToTextButton.js +1 -1
- package/SpeechToTextButton/SpeechToTextButton.mjs +10 -10
- package/dist/cdn/js/kendo-react-buttons.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -6
- package/toolbar/tools/ToolbarOverflowSection.js +1 -1
- package/toolbar/tools/ToolbarOverflowSection.mjs +64 -40
- package/toolbar/tools/ToolbarScrollButton.js +1 -1
- package/toolbar/tools/ToolbarScrollButton.mjs +9 -9
|
@@ -5,69 +5,93 @@
|
|
|
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 $ } from "@progress/kendo-react-intl";
|
|
12
|
+
import { kendoThemeMaps as H } from "@progress/kendo-react-common";
|
|
13
|
+
import { ToolbarSeparator as U } 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 tt = (M) => {
|
|
17
|
+
var T;
|
|
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 = $(), [D, 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), m = c.map((s) => Math.ceil(s.clientWidth)), a = m.reduce((s, b) => s + b, 0) + c.length * n + n * 2;
|
|
25
|
+
return { toolbarWidth: r, gap: n, childWidths: m, totalInnerWidth: a };
|
|
26
|
+
}, P = () => {
|
|
27
|
+
var k, E, C, z, I;
|
|
28
|
+
const t = w();
|
|
29
|
+
if (!t)
|
|
22
30
|
return;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
const { toolbarWidth: r, gap: n, childWidths: c, totalInnerWidth: m } = t;
|
|
32
|
+
let a = m, s = !1;
|
|
33
|
+
const b = o.current.length > 0, d = [...l.current], v = [...o.current];
|
|
34
|
+
for (; a > r && d.length > 0; ) {
|
|
35
|
+
const u = d.pop(), f = d.length;
|
|
36
|
+
if (u && v.unshift(u), f < c.length && (a -= c[f] + n), !s && !b) {
|
|
37
|
+
const A = Math.ceil((E = (k = R.current) == null ? void 0 : k.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);
|
|
38
|
+
a += A + B + n * 2;
|
|
39
|
+
}
|
|
40
|
+
s = !0;
|
|
41
|
+
}
|
|
42
|
+
if (s) {
|
|
43
|
+
l.current = d, o.current = v, h.current = r, p();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (o.current.length > 0 && r > h.current + n * c.length) {
|
|
47
|
+
const u = [...o.current], f = u.shift();
|
|
48
|
+
o.current = u, f && (l.current = [...l.current, f]), h.current = r, p();
|
|
31
49
|
}
|
|
32
|
-
E();
|
|
33
50
|
};
|
|
34
51
|
e.useEffect(() => {
|
|
35
|
-
|
|
36
|
-
const t = new ResizeObserver(f), r = o.current;
|
|
52
|
+
const t = new ResizeObserver(P), r = i.current;
|
|
37
53
|
return r && t.observe(r), () => {
|
|
38
54
|
r && t.unobserve(r);
|
|
39
55
|
};
|
|
40
|
-
}, [])
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
}, []), e.useLayoutEffect(() => {
|
|
57
|
+
if (!i.current || o.current.length === 0 || l.current.length === 0)
|
|
58
|
+
return;
|
|
59
|
+
const t = w();
|
|
60
|
+
if (!t || t.totalInnerWidth <= t.toolbarWidth)
|
|
61
|
+
return;
|
|
62
|
+
const r = [...l.current], n = r.pop();
|
|
63
|
+
h.current = t.toolbarWidth, l.current = r, n && (o.current = [n, ...o.current]), p();
|
|
64
|
+
});
|
|
65
|
+
const x = () => {
|
|
66
|
+
L(!g);
|
|
43
67
|
};
|
|
44
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
45
|
-
|
|
68
|
+
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(U, { _ref: R, className: "k-toolbar-button-separator" }), /* @__PURE__ */ e.createElement(
|
|
69
|
+
q,
|
|
46
70
|
{
|
|
47
|
-
ref:
|
|
71
|
+
ref: W,
|
|
48
72
|
className: "k-toolbar-overflow-button",
|
|
49
73
|
fillMode: "flat",
|
|
50
|
-
svgIcon:
|
|
51
|
-
title:
|
|
52
|
-
onClick:
|
|
74
|
+
svgIcon: _,
|
|
75
|
+
title: N.toLanguageString(y, j[y]),
|
|
76
|
+
onClick: x
|
|
53
77
|
}
|
|
54
78
|
), /* @__PURE__ */ e.createElement(
|
|
55
|
-
|
|
79
|
+
V,
|
|
56
80
|
{
|
|
57
|
-
anchor:
|
|
58
|
-
show:
|
|
81
|
+
anchor: i.current,
|
|
82
|
+
show: g,
|
|
59
83
|
popupClass: "k-toolbar-popup",
|
|
60
|
-
style: { width: (
|
|
84
|
+
style: { width: (T = i.current) == null ? void 0 : T.offsetWidth }
|
|
61
85
|
},
|
|
62
86
|
/* @__PURE__ */ e.createElement(
|
|
63
87
|
"span",
|
|
64
88
|
{
|
|
65
|
-
className: `k-toolbar-items-list k-toolbar-items-list-${
|
|
89
|
+
className: `k-toolbar-items-list k-toolbar-items-list-${H.sizeMap[F]} k-toolbar-items-list-${S}`
|
|
66
90
|
},
|
|
67
|
-
|
|
91
|
+
o.current.length > 0 && o.current
|
|
68
92
|
)
|
|
69
93
|
)));
|
|
70
94
|
};
|
|
71
95
|
export {
|
|
72
|
-
|
|
96
|
+
tt as ToolbarOverflowSection
|
|
73
97
|
};
|
|
@@ -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 n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const e=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,e.get?e:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const i=f(p),
|
|
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 n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const e=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,e.get?e:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const i=f(p),v=t=>{const n=m.useLocalization(),{disabled:o,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}`,{"k-disabled":o}),title:`${e==="prev"?n.toLanguageString(r.prevArrowTitle,r.messages[r.prevArrowTitle]):n.toLanguageString(r.nextArrowTitle,r.messages[r.nextArrowTitle])}`,"aria-hidden":!0,tabIndex:o?-1:void 0,onClick:b},i.createElement(l.SvgIcon,{icon:e==="prev"?s.chevronLeftIcon:s.chevronRightIcon,className:"k-button-icon"}))};exports.ToolbarScrollButton=v;
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as a from "react";
|
|
9
|
-
import { classNames as d, SvgIcon as
|
|
10
|
-
import { useLocalization as
|
|
11
|
-
import { prevArrowTitle as
|
|
12
|
-
import {
|
|
13
|
-
const
|
|
14
|
-
const n =
|
|
9
|
+
import { classNames as d, SvgIcon as v } from "@progress/kendo-react-common";
|
|
10
|
+
import { useLocalization as f } from "@progress/kendo-react-intl";
|
|
11
|
+
import { prevArrowTitle as c, messages as l, nextArrowTitle as i } from "../messages/index.mjs";
|
|
12
|
+
import { chevronLeftIcon as g, chevronRightIcon as h } from "@progress/kendo-svg-icons";
|
|
13
|
+
const L = (s) => {
|
|
14
|
+
const n = f(), { disabled: r, type: t, scrollContentRef: o, buttonScrollSpeed: e, prevButton: m, nextButton: p } = s, u = (S) => {
|
|
15
15
|
o && o.current && e && o.current.scrollBy({
|
|
16
16
|
left: t === "next" ? e : -e,
|
|
17
17
|
behavior: "smooth"
|
|
@@ -26,15 +26,15 @@ const I = (s) => {
|
|
|
26
26
|
className: d("k-button", "k-icon-button", `k-toolbar-${t}`, {
|
|
27
27
|
"k-disabled": r
|
|
28
28
|
}),
|
|
29
|
-
title: `${t === "prev" ? n.toLanguageString(
|
|
29
|
+
title: `${t === "prev" ? n.toLanguageString(c, l[c]) : n.toLanguageString(i, l[i])}`,
|
|
30
30
|
"aria-hidden": !0,
|
|
31
31
|
tabIndex: r ? -1 : void 0,
|
|
32
32
|
onClick: u
|
|
33
33
|
},
|
|
34
|
-
/* @__PURE__ */ a.createElement(
|
|
34
|
+
/* @__PURE__ */ a.createElement(v, { icon: t === "prev" ? g : h, className: "k-button-icon" })
|
|
35
35
|
)
|
|
36
36
|
);
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
L as ToolbarScrollButton
|
|
40
40
|
};
|