@progress/kendo-react-inputs 14.5.0-develop.14 → 14.5.0-develop.16
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/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 +162 -160
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +86 -94
- package/dist/cdn/js/kendo-react-inputs.js +1 -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 +115 -115
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
- 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 +8 -0
- package/range-slider/RangeSlider.js +11 -11
- package/range-slider/RangeSlider.mjs +189 -186
- package/rating/Rating.js +2 -2
- package/rating/Rating.mjs +3 -3
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +80 -84
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +139 -131
- package/slider/SliderLabel.js +1 -1
- package/slider/SliderLabel.mjs +3 -2
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +52 -54
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +29 -31
package/colors/ColorPicker.mjs
CHANGED
|
@@ -7,201 +7,203 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import o from "prop-types";
|
|
10
|
-
import { validatePackage as
|
|
10
|
+
import { validatePackage as Ge, getLicenseMessage as Ze, usePropsContext as je, useAdaptiveModeContext as qe, useWebMcpRegister as Je, canUseDOM as Qe, Navigation as Xe, getActiveElement as Ye, keepFocusInContainer as D, focusFirstFocusableChild as ve, WatermarkOverlay as et, useDir as tt, getTabIndex as nt, classNames as q, kendoThemeMaps as ge, IconWrap as at, createPropsContext as ot, svgIconPropType as rt } from "@progress/kendo-react-common";
|
|
11
11
|
import { packageMetadata as ke } from "../package-metadata.mjs";
|
|
12
|
-
import { Picker as
|
|
12
|
+
import { Picker as it } from "./Picker.mjs";
|
|
13
13
|
import { ColorGradient as lt } from "./ColorGradient.mjs";
|
|
14
|
-
import { DEFAULT_TILE_SIZE as
|
|
15
|
-
import { FlatColorPicker as
|
|
16
|
-
import { Button as
|
|
17
|
-
import { chevronDownIcon as
|
|
18
|
-
import { colorPickerAdaptiveTitle as Ee, messages as
|
|
19
|
-
import { useLocalization as
|
|
20
|
-
import { AdaptiveMode as
|
|
21
|
-
import { ActionSheetContent as
|
|
22
|
-
const
|
|
14
|
+
import { DEFAULT_TILE_SIZE as ct, DEFAULT_PRESET as st, ColorPalette as ut } from "./ColorPalette.mjs";
|
|
15
|
+
import { FlatColorPicker as x } from "./FlatColorPicker.mjs";
|
|
16
|
+
import { Button as dt } from "@progress/kendo-react-buttons";
|
|
17
|
+
import { chevronDownIcon as pt } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { colorPickerAdaptiveTitle as Ee, messages as T, flatColorPickerApplyBtn as be, flatColorPickerCancelBtn as Ce, colorPickerAriaLabel as we, colorPickerDropdownButtonAriaLabel as Se } from "../messages/index.mjs";
|
|
19
|
+
import { useLocalization as ft } from "@progress/kendo-react-intl";
|
|
20
|
+
import { AdaptiveMode as mt } from "../common/AdaptiveMode.mjs";
|
|
21
|
+
import { ActionSheetContent as vt } from "@progress/kendo-react-layout";
|
|
22
|
+
const gt = {
|
|
23
23
|
opacity: !0
|
|
24
|
-
},
|
|
24
|
+
}, kt = {
|
|
25
25
|
palette: st,
|
|
26
|
-
tileSize:
|
|
27
|
-
}, J = (N) => N !== void 0,
|
|
28
|
-
var
|
|
29
|
-
const
|
|
26
|
+
tileSize: ct
|
|
27
|
+
}, J = (N) => N !== void 0, Et = ot(), he = t.forwardRef((N, ye) => {
|
|
28
|
+
var se, ue;
|
|
29
|
+
const _e = !Ge(ke, { component: "ColorPicker" }), Pe = Ze(ke), r = je(Et, N), b = ft(), Q = qe(), {
|
|
30
30
|
size: u = E.size,
|
|
31
31
|
rounded: v = E.rounded,
|
|
32
32
|
fillMode: O = E.fillMode,
|
|
33
33
|
gradientSettings: C = E.gradientSettings,
|
|
34
34
|
paletteSettings: h = E.paletteSettings,
|
|
35
35
|
flatColorPickerSettings: y,
|
|
36
|
-
view:
|
|
37
|
-
views:
|
|
36
|
+
view: p = r.views ? void 0 : E.view,
|
|
37
|
+
views: s = p ? void 0 : E.views,
|
|
38
38
|
activeView: X,
|
|
39
39
|
popupSettings: g,
|
|
40
40
|
valid: Te,
|
|
41
41
|
disabled: F,
|
|
42
|
-
tabIndex:
|
|
42
|
+
tabIndex: Re,
|
|
43
43
|
icon: V,
|
|
44
44
|
svgIcon: H,
|
|
45
|
-
iconClassName:
|
|
45
|
+
iconClassName: R,
|
|
46
46
|
onChange: W,
|
|
47
47
|
onFocus: M,
|
|
48
48
|
onBlur: U,
|
|
49
49
|
onActiveColorClick: K,
|
|
50
|
-
className:
|
|
51
|
-
adaptive:
|
|
52
|
-
adaptiveTitle: Y =
|
|
50
|
+
className: Ae,
|
|
51
|
+
adaptive: Ie,
|
|
52
|
+
adaptiveTitle: Y = b.toLanguageString(Ee, T[Ee]),
|
|
53
53
|
adaptiveSubtitle: ee,
|
|
54
|
-
showButtons:
|
|
55
|
-
} = r,
|
|
56
|
-
|
|
54
|
+
showButtons: w = !0
|
|
55
|
+
} = r, l = t.useRef(null), _ = t.useRef(null), A = t.useRef(null), m = t.useRef(null), S = t.useRef(void 0), te = t.useRef(null), [Le, ne] = t.useState(!1), [Be, ze] = t.useState(r.defaultValue || void 0), [De, xe] = t.useState(!1), [I, Ne] = t.useState(), $ = J(r.value), k = J(r.open), i = $ ? r.value : Be, d = k ? r.open : De, ae = t.useRef(i), L = t.useCallback(() => {
|
|
56
|
+
l.current && l.current.focus();
|
|
57
57
|
}, []);
|
|
58
58
|
t.useImperativeHandle(
|
|
59
|
-
|
|
59
|
+
ye,
|
|
60
60
|
() => ({
|
|
61
61
|
// we agreed that each element will have focus method exposed
|
|
62
|
-
element:
|
|
62
|
+
element: l.current,
|
|
63
63
|
actionElement: te.current,
|
|
64
|
-
value:
|
|
65
|
-
focus:
|
|
64
|
+
value: i,
|
|
65
|
+
focus: L
|
|
66
66
|
}),
|
|
67
|
-
[
|
|
67
|
+
[i, L]
|
|
68
68
|
);
|
|
69
69
|
const oe = t.useRef(null);
|
|
70
70
|
t.useImperativeHandle(
|
|
71
71
|
oe,
|
|
72
72
|
() => ({
|
|
73
|
-
element:
|
|
73
|
+
element: l.current,
|
|
74
74
|
actionElement: te.current,
|
|
75
|
-
value:
|
|
76
|
-
focus:
|
|
75
|
+
value: i,
|
|
76
|
+
focus: L
|
|
77
77
|
}),
|
|
78
|
-
[
|
|
79
|
-
),
|
|
80
|
-
const G = !!(
|
|
78
|
+
[i, L]
|
|
79
|
+
), Je("colorpicker", oe, r, r.webMcp);
|
|
80
|
+
const G = !!(I && Q && I <= Q.medium && Ie);
|
|
81
81
|
t.useEffect(() => {
|
|
82
|
-
const e =
|
|
82
|
+
const e = Qe && window.ResizeObserver && new window.ResizeObserver(Ke.bind(void 0));
|
|
83
83
|
return document != null && document.body && e && e.observe(document.body), () => {
|
|
84
84
|
document != null && document.body && e && e.disconnect();
|
|
85
85
|
};
|
|
86
86
|
}, []);
|
|
87
87
|
const a = t.useCallback(
|
|
88
|
-
(e,
|
|
89
|
-
k || (!e && !
|
|
88
|
+
(e, c) => {
|
|
89
|
+
k || (!e && !c && l && l.current && l.current.focus(), xe(e));
|
|
90
90
|
},
|
|
91
91
|
[k]
|
|
92
|
-
), re = t.useMemo(() => new
|
|
93
|
-
root:
|
|
92
|
+
), re = t.useMemo(() => new Xe({
|
|
93
|
+
root: l,
|
|
94
94
|
selectors: [".k-colorpicker", ".k-color-picker-popup"],
|
|
95
95
|
tabIndex: 0,
|
|
96
96
|
keyboardEvents: {
|
|
97
97
|
keydown: {
|
|
98
|
-
Escape: (e,
|
|
98
|
+
Escape: (e, c, n) => {
|
|
99
99
|
a(!1);
|
|
100
100
|
},
|
|
101
|
-
Enter: (e,
|
|
102
|
-
!k && e ===
|
|
101
|
+
Enter: (e, c, n) => {
|
|
102
|
+
!k && e === l.current && (n.preventDefault(), n.stopPropagation(), a(!0));
|
|
103
103
|
},
|
|
104
|
-
ArrowDown: (e,
|
|
104
|
+
ArrowDown: (e, c, n) => {
|
|
105
105
|
n.altKey && (n.preventDefault(), n.stopPropagation(), a(!0));
|
|
106
106
|
},
|
|
107
|
-
ArrowUp: (e,
|
|
107
|
+
ArrowUp: (e, c, n) => {
|
|
108
108
|
n.altKey && (n.preventDefault(), n.stopPropagation(), a(!1));
|
|
109
109
|
},
|
|
110
|
-
Tab: (e,
|
|
111
|
-
var
|
|
112
|
-
if (
|
|
113
|
-
const fe = (
|
|
114
|
-
|
|
110
|
+
Tab: (e, c, n) => {
|
|
111
|
+
var P, de, pe;
|
|
112
|
+
if (Ye(document) !== l.current) {
|
|
113
|
+
const fe = (P = A.current) == null ? void 0 : P.wrapperRef.current, z = (de = _.current) == null ? void 0 : de.wrapperRef.current, me = (pe = m.current) == null ? void 0 : pe.element;
|
|
114
|
+
p === "palette" && fe ? D(n, fe) : p === "gradient" && z ? D(n, z) : p === "combo" && z ? D(n, z.parentElement) : s && me && D(n, me);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
}), [a, k]),
|
|
120
|
-
k || (_.current && _.current.wrapperRef.current ? ve(_.current.wrapperRef.current) :
|
|
121
|
-
}, [k]), B = (e) => ae.current = e,
|
|
119
|
+
}), [a, k]), Oe = t.useCallback(re.triggerKeyboardEvent.bind(re), []), Fe = t.useCallback(() => {
|
|
120
|
+
k || (_.current && _.current.wrapperRef.current ? ve(_.current.wrapperRef.current) : A.current ? A.current.focus() : m.current && m.current.element && ve(m.current.element));
|
|
121
|
+
}, [k]), B = (e) => ae.current = e, ie = t.useCallback(
|
|
122
122
|
(e) => {
|
|
123
|
-
const
|
|
123
|
+
const c = {
|
|
124
124
|
value: ae.current,
|
|
125
125
|
nativeEvent: e.nativeEvent,
|
|
126
126
|
syntheticEvent: e
|
|
127
127
|
};
|
|
128
|
-
f(
|
|
128
|
+
f(c), a(!d, !0);
|
|
129
129
|
},
|
|
130
|
-
[
|
|
130
|
+
[d]
|
|
131
131
|
), Z = t.useCallback(() => {
|
|
132
132
|
a(!1, !0);
|
|
133
|
-
}, [a]),
|
|
133
|
+
}, [a]), Ve = t.useCallback(
|
|
134
134
|
(e) => {
|
|
135
135
|
K && K.call(void 0, {
|
|
136
136
|
syntheticEvent: e,
|
|
137
137
|
nativeEvent: e.nativeEvent,
|
|
138
|
-
value:
|
|
138
|
+
value: i,
|
|
139
139
|
target: {
|
|
140
|
-
element:
|
|
141
|
-
value:
|
|
140
|
+
element: l.current,
|
|
141
|
+
value: i
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
},
|
|
145
|
-
[K,
|
|
146
|
-
),
|
|
145
|
+
[K, i]
|
|
146
|
+
), He = t.useCallback(
|
|
147
147
|
(e) => {
|
|
148
|
-
|
|
148
|
+
S.current ? (clearTimeout(S.current), S.current = void 0) : (ne(!0), G && !d && a(!0)), M && M.call(void 0, {
|
|
149
149
|
nativeEvent: e.nativeEvent,
|
|
150
150
|
syntheticEvent: e
|
|
151
151
|
});
|
|
152
152
|
},
|
|
153
|
-
[G, M,
|
|
154
|
-
),
|
|
155
|
-
a(!1, !0), ne(!1),
|
|
156
|
-
}, []),
|
|
153
|
+
[G, M, d, a]
|
|
154
|
+
), We = t.useCallback(() => {
|
|
155
|
+
a(!1, !0), ne(!1), S.current = void 0;
|
|
156
|
+
}, []), Me = t.useCallback(
|
|
157
157
|
(e) => {
|
|
158
|
-
clearTimeout(
|
|
158
|
+
clearTimeout(S.current), S.current = window.setTimeout(We), U && U.call(void 0, {
|
|
159
159
|
nativeEvent: e.nativeEvent,
|
|
160
160
|
syntheticEvent: e
|
|
161
161
|
});
|
|
162
162
|
},
|
|
163
163
|
[U]
|
|
164
164
|
), f = t.useCallback(
|
|
165
|
-
(e,
|
|
166
|
-
var
|
|
167
|
-
const n =
|
|
165
|
+
(e, c) => {
|
|
166
|
+
var P;
|
|
167
|
+
const n = c ? e.rgbaValue || "" : (P = e.value) != null ? P : "";
|
|
168
168
|
$ || ze(n), W && W.call(void 0, {
|
|
169
169
|
value: n,
|
|
170
170
|
nativeEvent: e.nativeEvent,
|
|
171
171
|
syntheticEvent: e.syntheticEvent,
|
|
172
172
|
target: {
|
|
173
|
-
element:
|
|
173
|
+
element: l.current,
|
|
174
174
|
value: n
|
|
175
175
|
}
|
|
176
176
|
}), a(!1);
|
|
177
177
|
},
|
|
178
178
|
[$, W]
|
|
179
|
-
),
|
|
179
|
+
), le = t.useCallback(
|
|
180
180
|
(e) => f(e, !0),
|
|
181
181
|
[J, f]
|
|
182
182
|
), j = t.useCallback(
|
|
183
|
-
(e) => /* @__PURE__ */ t.createElement(t.Fragment, null, (
|
|
183
|
+
(e) => /* @__PURE__ */ t.createElement(t.Fragment, null, (p === "combo" || p === "gradient") && /* @__PURE__ */ t.createElement(
|
|
184
184
|
lt,
|
|
185
185
|
{
|
|
186
186
|
...C,
|
|
187
187
|
_adaptive: e,
|
|
188
188
|
ref: _,
|
|
189
189
|
isInsidePopup: !0,
|
|
190
|
+
role: "none",
|
|
191
|
+
ariaLabel: void 0,
|
|
190
192
|
size: e ? "large" : u,
|
|
191
|
-
value:
|
|
193
|
+
value: i,
|
|
192
194
|
onChange: f
|
|
193
195
|
}
|
|
194
|
-
), (
|
|
195
|
-
|
|
196
|
+
), (p === "combo" || p === "palette") && /* @__PURE__ */ t.createElement(
|
|
197
|
+
ut,
|
|
196
198
|
{
|
|
197
199
|
...h,
|
|
198
|
-
ref:
|
|
200
|
+
ref: A,
|
|
199
201
|
size: e ? "large" : u,
|
|
200
|
-
value:
|
|
201
|
-
onChange:
|
|
202
|
+
value: i,
|
|
203
|
+
onChange: le
|
|
202
204
|
}
|
|
203
|
-
),
|
|
204
|
-
|
|
205
|
+
), s && s[0] === "gradient" && s[1] === "palette" && /* @__PURE__ */ t.createElement(
|
|
206
|
+
x,
|
|
205
207
|
{
|
|
206
208
|
...y,
|
|
207
209
|
_paletteSettings: h,
|
|
@@ -212,13 +214,13 @@ const vt = {
|
|
|
212
214
|
views: ["gradient", "palette"],
|
|
213
215
|
activeView: X,
|
|
214
216
|
setOpen: a,
|
|
215
|
-
showButtons: e ? !1 :
|
|
216
|
-
value:
|
|
217
|
+
showButtons: e ? !1 : w,
|
|
218
|
+
value: i,
|
|
217
219
|
onChange: f,
|
|
218
220
|
setAdaptiveModeValue: B
|
|
219
221
|
}
|
|
220
|
-
),
|
|
221
|
-
|
|
222
|
+
), s && s[0] === "palette" && s[1] === "gradient" && /* @__PURE__ */ t.createElement(
|
|
223
|
+
x,
|
|
222
224
|
{
|
|
223
225
|
...y,
|
|
224
226
|
_paletteSettings: h,
|
|
@@ -228,13 +230,13 @@ const vt = {
|
|
|
228
230
|
rounded: v,
|
|
229
231
|
views: ["palette", "gradient"],
|
|
230
232
|
setOpen: a,
|
|
231
|
-
showButtons: e ? !1 :
|
|
232
|
-
value:
|
|
233
|
+
showButtons: e ? !1 : w,
|
|
234
|
+
value: i,
|
|
233
235
|
onChange: f,
|
|
234
236
|
setAdaptiveModeValue: B
|
|
235
237
|
}
|
|
236
|
-
),
|
|
237
|
-
|
|
238
|
+
), s && s.includes("gradient") && !s.includes("palette") && /* @__PURE__ */ t.createElement(
|
|
239
|
+
x,
|
|
238
240
|
{
|
|
239
241
|
...y,
|
|
240
242
|
_gradientSettings: { _adaptive: e, ...C },
|
|
@@ -242,14 +244,14 @@ const vt = {
|
|
|
242
244
|
size: e ? "large" : u,
|
|
243
245
|
rounded: v,
|
|
244
246
|
views: ["gradient"],
|
|
245
|
-
showButtons: e ? !1 :
|
|
247
|
+
showButtons: e ? !1 : w,
|
|
246
248
|
setOpen: a,
|
|
247
|
-
value:
|
|
249
|
+
value: i,
|
|
248
250
|
onChange: f,
|
|
249
251
|
setAdaptiveModeValue: B
|
|
250
252
|
}
|
|
251
|
-
),
|
|
252
|
-
|
|
253
|
+
), s && s.includes("palette") && !s.includes("gradient") && /* @__PURE__ */ t.createElement(
|
|
254
|
+
x,
|
|
253
255
|
{
|
|
254
256
|
...y,
|
|
255
257
|
_paletteSettings: h,
|
|
@@ -258,135 +260,135 @@ const vt = {
|
|
|
258
260
|
size: e ? "large" : u,
|
|
259
261
|
rounded: v,
|
|
260
262
|
views: ["palette"],
|
|
261
|
-
showButtons: e ? !1 :
|
|
263
|
+
showButtons: e ? !1 : w,
|
|
262
264
|
setOpen: a,
|
|
263
|
-
value:
|
|
265
|
+
value: i,
|
|
264
266
|
onChange: f,
|
|
265
267
|
setAdaptiveModeValue: B
|
|
266
268
|
}
|
|
267
|
-
),
|
|
269
|
+
), _e && /* @__PURE__ */ t.createElement(et, { message: Pe })),
|
|
268
270
|
[
|
|
269
271
|
X,
|
|
270
272
|
O,
|
|
271
273
|
y,
|
|
272
274
|
C,
|
|
273
275
|
f,
|
|
274
|
-
|
|
276
|
+
le,
|
|
275
277
|
h,
|
|
276
278
|
a,
|
|
277
279
|
u,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
i,
|
|
281
|
+
p,
|
|
282
|
+
s
|
|
281
283
|
]
|
|
282
|
-
),
|
|
283
|
-
var
|
|
284
|
+
), Ue = t.useCallback(() => {
|
|
285
|
+
var c;
|
|
284
286
|
const e = {
|
|
285
|
-
animation: !!((
|
|
287
|
+
animation: !!((c = g == null ? void 0 : g.animate) == null || c),
|
|
286
288
|
title: Y,
|
|
287
289
|
subTitle: ee,
|
|
288
|
-
expand:
|
|
290
|
+
expand: d,
|
|
289
291
|
onClose: Z,
|
|
290
|
-
windowWidth:
|
|
291
|
-
footer:
|
|
292
|
-
cancelText:
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
windowWidth: I,
|
|
293
|
+
footer: w ? {
|
|
294
|
+
cancelText: b.toLanguageString(
|
|
295
|
+
Ce,
|
|
296
|
+
T[Ce]
|
|
295
297
|
),
|
|
296
298
|
onCancel: Z,
|
|
297
|
-
applyText:
|
|
298
|
-
onApply:
|
|
299
|
+
applyText: b.toLanguageString(be, T[be]),
|
|
300
|
+
onApply: ie
|
|
299
301
|
} : void 0
|
|
300
302
|
};
|
|
301
|
-
return /* @__PURE__ */ t.createElement(
|
|
303
|
+
return /* @__PURE__ */ t.createElement(mt, { ...e }, /* @__PURE__ */ t.createElement(vt, null, j(!0)));
|
|
302
304
|
}, [
|
|
303
305
|
g == null ? void 0 : g.animate,
|
|
304
306
|
Y,
|
|
305
307
|
ee,
|
|
306
|
-
|
|
308
|
+
d,
|
|
307
309
|
Z,
|
|
308
|
-
|
|
310
|
+
I,
|
|
311
|
+
w,
|
|
309
312
|
b,
|
|
310
|
-
|
|
311
|
-
le,
|
|
313
|
+
ie,
|
|
312
314
|
j
|
|
313
|
-
]),
|
|
314
|
-
for (const
|
|
315
|
-
|
|
316
|
-
}, []),
|
|
315
|
+
]), Ke = t.useCallback((e) => {
|
|
316
|
+
for (const c of e)
|
|
317
|
+
Ne(c.target.clientWidth);
|
|
318
|
+
}, []), ce = tt(l, r.dir), $e = Te !== !1;
|
|
317
319
|
return /* @__PURE__ */ t.createElement(
|
|
318
320
|
"span",
|
|
319
321
|
{
|
|
320
322
|
id: r.id,
|
|
321
323
|
role: "combobox",
|
|
322
|
-
"aria-label": r.ariaLabel,
|
|
324
|
+
"aria-label": r.ariaLabel || b.toLanguageString(we, T[we]),
|
|
323
325
|
"aria-labelledby": r.ariaLabelledBy,
|
|
324
326
|
"aria-describedby": r.ariaDescribedBy,
|
|
325
327
|
"aria-haspopup": "dialog",
|
|
326
|
-
"aria-expanded":
|
|
327
|
-
"aria-controls": `k-colorpicker-popup-${(
|
|
328
|
+
"aria-expanded": d,
|
|
329
|
+
"aria-controls": d ? `k-colorpicker-popup-${(se = r.id) != null ? se : 0}` : void 0,
|
|
328
330
|
"aria-disabled": F ? "true" : void 0,
|
|
329
331
|
className: q("k-colorpicker", "k-picker", "k-icon-picker", {
|
|
330
332
|
[`k-picker-${ge.sizeMap[u] || u}`]: u,
|
|
331
333
|
[`k-picker-${O}`]: O,
|
|
332
334
|
[`k-rounded-${ge.roundedMap[v] || v}`]: v,
|
|
333
|
-
"k-invalid":
|
|
335
|
+
"k-invalid": !$e,
|
|
334
336
|
"k-disabled": F,
|
|
335
|
-
"k-focus":
|
|
336
|
-
className:
|
|
337
|
+
"k-focus": Le,
|
|
338
|
+
className: Ae
|
|
337
339
|
}),
|
|
338
|
-
ref:
|
|
339
|
-
tabIndex:
|
|
340
|
+
ref: l,
|
|
341
|
+
tabIndex: nt(Re, F),
|
|
340
342
|
title: r.title,
|
|
341
|
-
onKeyDown:
|
|
342
|
-
onFocus:
|
|
343
|
-
onBlur:
|
|
344
|
-
dir:
|
|
343
|
+
onKeyDown: Oe,
|
|
344
|
+
onFocus: He,
|
|
345
|
+
onBlur: Me,
|
|
346
|
+
dir: ce
|
|
345
347
|
},
|
|
346
348
|
/* @__PURE__ */ t.createElement(
|
|
347
|
-
|
|
349
|
+
it,
|
|
348
350
|
{
|
|
349
|
-
dir:
|
|
350
|
-
open:
|
|
351
|
-
onOpen:
|
|
352
|
-
popupAnchor:
|
|
351
|
+
dir: ce,
|
|
352
|
+
open: d,
|
|
353
|
+
onOpen: Fe,
|
|
354
|
+
popupAnchor: l.current || void 0,
|
|
353
355
|
popupSettings: { id: `k-colorpicker-popup-${(ue = r.id) != null ? ue : 0}`, ...g },
|
|
354
|
-
input: /* @__PURE__ */ t.createElement("span", { onClick:
|
|
356
|
+
input: /* @__PURE__ */ t.createElement("span", { onClick: Ve, className: "k-input-inner" }, /* @__PURE__ */ t.createElement(
|
|
355
357
|
"span",
|
|
356
358
|
{
|
|
357
359
|
className: q("k-value-icon", "k-color-preview", {
|
|
358
|
-
"k-no-color": !
|
|
359
|
-
"k-icon-color-preview": V || H ||
|
|
360
|
+
"k-no-color": !i,
|
|
361
|
+
"k-icon-color-preview": V || H || R
|
|
360
362
|
})
|
|
361
363
|
},
|
|
362
|
-
|
|
363
|
-
!
|
|
364
|
-
/* @__PURE__ */ t.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor:
|
|
364
|
+
R && /* @__PURE__ */ t.createElement("span", { className: q("k-color-preview-icon", R) }),
|
|
365
|
+
!R && (V || H) && /* @__PURE__ */ t.createElement(at, { name: V, icon: H }),
|
|
366
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: i } })
|
|
365
367
|
)),
|
|
366
368
|
button: /* @__PURE__ */ t.createElement(
|
|
367
|
-
|
|
369
|
+
dt,
|
|
368
370
|
{
|
|
369
371
|
tabIndex: -1,
|
|
370
372
|
type: "button",
|
|
371
|
-
onClick: () => a(!
|
|
373
|
+
onClick: () => a(!d),
|
|
372
374
|
className: "k-input-button",
|
|
373
375
|
icon: "chevron-down",
|
|
374
|
-
svgIcon:
|
|
376
|
+
svgIcon: pt,
|
|
375
377
|
size: u,
|
|
376
|
-
"aria-label":
|
|
377
|
-
|
|
378
|
-
|
|
378
|
+
"aria-label": b.toLanguageString(
|
|
379
|
+
Se,
|
|
380
|
+
T[Se]
|
|
379
381
|
)
|
|
380
382
|
}
|
|
381
383
|
),
|
|
382
384
|
content: j(!1),
|
|
383
385
|
_mobileMode: G,
|
|
384
|
-
_actionSheet:
|
|
386
|
+
_actionSheet: Ue()
|
|
385
387
|
}
|
|
386
388
|
)
|
|
387
389
|
);
|
|
388
390
|
});
|
|
389
|
-
|
|
391
|
+
he.propTypes = {
|
|
390
392
|
value: o.string,
|
|
391
393
|
defaultValue: o.string,
|
|
392
394
|
disabled: o.bool,
|
|
@@ -395,7 +397,7 @@ Se.propTypes = {
|
|
|
395
397
|
dir: o.string,
|
|
396
398
|
id: o.string,
|
|
397
399
|
icon: o.string,
|
|
398
|
-
svgIcon:
|
|
400
|
+
svgIcon: rt,
|
|
399
401
|
ariaLabelledBy: o.string,
|
|
400
402
|
ariaDescribedBy: o.string,
|
|
401
403
|
size: o.oneOf(["small", "medium", "large"]),
|
|
@@ -412,11 +414,11 @@ const E = {
|
|
|
412
414
|
fillMode: void 0,
|
|
413
415
|
view: "palette",
|
|
414
416
|
views: ["gradient", "palette"],
|
|
415
|
-
gradientSettings:
|
|
416
|
-
paletteSettings:
|
|
417
|
+
gradientSettings: gt,
|
|
418
|
+
paletteSettings: kt
|
|
417
419
|
};
|
|
418
|
-
|
|
420
|
+
he.displayName = "KendoColorPicker";
|
|
419
421
|
export {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
+
he as ColorPicker,
|
|
423
|
+
Et as ColorPickerPropsContext
|
|
422
424
|
};
|
|
@@ -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 X=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),s=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-svg-icons"),Y=require("./ColorPalette.js"),Z=require("./ColorGradient.js"),x=require("../package-metadata.js"),p=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function ee(e){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const f in e)if(f!=="default"){const B=Object.getOwnPropertyDescriptor(e,f);Object.defineProperty(b,f,B.get?B:{enumerable:!0,get:()=>e[f]})}}return b.default=e,Object.freeze(b)}const t=ee(X),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),s=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-svg-icons"),Y=require("./ColorPalette.js"),Z=require("./ColorGradient.js"),x=require("../package-metadata.js"),p=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function ee(e){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const f in e)if(f!=="default"){const B=Object.getOwnPropertyDescriptor(e,f);Object.defineProperty(b,f,B.get?B:{enumerable:!0,get:()=>e[f]})}}return b.default=e,Object.freeze(b)}const t=ee(X),_=t.forwardRef((e,b)=>{const f=!n.validatePackage(x.packageMetadata,{component:"FlatColorPicker"}),B=n.getLicenseMessage(x.packageMetadata),h=t.useRef(null),w=t.useRef(null),F=t.useRef(null),{defaultValue:P,showButtons:N=!0,showPreview:z=!0,showClearButton:T=!0,view:E=e.views?void 0:"ColorGradient",views:d=E?void 0:["gradient","palette"],activeView:S="gradient",size:i=void 0,rounded:j=void 0}=e,[C,D]=t.useState((E||"ColorGradient")==="ColorGradient"),[v,V]=t.useState((d!=null?d:[])[0]==="gradient"&&S==="gradient"),[c,y]=t.useState(e.value||P||void 0),[k,M]=t.useState(e.value||P||void 0),L=e.value!==void 0?e.value:void 0;t.useEffect(()=>{y(e.value)},[e.value]);const g=p.useLocalization(),A=t.useCallback(()=>{h.current&&h.current.focus()},[h]);t.useImperativeHandle(h,()=>({element:w.current,focus:A,props:e,value:L}),[L,A,e]),t.useImperativeHandle(b,()=>h.current);const R=t.useCallback(a=>{(a==="ColorGradient"&&!C||a==="ColorPalette"&&C)&&D(!C)},[C]),I=t.useCallback(a=>{a==="gradient"&&!v||a==="palette"&&v||a==="palette"&&S==="gradient"?V(!v):a==="gradient"&&S==="palette"&&V(!0)},[S,v]),K=t.useCallback(a=>{var u;const r=P||void 0;if(y(r),M(r),(u=e._gradientSettings)!=null&&u._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(r),e.onPreviewChange){const G={value:r,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,G)}},[P,e.onPreviewChange]),q=t.useCallback(a=>{var r;if(y(a.value),e.onPreviewChange){const u={value:a.value,nativeEvent:a.nativeEvent,syntheticEvent:a.syntheticEvent};e.onPreviewChange.call(void 0,u)}(r=e._gradientSettings)!=null&&r._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(a.value)},[e.onPreviewChange]),H=t.useCallback(a=>{if(c!==void 0&&M(c),e.onChange){const r={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,r)}},[c,e.onChange]),W=t.useCallback(()=>{y(k),e.setOpen&&e.setOpen(!1)},[k]),$=t.useCallback(a=>{if(y(k),e.onPreviewChange){const r={value:k,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,r)}},[k,e.onPreviewChange]),J=t.useCallback(a=>{var u,G;if((!a.relatedTarget||!((u=w.current)!=null&&u.contains(a.relatedTarget)))&&!((G=e._gradientSettings)!=null&&G._adaptive)&&(!N&&c!==void 0&&M(c),!N&&e.onChange)){const U={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,U)}},[c,N,e.onChange]),O=t.useMemo(()=>new n.Navigation({root:w,selectors:[".k-coloreditor"],tabIndex:0,keyboardEvents:{keydown:{Tab:(a,r,u)=>{n.getActiveElement(document)===a?n.disableNavigatableContainer(a):n.keepFocusInContainer(u,a)},Enter:(a,r,u)=>{n.getActiveElement(document)===a&&(n.focusFirstFocusableChild(a),n.enableNavigatableContainer(a))},Escape:(a,r,u)=>{n.getActiveElement(document)!==a&&(a.focus(),n.disableNavigatableContainer(a))}}}}),[]),Q=t.useCallback(O.triggerKeyboardEvent.bind(O),[]);return t.createElement("div",{id:e.id,role:"textbox","aria-label":e.ariaLabel||g.toLanguageString(l.flatColorPickerAriaLabel,l.messages[l.flatColorPickerAriaLabel]),"aria-labelledby":e.ariaLabelledBy,"aria-disabled":e.disabled?"true":void 0,style:{position:"relative",...e.style},ref:w,tabIndex:n.getTabIndex(e.tabIndex,e.disabled),className:n.classNames("k-flatcolorpicker k-coloreditor",{[`k-coloreditor-${n.kendoThemeMaps.sizeMap[i]||i}`]:i,"k-disabled":e.disabled},e.className),onBlur:J,onKeyDown:Q},e.header||t.createElement("div",{className:"k-coloreditor-header k-hstack"},t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},d&&d[0]==="gradient"&&d[1]==="palette"&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),size:i,fillMode:"flat",svgIcon:m.dropletSliderIcon,className:v?"k-selected":void 0,onClick:()=>I("gradient")}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),size:i,fillMode:"flat",svgIcon:m.paletteIcon,className:v?void 0:"k-selected",onClick:()=>I("palette")})),d&&d[0]==="palette"&&d[1]==="gradient"&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),fillMode:"flat",size:i,svgIcon:m.paletteIcon,className:v?void 0:"k-selected",onClick:()=>I("palette")}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),fillMode:"flat",size:i,svgIcon:m.dropletSliderIcon,className:v?"k-selected":void 0,onClick:()=>I("gradient")})),E&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),fillMode:"flat",size:i,className:C?"k-selected":void 0,onClick:()=>R("ColorGradient"),icon:"droplet-slider",svgIcon:m.dropletSliderIcon}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),fillMode:"flat",size:i,className:C?void 0:"k-selected",onClick:()=>R("ColorPalette"),icon:"palette",svgIcon:m.paletteIcon}))),t.createElement("div",{className:"k-spacer"}),t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},T&&t.createElement(s.Button,{type:"button",fillMode:"flat",size:i,onClick:K,"aria-label":g.toLanguageString(l.flatColorPickerClearBtn,l.messages[l.flatColorPickerClearBtn]),icon:"droplet-slash",svgIcon:m.dropletSlashIcon}),z&&t.createElement("div",{className:"k-coloreditor-preview k-vstack"},t.createElement("span",{className:n.classNames("k-coloreditor-preview-color","k-color-preview",{"k-no-color":L===void 0})},t.createElement("span",{className:"k-color-preview-mask",style:{background:c||void 0}})),t.createElement("span",{className:n.classNames("k-coloreditor-current-color","k-color-preview",{"k-no-color":k===void 0}),onClick:$},t.createElement("span",{className:"k-color-preview-mask",style:{background:k||void 0}})))),f&&t.createElement(n.WatermarkOverlay,{message:B})),t.createElement("div",{className:"k-coloreditor-views k-vstack"},(E&&C||d&&v)&&t.createElement(Z.ColorGradient,{ref:F,role:"none",ariaLabel:void 0,value:c,onChange:q,opacity:e.opacity,format:e.format,size:i,rounded:j,_adaptive:e._gradientSettings?e._gradientSettings._adaptive:void 0,...e._gradientSettings}),(E&&!C||d&&!v)&&t.createElement(Y.ColorPalette,{value:c,onChange:q,size:i,...e._paletteSettings})),N&&t.createElement("div",{className:"k-coloreditor-footer k-actions k-actions-start k-actions-horizontal"},t.createElement(s.Button,{type:"button",themeColor:"primary",className:"k-coloreditor-apply",onClick:H},g.toLanguageString(l.flatColorPickerApplyBtn,l.messages[l.flatColorPickerApplyBtn])),t.createElement(s.Button,{type:"button",className:"k-coloreditor-cancel",onClick:W},g.toLanguageString(l.flatColorPickerCancelBtn,l.messages[l.flatColorPickerCancelBtn]))))}),te={id:o.string,style:o.any,className:o.string,value:o.string,defaultValue:o.string,onPreviewChange:o.func,onChange:o.func,opacity:o.bool,format:o.any,tabIndex:o.number,ariaLabel:o.string,ariaLabelledBy:o.string,disabled:o.bool,view:o.any,header:o.any,showClearButton:o.bool,showPreview:o.bool,showButtons:o.bool,views:o.array,size:o.oneOf(["small","medium","large"])};_.displayName="KendoFlatColorPicker";_.propTypes=te;exports.FlatColorPicker=_;
|