@progress/kendo-react-inputs 14.5.0-develop.8 → 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/MaskedTextBoxMcpWrapper.d.ts +17 -0
- package/MaskedTextBoxMcpWrapper.js +8 -0
- package/MaskedTextBoxMcpWrapper.mjs +18 -0
- package/README.md +4 -4
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +64 -64
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +74 -72
- package/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +57 -45
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +84 -81
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +228 -215
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +86 -94
- package/colors/interfaces/ColorPickerProps.d.ts +6 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +5 -1
- package/index.d.ts +5 -1
- package/index.js +1 -1
- package/index.mjs +92 -89
- package/maskedtextbox/MaskedTextBoxProps.d.ts +6 -1
- package/messages/index.d.ts +55 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +82 -60
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +215 -213
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +6 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +16 -11
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +23 -20
- package/radiobutton/interfaces/RadioButtonProps.d.ts +7 -0
- package/range-slider/RangeSlider.d.ts +14 -1
- package/range-slider/RangeSlider.js +11 -11
- package/range-slider/RangeSlider.mjs +188 -185
- package/rating/Rating.d.ts +6 -1
- package/rating/Rating.js +3 -3
- package/rating/Rating.mjs +83 -76
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +127 -129
- package/signature/interfaces/SignatureProps.d.ts +6 -1
- package/slider/Slider.d.ts +6 -1
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +155 -150
- package/slider/SliderLabel.js +1 -1
- package/slider/SliderLabel.mjs +3 -2
- package/switch/Switch.d.ts +6 -1
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +100 -100
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +101 -101
- package/textarea/interfaces/TextAreaProps.d.ts +6 -1
- package/textbox/Textbox.d.ts +20 -1
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +92 -81
package/colors/ColorPalette.mjs
CHANGED
|
@@ -6,76 +6,78 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as R from "react";
|
|
9
|
-
import { useRef as O, useMemo as U, useState as V, useEffect as
|
|
9
|
+
import { useRef as O, useMemo as U, useState as V, useEffect as le, useCallback as p, useImperativeHandle as M } from "react";
|
|
10
10
|
import l from "prop-types";
|
|
11
|
-
import { ColorPaletteService as
|
|
12
|
-
import { withIdHOC as
|
|
13
|
-
import { PALETTEPRESETS as
|
|
11
|
+
import { ColorPaletteService as ne } from "./utils/color-palette.service.mjs";
|
|
12
|
+
import { withIdHOC as ae, createPropsContext as ce, usePropsContext as ie, dispatchEvent as _, classNames as H, getTabIndex as ue } from "@progress/kendo-react-common";
|
|
13
|
+
import { PALETTEPRESETS as de } from "./models/palette-presets.mjs";
|
|
14
14
|
import { parseColor as $ } from "./utils/color-parser.mjs";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
import { useLocalization as fe } from "@progress/kendo-react-intl";
|
|
16
|
+
import { colorPaletteAriaLabel as K, messages as me } from "../messages/index.mjs";
|
|
17
|
+
const Ce = 24, pe = 10, we = "office", L = {
|
|
18
|
+
palette: we,
|
|
19
|
+
columns: pe,
|
|
20
|
+
tileSize: Ce
|
|
21
|
+
}, ge = ce(), be = (w) => {
|
|
22
|
+
if (Array.isArray(w))
|
|
23
|
+
return w;
|
|
24
|
+
if (typeof w == "string") {
|
|
25
|
+
const E = de[w];
|
|
26
|
+
if (E)
|
|
27
|
+
return E.colors;
|
|
26
28
|
}
|
|
27
29
|
return [];
|
|
28
|
-
}, v = R.forwardRef((
|
|
29
|
-
const
|
|
30
|
-
palette:
|
|
31
|
-
columns:
|
|
32
|
-
tileSize: c =
|
|
30
|
+
}, v = R.forwardRef((w, E) => {
|
|
31
|
+
const j = ie(ge, w), {
|
|
32
|
+
palette: A = L.palette,
|
|
33
|
+
columns: F = L.columns,
|
|
34
|
+
tileSize: c = L.tileSize,
|
|
33
35
|
value: y,
|
|
34
|
-
defaultValue:
|
|
36
|
+
defaultValue: q,
|
|
35
37
|
disabled: i = !1,
|
|
36
|
-
tabIndex:
|
|
38
|
+
tabIndex: W,
|
|
37
39
|
onChange: g,
|
|
38
|
-
onFocus:
|
|
39
|
-
className:
|
|
40
|
-
size:
|
|
41
|
-
id:
|
|
42
|
-
ariaLabelledBy:
|
|
43
|
-
ariaDescribedBy:
|
|
44
|
-
} =
|
|
40
|
+
onFocus: S,
|
|
41
|
+
className: Z,
|
|
42
|
+
size: D,
|
|
43
|
+
id: G,
|
|
44
|
+
ariaLabelledBy: J,
|
|
45
|
+
ariaDescribedBy: Q
|
|
46
|
+
} = j, k = O(null), X = O({
|
|
45
47
|
focus: () => {
|
|
46
48
|
var o;
|
|
47
49
|
(o = k.current) == null || o.focus();
|
|
48
50
|
},
|
|
49
51
|
wrapperRef: k
|
|
50
|
-
}),
|
|
51
|
-
const o = new
|
|
52
|
-
return o.setColorMatrix(f,
|
|
53
|
-
}, [f,
|
|
54
|
-
|
|
52
|
+
}), I = F != null ? F : L.columns, f = U(() => be(A), [A]), t = U(() => {
|
|
53
|
+
const o = new ne();
|
|
54
|
+
return o.setColorMatrix(f, I), o;
|
|
55
|
+
}, [f, I]), [m, T] = V(() => y !== void 0 ? y : q || ""), [x, b] = V(""), h = y !== void 0;
|
|
56
|
+
le(() => {
|
|
55
57
|
h && T(y);
|
|
56
58
|
}, [y, h]);
|
|
57
|
-
const
|
|
59
|
+
const Y = p(
|
|
58
60
|
(o) => {
|
|
59
61
|
if (i || f.length === 0)
|
|
60
62
|
return;
|
|
61
|
-
const u =
|
|
62
|
-
b(u),
|
|
63
|
+
const u = m || f[0];
|
|
64
|
+
b(u), S && S(o);
|
|
63
65
|
},
|
|
64
|
-
[i, f,
|
|
65
|
-
),
|
|
66
|
+
[i, f, m, S]
|
|
67
|
+
), ee = p(() => {
|
|
66
68
|
b("");
|
|
67
|
-
}, []),
|
|
69
|
+
}, []), oe = p(
|
|
68
70
|
(o) => {
|
|
69
71
|
if (i)
|
|
70
72
|
return;
|
|
71
|
-
const { key: u } = o, r = () => x ||
|
|
73
|
+
const { key: u } = o, r = () => x || m || f[0], C = (s, e) => s < 0 ? e : s > e ? 0 : s;
|
|
72
74
|
switch (u) {
|
|
73
75
|
case "ArrowRight":
|
|
74
76
|
o.preventDefault();
|
|
75
77
|
{
|
|
76
78
|
const s = r(), e = t.getCellCoordsFor(s);
|
|
77
79
|
if (e && t.colorRows[e.row]) {
|
|
78
|
-
const d = t.colorRows[e.row].length - 1, n =
|
|
80
|
+
const d = t.colorRows[e.row].length - 1, n = C(e.col + 1, d), a = t.colorRows[e.row][n];
|
|
79
81
|
a && b(a);
|
|
80
82
|
}
|
|
81
83
|
}
|
|
@@ -85,7 +87,7 @@ const ue = 24, de = 10, fe = "office", F = {
|
|
|
85
87
|
{
|
|
86
88
|
const s = r(), e = t.getCellCoordsFor(s);
|
|
87
89
|
if (e && t.colorRows[e.row]) {
|
|
88
|
-
const d = t.colorRows[e.row].length - 1, n =
|
|
90
|
+
const d = t.colorRows[e.row].length - 1, n = C(e.col - 1, d), a = t.colorRows[e.row][n];
|
|
89
91
|
a && b(a);
|
|
90
92
|
}
|
|
91
93
|
}
|
|
@@ -95,8 +97,8 @@ const ue = 24, de = 10, fe = "office", F = {
|
|
|
95
97
|
{
|
|
96
98
|
const s = r(), e = t.getCellCoordsFor(s);
|
|
97
99
|
if (e) {
|
|
98
|
-
const d = t.colorRows.length - 1, n =
|
|
99
|
-
|
|
100
|
+
const d = t.colorRows.length - 1, n = C(e.row + 1, d), a = Math.min(e.col, t.colorRows[n].length - 1), P = t.colorRows[n][a];
|
|
101
|
+
P && b(P);
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
break;
|
|
@@ -105,8 +107,8 @@ const ue = 24, de = 10, fe = "office", F = {
|
|
|
105
107
|
{
|
|
106
108
|
const s = r(), e = t.getCellCoordsFor(s);
|
|
107
109
|
if (e) {
|
|
108
|
-
const d = t.colorRows.length - 1, n =
|
|
109
|
-
|
|
110
|
+
const d = t.colorRows.length - 1, n = C(e.row - 1, d), a = Math.min(e.col, t.colorRows[n].length - 1), P = t.colorRows[n][a];
|
|
111
|
+
P && b(P);
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
break;
|
|
@@ -125,24 +127,24 @@ const ue = 24, de = 10, fe = "office", F = {
|
|
|
125
127
|
break;
|
|
126
128
|
}
|
|
127
129
|
},
|
|
128
|
-
[i, x,
|
|
130
|
+
[i, x, m, f, t, h, g]
|
|
129
131
|
), N = p(
|
|
130
132
|
(o, u) => {
|
|
131
133
|
if (i)
|
|
132
134
|
return;
|
|
133
135
|
const r = o;
|
|
134
136
|
if (h || T(r), g) {
|
|
135
|
-
const
|
|
137
|
+
const C = $(r, "rgba");
|
|
136
138
|
_(g, u, null, {
|
|
137
139
|
value: r,
|
|
138
|
-
rgbaValue:
|
|
140
|
+
rgbaValue: C || ""
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
143
|
},
|
|
142
144
|
[i, g, h]
|
|
143
|
-
),
|
|
144
|
-
(o, u) => o.map((r,
|
|
145
|
-
const s =
|
|
145
|
+
), z = p(
|
|
146
|
+
(o, u) => o.map((r, C) => {
|
|
147
|
+
const s = m && r.toLowerCase() === m.toLowerCase(), e = x && r.toLowerCase() === x.toLowerCase(), d = H("k-colorpalette-tile", {
|
|
146
148
|
"k-selected": s,
|
|
147
149
|
"k-focus": e
|
|
148
150
|
}), n = {
|
|
@@ -156,13 +158,13 @@ const ue = 24, de = 10, fe = "office", F = {
|
|
|
156
158
|
className: d,
|
|
157
159
|
style: n,
|
|
158
160
|
"aria-label": r,
|
|
159
|
-
"aria-selected": s ? "true" :
|
|
161
|
+
"aria-selected": s ? "true" : void 0,
|
|
160
162
|
onClick: (a) => N(r, a)
|
|
161
163
|
}
|
|
162
164
|
);
|
|
163
165
|
}),
|
|
164
|
-
[
|
|
165
|
-
),
|
|
166
|
+
[m, x, c, N]
|
|
167
|
+
), te = p(() => t.colorRows.map((u, r) => /* @__PURE__ */ R.createElement("tr", { key: u[0] || r, role: "row" }, z(u, r))), [t, z]), B = p(
|
|
166
168
|
() => ({
|
|
167
169
|
focus: () => {
|
|
168
170
|
var o;
|
|
@@ -172,29 +174,30 @@ const ue = 24, de = 10, fe = "office", F = {
|
|
|
172
174
|
}),
|
|
173
175
|
[]
|
|
174
176
|
);
|
|
175
|
-
M(
|
|
176
|
-
const
|
|
177
|
+
M(X, B), M(E, B);
|
|
178
|
+
const re = H("k-colorpalette", Z, {
|
|
177
179
|
"k-disabled": i,
|
|
178
|
-
"k-colorpalette-sm":
|
|
179
|
-
"k-colorpalette-md":
|
|
180
|
-
"k-colorpalette-lg":
|
|
181
|
-
});
|
|
180
|
+
"k-colorpalette-sm": D === "small",
|
|
181
|
+
"k-colorpalette-md": D === "medium",
|
|
182
|
+
"k-colorpalette-lg": D === "large"
|
|
183
|
+
}), se = fe();
|
|
182
184
|
return /* @__PURE__ */ R.createElement(
|
|
183
185
|
"div",
|
|
184
186
|
{
|
|
185
187
|
ref: k,
|
|
186
188
|
role: "grid",
|
|
187
|
-
className:
|
|
188
|
-
tabIndex:
|
|
189
|
-
id:
|
|
190
|
-
"aria-
|
|
191
|
-
"aria-
|
|
189
|
+
className: re,
|
|
190
|
+
tabIndex: ue(W, i),
|
|
191
|
+
id: G,
|
|
192
|
+
"aria-label": se.toLanguageString(K, me[K]),
|
|
193
|
+
"aria-labelledby": J,
|
|
194
|
+
"aria-describedby": Q,
|
|
192
195
|
"aria-disabled": i ? "true" : void 0,
|
|
193
|
-
onFocus:
|
|
194
|
-
onBlur:
|
|
195
|
-
onKeyDown:
|
|
196
|
+
onFocus: Y,
|
|
197
|
+
onBlur: ee,
|
|
198
|
+
onKeyDown: oe
|
|
196
199
|
},
|
|
197
|
-
/* @__PURE__ */ R.createElement("table", { className: "k-colorpalette-table", role: "
|
|
200
|
+
/* @__PURE__ */ R.createElement("table", { className: "k-colorpalette-table", role: "none" }, /* @__PURE__ */ R.createElement("tbody", null, te()))
|
|
198
201
|
);
|
|
199
202
|
});
|
|
200
203
|
v.displayName = "ColorPalette";
|
|
@@ -214,17 +217,17 @@ v.propTypes = {
|
|
|
214
217
|
className: l.string,
|
|
215
218
|
size: l.oneOf(["small", "medium", "large"])
|
|
216
219
|
};
|
|
217
|
-
const
|
|
220
|
+
const he = ae(
|
|
218
221
|
v
|
|
219
222
|
);
|
|
220
|
-
|
|
221
|
-
const
|
|
223
|
+
he.displayName = "KendoReactColorPalette";
|
|
224
|
+
const Fe = v;
|
|
222
225
|
export {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
he as ColorPalette,
|
|
227
|
+
ge as ColorPalettePropsContext,
|
|
228
|
+
Fe as ColorPaletteWithoutContext,
|
|
229
|
+
pe as DEFAULT_COLUMNS_COUNT,
|
|
230
|
+
we as DEFAULT_PRESET,
|
|
231
|
+
Ce as DEFAULT_TILE_SIZE,
|
|
232
|
+
L as defaultColorPaletteProps
|
|
230
233
|
};
|
package/colors/ColorPicker.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Me=require("react"),r=require("prop-types"),n=require("@progress/kendo-react-common"),be=require("../package-metadata.js"),Ve=require("./Picker.js"),He=require("./ColorGradient.js"),Y=require("./ColorPalette.js"),q=require("./FlatColorPicker.js"),We=require("@progress/kendo-react-buttons"),Ue=require("@progress/kendo-svg-icons"),u=require("../messages/index.js"),je=require("@progress/kendo-react-intl"),Ge=require("../common/AdaptiveMode.js"),Ke=require("@progress/kendo-react-layout");function $e(g){const _=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(g){for(const P in g)if(P!=="default"){const B=Object.getOwnPropertyDescriptor(g,P);Object.defineProperty(_,P,B.get?B:{enumerable:!0,get:()=>g[P]})}}return _.default=g,Object.freeze(_)}const t=$e(Me),Ze={opacity:!0},Je={palette:Y.DEFAULT_PRESET,tileSize:Y.DEFAULT_TILE_SIZE},X=g=>g!==void 0,Ee=n.createPropsContext(),ee=t.forwardRef((g,_)=>{var fe,ge;const P=!n.validatePackage(be.packageMetadata,{component:"ColorPicker"}),B=n.getLicenseMessage(be.packageMetadata),l=n.usePropsContext(Ee,g),y=je.useLocalization(),te=n.useAdaptiveModeContext(),{size:p=w.size,rounded:C=w.rounded,fillMode:M=w.fillMode,gradientSettings:S=w.gradientSettings,paletteSettings:R=w.paletteSettings,flatColorPickerSettings:A,view:v=l.views?void 0:w.view,views:d=v?void 0:w.views,activeView:ne,popupSettings:b,valid:we,disabled:V,tabIndex:Pe,icon:H,svgIcon:W,iconClassName:F,onChange:U,onFocus:j,onBlur:G,onActiveColorClick:K,className:ye,adaptive:Se,adaptiveTitle:ae=y.toLanguageString(u.colorPickerAdaptiveTitle,u.messages[u.colorPickerAdaptiveTitle]),adaptiveSubtitle:oe,showButtons:h=!0}=l,c=t.useRef(null),I=t.useRef(null),O=t.useRef(null),m=t.useRef(null),T=t.useRef(void 0),re=t.useRef(null),[he,le]=t.useState(!1),[Te,_e]=t.useState(l.defaultValue||void 0),[Re,Ae]=t.useState(!1),[D,Ie]=t.useState(),$=X(l.value),E=X(l.open),i=$?l.value:Te,f=E?l.open:Re,ie=t.useRef(i),z=t.useCallback(()=>{c.current&&c.current.focus()},[]);t.useImperativeHandle(_,()=>({element:c.current,actionElement:re.current,value:i,focus:z}),[i,z]);const ce=t.useRef(null);t.useImperativeHandle(ce,()=>({element:c.current,actionElement:re.current,value:i,focus:z}),[i,z]),n.useWebMcpRegister("colorpicker",ce,l,l.webMcp);const Z=!!(D&&te&&D<=te.medium&&Se);t.useEffect(()=>{const e=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(xe.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{document!=null&&document.body&&e&&e.disconnect()}},[]);const o=t.useCallback((e,s)=>{E||(!e&&!s&&c&&c.current&&c.current.focus(),Ae(e))},[E]),se=t.useMemo(()=>new n.Navigation({root:c,selectors:[".k-colorpicker",".k-color-picker-popup"],tabIndex:0,keyboardEvents:{keydown:{Escape:(e,s,a)=>{o(!1)},Enter:(e,s,a)=>{!E&&e===c.current&&(a.preventDefault(),a.stopPropagation(),o(!0))},ArrowDown:(e,s,a)=>{a.altKey&&(a.preventDefault(),a.stopPropagation(),o(!0))},ArrowUp:(e,s,a)=>{a.altKey&&(a.preventDefault(),a.stopPropagation(),o(!1))},Tab:(e,s,a)=>{var L,ve,ke;if(n.getActiveElement(document)!==c.current){const me=(L=O.current)==null?void 0:L.wrapperRef.current,x=(ve=I.current)==null?void 0:ve.wrapperRef.current,Ce=(ke=m.current)==null?void 0:ke.element;v==="palette"&&me?n.keepFocusInContainer(a,me):v==="gradient"&&x?n.keepFocusInContainer(a,x):v==="combo"&&x?n.keepFocusInContainer(a,x.parentElement):d&&Ce&&n.keepFocusInContainer(a,Ce)}}}}}),[o,E]),Le=t.useCallback(se.triggerKeyboardEvent.bind(se),[]),Be=t.useCallback(()=>{E||(I.current&&I.current.wrapperRef.current?n.focusFirstFocusableChild(I.current.wrapperRef.current):O.current?O.current.focus():m.current&&m.current.element&&n.focusFirstFocusableChild(m.current.element))},[E]),N=e=>ie.current=e,ue=t.useCallback(e=>{const s={value:ie.current,nativeEvent:e.nativeEvent,syntheticEvent:e};k(s),o(!f,!0)},[f]),J=t.useCallback(()=>{o(!1,!0)},[o]),Fe=t.useCallback(e=>{K&&K.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:{element:c.current,value:i}})},[K,i]),Oe=t.useCallback(e=>{T.current?(clearTimeout(T.current),T.current=void 0):(le(!0),Z&&!f&&o(!0)),j&&j.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[Z,j,f,o]),De=t.useCallback(()=>{o(!1,!0),le(!1),T.current=void 0},[]),ze=t.useCallback(e=>{clearTimeout(T.current),T.current=window.setTimeout(De),G&&G.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[G]),k=t.useCallback((e,s)=>{var L;const a=s?e.rgbaValue||"":(L=e.value)!=null?L:"";$||_e(a),U&&U.call(void 0,{value:a,nativeEvent:e.nativeEvent,syntheticEvent:e.syntheticEvent,target:{element:c.current,value:a}}),o(!1)},[$,U]),de=t.useCallback(e=>k(e,!0),[X,k]),Q=t.useCallback(e=>t.createElement(t.Fragment,null,(v==="combo"||v==="gradient")&&t.createElement(He.ColorGradient,{...S,_adaptive:e,ref:I,isInsidePopup:!0,role:"none",ariaLabel:void 0,size:e?"large":p,value:i,onChange:k}),(v==="combo"||v==="palette")&&t.createElement(Y.ColorPalette,{...R,ref:O,size:e?"large":p,value:i,onChange:de}),d&&d[0]==="gradient"&&d[1]==="palette"&&t.createElement(q.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...S},ref:m,size:e?"large":p,rounded:C,views:["gradient","palette"],activeView:ne,setOpen:o,showButtons:e?!1:h,value:i,onChange:k,setAdaptiveModeValue:N}),d&&d[0]==="palette"&&d[1]==="gradient"&&t.createElement(q.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...S},ref:m,size:e?"large":p,rounded:C,views:["palette","gradient"],setOpen:o,showButtons:e?!1:h,value:i,onChange:k,setAdaptiveModeValue:N}),d&&d.includes("gradient")&&!d.includes("palette")&&t.createElement(q.FlatColorPicker,{...A,_gradientSettings:{_adaptive:e,...S},ref:m,size:e?"large":p,rounded:C,views:["gradient"],showButtons:e?!1:h,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:N}),d&&d.includes("palette")&&!d.includes("gradient")&&t.createElement(q.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...S},ref:m,size:e?"large":p,rounded:C,views:["palette"],showButtons:e?!1:h,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:N}),P&&t.createElement(n.WatermarkOverlay,{message:B})),[ne,M,A,S,k,de,R,o,p,i,v,d]),Ne=t.useCallback(()=>{var s;const e={animation:!!((s=b==null?void 0:b.animate)==null||s),title:ae,subTitle:oe,expand:f,onClose:J,windowWidth:D,footer:h?{cancelText:y.toLanguageString(u.flatColorPickerCancelBtn,u.messages[u.flatColorPickerCancelBtn]),onCancel:J,applyText:y.toLanguageString(u.flatColorPickerApplyBtn,u.messages[u.flatColorPickerApplyBtn]),onApply:ue}:void 0};return t.createElement(Ge.AdaptiveMode,{...e},t.createElement(Ke.ActionSheetContent,null,Q(!0)))},[b==null?void 0:b.animate,ae,oe,f,J,D,h,y,ue,Q]),xe=t.useCallback(e=>{for(const s of e)Ie(s.target.clientWidth)},[]),pe=n.useDir(c,l.dir),qe=we!==!1;return t.createElement("span",{id:l.id,role:"combobox","aria-label":l.ariaLabel||y.toLanguageString(u.colorPickerAriaLabel,u.messages[u.colorPickerAriaLabel]),"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy,"aria-haspopup":"dialog","aria-expanded":f,"aria-controls":f?`k-colorpicker-popup-${(fe=l.id)!=null?fe:0}`:void 0,"aria-disabled":V?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[p]||p}`]:p,[`k-picker-${M}`]:M,[`k-rounded-${n.kendoThemeMaps.roundedMap[C]||C}`]:C,"k-invalid":!qe,"k-disabled":V,"k-focus":he,className:ye}),ref:c,tabIndex:n.getTabIndex(Pe,V),title:l.title,onKeyDown:Le,onFocus:Oe,onBlur:ze,dir:pe},t.createElement(Ve.Picker,{dir:pe,open:f,onOpen:Be,popupAnchor:c.current||void 0,popupSettings:{id:`k-colorpicker-popup-${(ge=l.id)!=null?ge:0}`,...b},input:t.createElement("span",{onClick:Fe,className:"k-input-inner"},t.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!i,"k-icon-color-preview":H||W||F})},F&&t.createElement("span",{className:n.classNames("k-color-preview-icon",F)}),!F&&(H||W)&&t.createElement(n.IconWrap,{name:H,icon:W}),t.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:i}}))),button:t.createElement(We.Button,{tabIndex:-1,type:"button",onClick:()=>o(!f),className:"k-input-button",icon:"chevron-down",svgIcon:Ue.chevronDownIcon,size:p,"aria-label":y.toLanguageString(u.colorPickerDropdownButtonAriaLabel,u.messages[u.colorPickerDropdownButtonAriaLabel])}),content:Q(!1),_mobileMode:Z,_actionSheet:Ne()}))});ee.propTypes={value:r.string,defaultValue:r.string,disabled:r.bool,view:r.oneOf(["gradient","palette","combo"]),views:r.arrayOf(r.oneOf(["gradient","palette"])),dir:r.string,id:r.string,icon:r.string,svgIcon:n.svgIconPropType,ariaLabelledBy:r.string,ariaDescribedBy:r.string,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large","full","none"]),fillMode:r.oneOf(["solid","flat","outline"]),className:r.string,adaptive:r.bool,adaptiveTitle:r.string,adaptiveSubtitle:r.string};const w={size:void 0,rounded:void 0,fillMode:void 0,view:"palette",views:["gradient","palette"],gradientSettings:Ze,paletteSettings:Je};ee.displayName="KendoColorPicker";exports.ColorPicker=ee;exports.ColorPickerPropsContext=Ee;
|