@progress/kendo-react-inputs 13.3.0 → 13.4.0-develop.2
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.d.ts +49 -0
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +35 -36
- package/checkbox/interfaces/CheckboxBlurEvent.d.ts +14 -0
- package/checkbox/interfaces/CheckboxChangeEvent.d.ts +18 -0
- package/checkbox/interfaces/CheckboxFocusEvent.d.ts +14 -0
- package/checkbox/interfaces/CheckboxProps.d.ts +148 -0
- package/colors/ColorContrastLabels.d.ts +22 -0
- package/colors/ColorContrastSvg.d.ts +25 -0
- package/colors/ColorGradient.d.ts +215 -0
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +20 -19
- package/colors/ColorInput.d.ts +40 -0
- package/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +20 -16
- package/colors/ColorPalette.d.ts +129 -0
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +7 -7
- package/colors/ColorPicker.d.ts +34 -0
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +96 -94
- package/colors/FlatColorPicker.d.ts +189 -0
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +41 -40
- package/colors/HexInput.d.ts +39 -0
- package/colors/HexInput.js +1 -1
- package/colors/HexInput.mjs +2 -1
- package/colors/Picker.d.ts +13 -0
- package/colors/interfaces/ColorGradientChangeEvent.d.ts +18 -0
- package/colors/interfaces/ColorGradientProps.d.ts +160 -0
- package/colors/interfaces/ColorPaletteChangeEvent.d.ts +22 -0
- package/colors/interfaces/ColorPaletteProps.d.ts +116 -0
- package/colors/interfaces/ColorPickerActiveColorClick.d.ts +29 -0
- package/colors/interfaces/ColorPickerBlurEvent.d.ts +20 -0
- package/colors/interfaces/ColorPickerChangeEvent.d.ts +29 -0
- package/colors/interfaces/ColorPickerFocusEvent.d.ts +20 -0
- package/colors/interfaces/ColorPickerGradientSettings.d.ts +29 -0
- package/colors/interfaces/ColorPickerPaletteSettings.d.ts +39 -0
- package/colors/interfaces/ColorPickerPopupSettings.d.ts +21 -0
- package/colors/interfaces/ColorPickerProps.d.ts +242 -0
- package/colors/interfaces/ColorPickerView.d.ts +17 -0
- package/colors/interfaces/PickerPopupSettings.d.ts +29 -0
- package/colors/interfaces/PickerProps.d.ts +57 -0
- package/colors/models/hsva.d.ts +16 -0
- package/colors/models/output-format.d.ts +11 -0
- package/colors/models/palette-presets.d.ts +60 -0
- package/colors/models/rgb.d.ts +15 -0
- package/colors/models/rgba.d.ts +16 -0
- package/colors/models/table-cell.d.ts +14 -0
- package/colors/models/tile-size.d.ts +18 -0
- package/colors/utils/color-cache.d.ts +37 -0
- package/colors/utils/color-palette.service.d.ts +19 -0
- package/colors/utils/color-parser.d.ts +72 -0
- package/colors/utils/color-parser.js +1 -1
- package/colors/utils/color-parser.mjs +1 -1
- package/colors/utils/misc.d.ts +23 -0
- package/colors/utils/svg-calc.d.ts +69 -0
- package/common/AdaptiveMode.d.ts +21 -0
- package/common/SliderTooltip.d.ts +25 -0
- package/common/SwitchController.d.ts +38 -0
- package/common/SwitchModel.d.ts +14 -0
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +72 -5128
- package/index.d.ts +72 -5128
- package/input/Input.d.ts +119 -0
- package/input/Input.js +1 -1
- package/input/Input.mjs +45 -43
- package/input/InputClearValue.d.ts +28 -0
- package/input/InputPrefix.d.ts +30 -0
- package/input/InputSeparator.d.ts +30 -0
- package/input/InputSuffix.d.ts +32 -0
- package/input/InputValidationIcon.d.ts +21 -0
- package/input/interfaces/InputChangeEvent.d.ts +18 -0
- package/interfaces/Direction.d.ts +8 -0
- package/interfaces/ToggleBaseProps.d.ts +24 -0
- package/maskedtextbox/MaskedTextBox.d.ts +224 -0
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +80 -79
- package/maskedtextbox/MaskedTextBoxProps.d.ts +273 -0
- package/maskedtextbox/masking.service.d.ts +48 -0
- package/maskedtextbox/masking.service.mjs +9 -9
- package/maskedtextbox/parsing/combinators.d.ts +16 -0
- package/maskedtextbox/parsing/parsers.d.ts +54 -0
- package/maskedtextbox/parsing/result.d.ts +30 -0
- package/maskedtextbox/parsing/stream.d.ts +29 -0
- package/maskedtextbox/utils.d.ts +23 -0
- package/messages/index.d.ts +177 -0
- package/numerictextbox/NumericTextBox.d.ts +21 -0
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +161 -161
- package/numerictextbox/interfaces/NumericTextBoxBlurEvent.d.ts +14 -0
- package/numerictextbox/interfaces/NumericTextBoxChangeEvent.d.ts +18 -0
- package/numerictextbox/interfaces/NumericTextBoxFocusEvent.d.ts +14 -0
- package/numerictextbox/interfaces/NumericTextBoxHandle.d.ts +46 -0
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +212 -0
- package/numerictextbox/interfaces/NumericTextBoxState.d.ts +22 -0
- package/numerictextbox/utils/index.d.ts +126 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +10 -10
- package/radiobutton/RadioButton.d.ts +36 -0
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +8 -8
- package/radiobutton/RadioGroup.d.ts +36 -0
- package/radiobutton/interfaces/RadioButtonBlurEvent.d.ts +14 -0
- package/radiobutton/interfaces/RadioButtonChangeEvent.d.ts +18 -0
- package/radiobutton/interfaces/RadioButtonFocusEvent.d.ts +14 -0
- package/radiobutton/interfaces/RadioButtonProps.d.ts +107 -0
- package/radiobutton/interfaces/RadioGroupChangeEvent.d.ts +18 -0
- package/radiobutton/interfaces/RadioGroupFocusEvent.d.ts +14 -0
- package/radiobutton/interfaces/RadioGroupProps.d.ts +178 -0
- package/range-slider/RangeSlider.d.ts +152 -0
- package/range-slider/range-raducer.d.ts +46 -0
- package/rating/Rating.d.ts +302 -0
- package/rating/Rating.mjs +3 -3
- package/rating/RatingItem.d.ts +111 -0
- package/rating/models/index.d.ts +91 -0
- package/rating/rating-reducer.d.ts +39 -0
- package/rating/utils/index.d.ts +31 -0
- package/signature/Signature.d.ts +21 -0
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +26 -23
- package/signature/interfaces/SignatureBlurEvent.d.ts +14 -0
- package/signature/interfaces/SignatureChangeEvent.d.ts +18 -0
- package/signature/interfaces/SignatureCloseEvent.d.ts +14 -0
- package/signature/interfaces/SignatureFocusEvent.d.ts +14 -0
- package/signature/interfaces/SignatureHandle.d.ts +49 -0
- package/signature/interfaces/SignatureOpenEvent.d.ts +14 -0
- package/signature/interfaces/SignatureProps.d.ts +324 -0
- package/signature/interfaces/index.d.ts +14 -0
- package/signature/utils/index.d.ts +11 -0
- package/slider/Slider.d.ts +288 -0
- package/slider/Slider.mjs +9 -9
- package/slider/SliderLabel.d.ts +51 -0
- package/switch/Switch.d.ts +397 -0
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +29 -22
- package/textarea/TextArea.d.ts +40 -0
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +41 -41
- package/textarea/interfaces/TextAreaBlurEvent.d.ts +14 -0
- package/textarea/interfaces/TextAreaChangeEvent.d.ts +18 -0
- package/textarea/interfaces/TextAreaFocusEvent.d.ts +14 -0
- package/textarea/interfaces/TextAreaProps.d.ts +199 -0
- package/textbox/Textbox.d.ts +99 -0
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +70 -66
- package/utils.d.ts +11 -0
package/colors/ColorPicker.mjs
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import r from "prop-types";
|
|
10
|
-
import { createPropsContext as Ke, validatePackage as $e, getLicenseMessage as Ge, usePropsContext as Me, useAdaptiveModeContext as Ze, canUseDOM as je, Navigation as qe, getActiveElement as Je, keepFocusInContainer as z, focusFirstFocusableChild as pe, WatermarkOverlay as Qe, useDir as Xe,
|
|
10
|
+
import { createPropsContext as Ke, validatePackage as $e, getLicenseMessage as Ge, usePropsContext as Me, useAdaptiveModeContext as Ze, canUseDOM as je, Navigation as qe, getActiveElement as Je, keepFocusInContainer as z, focusFirstFocusableChild as pe, WatermarkOverlay as Qe, useDir as Xe, getTabIndex as Ye, classNames as Z, kendoThemeMaps as fe, IconWrap as et, svgIconPropType as tt } from "@progress/kendo-react-common";
|
|
11
11
|
import { packageMetadata as me } from "../package-metadata.mjs";
|
|
12
12
|
import { Picker as nt } from "./Picker.mjs";
|
|
13
13
|
import { ColorGradient as at } from "./ColorGradient.mjs";
|
|
14
|
-
import {
|
|
14
|
+
import { DEFAULT_TILE_SIZE as rt, DEFAULT_PRESET as ot, ColorPalette as it } from "./ColorPalette.mjs";
|
|
15
15
|
import { FlatColorPicker as B } from "./FlatColorPicker.mjs";
|
|
16
|
-
import { Button as
|
|
16
|
+
import { Button as lt } from "@progress/kendo-react-buttons";
|
|
17
17
|
import { caretAltDownIcon as ct } from "@progress/kendo-svg-icons";
|
|
18
|
-
import { colorPickerAdaptiveTitle as
|
|
18
|
+
import { colorPickerAdaptiveTitle as ve, messages as L, flatColorPickerApplyBtn as ge, flatColorPickerCancelBtn as ke, colorPickerDropdownButtonAriaLabel as Ce } from "../messages/index.mjs";
|
|
19
19
|
import { useLocalization as st } from "@progress/kendo-react-intl";
|
|
20
20
|
import { AdaptiveMode as ut } from "../common/AdaptiveMode.mjs";
|
|
21
21
|
import { ActionSheetContent as dt } from "@progress/kendo-react-layout";
|
|
@@ -23,18 +23,18 @@ const pt = {
|
|
|
23
23
|
opacity: !0
|
|
24
24
|
}, ft = {
|
|
25
25
|
palette: ot,
|
|
26
|
-
tileSize:
|
|
26
|
+
tileSize: rt
|
|
27
27
|
}, j = (D) => D !== void 0, mt = Ke(), Ee = t.forwardRef((D, be) => {
|
|
28
|
-
var
|
|
29
|
-
const we = !$e(me, { component: "ColorPicker" }), Se = Ge(me), o = Me(mt, D),
|
|
30
|
-
size: u =
|
|
31
|
-
rounded:
|
|
32
|
-
fillMode:
|
|
33
|
-
gradientSettings:
|
|
34
|
-
paletteSettings:
|
|
35
|
-
flatColorPickerSettings:
|
|
36
|
-
view: d = o.views ? void 0 :
|
|
37
|
-
views: c = d ? void 0 :
|
|
28
|
+
var ie, le;
|
|
29
|
+
const we = !$e(me, { component: "ColorPicker" }), Se = Ge(me), o = Me(mt, D), w = st(), q = Ze(), {
|
|
30
|
+
size: u = C.size,
|
|
31
|
+
rounded: v = C.rounded,
|
|
32
|
+
fillMode: x = C.fillMode,
|
|
33
|
+
gradientSettings: E = C.gradientSettings,
|
|
34
|
+
paletteSettings: S = C.paletteSettings,
|
|
35
|
+
flatColorPickerSettings: y,
|
|
36
|
+
view: d = o.views ? void 0 : C.view,
|
|
37
|
+
views: c = d ? void 0 : C.views,
|
|
38
38
|
activeView: J,
|
|
39
39
|
popupSettings: g,
|
|
40
40
|
valid: ye,
|
|
@@ -49,9 +49,9 @@ const pt = {
|
|
|
49
49
|
onActiveColorClick: U,
|
|
50
50
|
className: _e,
|
|
51
51
|
adaptive: Te,
|
|
52
|
-
adaptiveTitle: Q =
|
|
52
|
+
adaptiveTitle: Q = w.toLanguageString(ve, L[ve]),
|
|
53
53
|
adaptiveSubtitle: X
|
|
54
|
-
} = o, s = t.useRef(null),
|
|
54
|
+
} = o, s = t.useRef(null), h = t.useRef(null), P = t.useRef(null), m = t.useRef(null), b = t.useRef(void 0), Pe = t.useRef(null), [Re, Y] = t.useState(!1), [Ae, Ie] = t.useState(o.defaultValue || void 0), [ze, Be] = t.useState(!1), [R, Le] = t.useState(), K = j(o.value), k = j(o.open), i = K ? o.value : Ae, p = k ? o.open : ze, ee = t.useRef(i), te = t.useCallback(() => {
|
|
55
55
|
s.current && s.current.focus();
|
|
56
56
|
}, []);
|
|
57
57
|
t.useImperativeHandle(
|
|
@@ -60,10 +60,10 @@ const pt = {
|
|
|
60
60
|
// we agreed that each element will have focus method exposed
|
|
61
61
|
element: s.current,
|
|
62
62
|
actionElement: Pe.current,
|
|
63
|
-
value:
|
|
63
|
+
value: i,
|
|
64
64
|
focus: te
|
|
65
65
|
}),
|
|
66
|
-
[
|
|
66
|
+
[i, te]
|
|
67
67
|
);
|
|
68
68
|
const $ = !!(R && q && R <= q.medium && Te);
|
|
69
69
|
t.useEffect(() => {
|
|
@@ -73,47 +73,47 @@ const pt = {
|
|
|
73
73
|
};
|
|
74
74
|
}, []);
|
|
75
75
|
const a = t.useCallback(
|
|
76
|
-
(e,
|
|
77
|
-
|
|
76
|
+
(e, l) => {
|
|
77
|
+
k || (!e && !l && s && s.current && s.current.focus(), Be(e));
|
|
78
78
|
},
|
|
79
|
-
[
|
|
79
|
+
[k]
|
|
80
80
|
), ne = t.useMemo(() => new qe({
|
|
81
81
|
root: s,
|
|
82
82
|
selectors: [".k-colorpicker", ".k-color-picker-popup"],
|
|
83
83
|
tabIndex: 0,
|
|
84
84
|
keyboardEvents: {
|
|
85
85
|
keydown: {
|
|
86
|
-
Escape: (e,
|
|
86
|
+
Escape: (e, l, n) => {
|
|
87
87
|
a(!1);
|
|
88
88
|
},
|
|
89
|
-
Enter: (e,
|
|
90
|
-
!
|
|
89
|
+
Enter: (e, l, n) => {
|
|
90
|
+
!k && e === s.current && (n.preventDefault(), n.stopPropagation(), a(!0));
|
|
91
91
|
},
|
|
92
|
-
ArrowDown: (e,
|
|
92
|
+
ArrowDown: (e, l, n) => {
|
|
93
93
|
n.altKey && (n.preventDefault(), n.stopPropagation(), a(!0));
|
|
94
94
|
},
|
|
95
|
-
ArrowUp: (e,
|
|
95
|
+
ArrowUp: (e, l, n) => {
|
|
96
96
|
n.altKey && (n.preventDefault(), n.stopPropagation(), a(!1));
|
|
97
97
|
},
|
|
98
|
-
Tab: (e,
|
|
99
|
-
var
|
|
98
|
+
Tab: (e, l, n) => {
|
|
99
|
+
var _, ce, se;
|
|
100
100
|
if (Je(document) !== s.current) {
|
|
101
|
-
const ue = (
|
|
101
|
+
const ue = (_ = P.current) == null ? void 0 : _.wrapperRef.current, I = (ce = h.current) == null ? void 0 : ce.wrapperRef.current, de = (se = m.current) == null ? void 0 : se.element;
|
|
102
102
|
d === "palette" && ue ? z(n, ue) : d === "gradient" && I ? z(n, I) : d === "combo" && I ? z(n, I.parentElement) : c && de && z(n, de);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
}), [a,
|
|
108
|
-
|
|
109
|
-
}, [
|
|
107
|
+
}), [a, k]), De = t.useCallback(ne.triggerKeyboardEvent.bind(ne), []), xe = t.useCallback(() => {
|
|
108
|
+
k || (h.current && h.current.wrapperRef.current ? pe(h.current.wrapperRef.current) : P.current ? P.current.focus() : m.current && m.current.element && pe(m.current.element));
|
|
109
|
+
}, [k]), A = (e) => ee.current = e, ae = t.useCallback(
|
|
110
110
|
(e) => {
|
|
111
|
-
const
|
|
111
|
+
const l = {
|
|
112
112
|
value: ee.current,
|
|
113
113
|
nativeEvent: e.nativeEvent,
|
|
114
114
|
syntheticEvent: e
|
|
115
115
|
};
|
|
116
|
-
f(
|
|
116
|
+
f(l), a(!p, !0);
|
|
117
117
|
},
|
|
118
118
|
[p]
|
|
119
119
|
), G = t.useCallback(() => {
|
|
@@ -123,36 +123,36 @@ const pt = {
|
|
|
123
123
|
U && U.call(void 0, {
|
|
124
124
|
syntheticEvent: e,
|
|
125
125
|
nativeEvent: e.nativeEvent,
|
|
126
|
-
value:
|
|
126
|
+
value: i,
|
|
127
127
|
target: {
|
|
128
128
|
element: s.current,
|
|
129
|
-
value:
|
|
129
|
+
value: i
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
},
|
|
133
|
-
[U,
|
|
133
|
+
[U, i]
|
|
134
134
|
), Oe = t.useCallback(
|
|
135
135
|
(e) => {
|
|
136
|
-
|
|
136
|
+
b.current ? (clearTimeout(b.current), b.current = void 0) : (Y(!0), $ && !p && a(!0)), H && H.call(void 0, {
|
|
137
137
|
nativeEvent: e.nativeEvent,
|
|
138
138
|
syntheticEvent: e
|
|
139
139
|
});
|
|
140
140
|
},
|
|
141
141
|
[$, H, p, a]
|
|
142
142
|
), Fe = t.useCallback(() => {
|
|
143
|
-
a(!1, !0), Y(!1),
|
|
143
|
+
a(!1, !0), Y(!1), b.current = void 0;
|
|
144
144
|
}, []), Ve = t.useCallback(
|
|
145
145
|
(e) => {
|
|
146
|
-
clearTimeout(
|
|
146
|
+
clearTimeout(b.current), b.current = window.setTimeout(Fe), W && W.call(void 0, {
|
|
147
147
|
nativeEvent: e.nativeEvent,
|
|
148
148
|
syntheticEvent: e
|
|
149
149
|
});
|
|
150
150
|
},
|
|
151
151
|
[W]
|
|
152
152
|
), f = t.useCallback(
|
|
153
|
-
(e,
|
|
154
|
-
var
|
|
155
|
-
const n =
|
|
153
|
+
(e, l) => {
|
|
154
|
+
var _;
|
|
155
|
+
const n = l ? e.rgbaValue || "" : (_ = e.value) != null ? _ : "";
|
|
156
156
|
K || Ie(n), V && V.call(void 0, {
|
|
157
157
|
value: n,
|
|
158
158
|
nativeEvent: e.nativeEvent,
|
|
@@ -171,112 +171,115 @@ const pt = {
|
|
|
171
171
|
(e) => /* @__PURE__ */ t.createElement(t.Fragment, null, (d === "combo" || d === "gradient") && /* @__PURE__ */ t.createElement(
|
|
172
172
|
at,
|
|
173
173
|
{
|
|
174
|
-
...
|
|
174
|
+
...E,
|
|
175
175
|
_adaptive: e,
|
|
176
|
-
ref:
|
|
176
|
+
ref: h,
|
|
177
177
|
isInsidePopup: !0,
|
|
178
178
|
size: e ? "large" : u,
|
|
179
|
-
|
|
180
|
-
value: l,
|
|
179
|
+
value: i,
|
|
181
180
|
onChange: f
|
|
182
181
|
}
|
|
183
182
|
), (d === "combo" || d === "palette") && /* @__PURE__ */ t.createElement(
|
|
184
|
-
|
|
183
|
+
it,
|
|
185
184
|
{
|
|
186
|
-
...
|
|
185
|
+
...S,
|
|
187
186
|
ref: P,
|
|
188
187
|
size: e ? "large" : u,
|
|
189
|
-
value:
|
|
188
|
+
value: i,
|
|
190
189
|
onChange: re
|
|
191
190
|
}
|
|
192
191
|
), c && c[0] === "gradient" && c[1] === "palette" && /* @__PURE__ */ t.createElement(
|
|
193
192
|
B,
|
|
194
193
|
{
|
|
195
|
-
...
|
|
196
|
-
_paletteSettings:
|
|
197
|
-
_gradientSettings: { _adaptive: e, ...
|
|
194
|
+
...y,
|
|
195
|
+
_paletteSettings: S,
|
|
196
|
+
_gradientSettings: { _adaptive: e, ...E },
|
|
198
197
|
ref: m,
|
|
199
198
|
size: e ? "large" : u,
|
|
199
|
+
rounded: v,
|
|
200
200
|
views: ["gradient", "palette"],
|
|
201
201
|
activeView: J,
|
|
202
202
|
setOpen: a,
|
|
203
203
|
showButtons: !e,
|
|
204
|
-
value:
|
|
204
|
+
value: i,
|
|
205
205
|
onChange: f,
|
|
206
206
|
setAdaptiveModeValue: A
|
|
207
207
|
}
|
|
208
208
|
), c && c[0] === "palette" && c[1] === "gradient" && /* @__PURE__ */ t.createElement(
|
|
209
209
|
B,
|
|
210
210
|
{
|
|
211
|
-
...
|
|
212
|
-
_paletteSettings:
|
|
213
|
-
_gradientSettings: { _adaptive: e, ...
|
|
211
|
+
...y,
|
|
212
|
+
_paletteSettings: S,
|
|
213
|
+
_gradientSettings: { _adaptive: e, ...E },
|
|
214
214
|
ref: m,
|
|
215
215
|
size: e ? "large" : u,
|
|
216
|
+
rounded: v,
|
|
216
217
|
views: ["palette", "gradient"],
|
|
217
218
|
setOpen: a,
|
|
218
219
|
showButtons: !e,
|
|
219
|
-
value:
|
|
220
|
+
value: i,
|
|
220
221
|
onChange: f,
|
|
221
222
|
setAdaptiveModeValue: A
|
|
222
223
|
}
|
|
223
224
|
), c && c.includes("gradient") && !c.includes("palette") && /* @__PURE__ */ t.createElement(
|
|
224
225
|
B,
|
|
225
226
|
{
|
|
226
|
-
...
|
|
227
|
-
_gradientSettings: { _adaptive: e, ...
|
|
227
|
+
...y,
|
|
228
|
+
_gradientSettings: { _adaptive: e, ...E },
|
|
228
229
|
ref: m,
|
|
229
230
|
size: e ? "large" : u,
|
|
231
|
+
rounded: v,
|
|
230
232
|
views: ["gradient"],
|
|
231
233
|
showButtons: !e,
|
|
232
234
|
setOpen: a,
|
|
233
|
-
value:
|
|
235
|
+
value: i,
|
|
234
236
|
onChange: f,
|
|
235
237
|
setAdaptiveModeValue: A
|
|
236
238
|
}
|
|
237
239
|
), c && c.includes("palette") && !c.includes("gradient") && /* @__PURE__ */ t.createElement(
|
|
238
240
|
B,
|
|
239
241
|
{
|
|
240
|
-
...
|
|
241
|
-
_paletteSettings:
|
|
242
|
-
_gradientSettings: { _adaptive: e, ...
|
|
242
|
+
...y,
|
|
243
|
+
_paletteSettings: S,
|
|
244
|
+
_gradientSettings: { _adaptive: e, ...E },
|
|
243
245
|
ref: m,
|
|
244
246
|
size: e ? "large" : u,
|
|
247
|
+
rounded: v,
|
|
245
248
|
views: ["palette"],
|
|
246
249
|
showButtons: !e,
|
|
247
250
|
setOpen: a,
|
|
248
|
-
value:
|
|
251
|
+
value: i,
|
|
249
252
|
onChange: f,
|
|
250
253
|
setAdaptiveModeValue: A
|
|
251
254
|
}
|
|
252
255
|
), we && /* @__PURE__ */ t.createElement(Qe, { message: Se })),
|
|
253
256
|
[
|
|
254
257
|
J,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
+
x,
|
|
259
|
+
y,
|
|
260
|
+
E,
|
|
258
261
|
f,
|
|
259
262
|
re,
|
|
260
|
-
|
|
263
|
+
S,
|
|
261
264
|
a,
|
|
262
265
|
u,
|
|
263
|
-
|
|
266
|
+
i,
|
|
264
267
|
d,
|
|
265
268
|
c
|
|
266
269
|
]
|
|
267
270
|
), He = t.useCallback(() => {
|
|
268
|
-
var
|
|
271
|
+
var l;
|
|
269
272
|
const e = {
|
|
270
|
-
animation: !!((
|
|
273
|
+
animation: !!((l = g == null ? void 0 : g.animate) == null || l),
|
|
271
274
|
title: Q,
|
|
272
275
|
subTitle: X,
|
|
273
276
|
expand: p,
|
|
274
277
|
onClose: G,
|
|
275
278
|
windowWidth: R,
|
|
276
279
|
footer: {
|
|
277
|
-
cancelText:
|
|
280
|
+
cancelText: w.toLanguageString(ke, L[ke]),
|
|
278
281
|
onCancel: G,
|
|
279
|
-
applyText:
|
|
282
|
+
applyText: w.toLanguageString(ge, L[ge]),
|
|
280
283
|
onApply: ae
|
|
281
284
|
}
|
|
282
285
|
};
|
|
@@ -288,12 +291,12 @@ const pt = {
|
|
|
288
291
|
p,
|
|
289
292
|
G,
|
|
290
293
|
R,
|
|
291
|
-
|
|
294
|
+
w,
|
|
292
295
|
ae,
|
|
293
296
|
M
|
|
294
297
|
]), We = t.useCallback((e) => {
|
|
295
|
-
for (const
|
|
296
|
-
Le(
|
|
298
|
+
for (const l of e)
|
|
299
|
+
Le(l.target.clientWidth);
|
|
297
300
|
}, []), oe = Xe(s, o.dir), Ue = ye !== !1;
|
|
298
301
|
return /* @__PURE__ */ t.createElement(
|
|
299
302
|
"span",
|
|
@@ -305,12 +308,12 @@ const pt = {
|
|
|
305
308
|
"aria-describedby": o.ariaDescribedBy,
|
|
306
309
|
"aria-haspopup": "dialog",
|
|
307
310
|
"aria-expanded": p,
|
|
308
|
-
"aria-controls": `k-colorpicker-popup-${(
|
|
311
|
+
"aria-controls": `k-colorpicker-popup-${(ie = o.id) != null ? ie : 0}`,
|
|
309
312
|
"aria-disabled": N ? "true" : void 0,
|
|
310
313
|
className: Z("k-colorpicker", "k-picker", "k-icon-picker", {
|
|
311
314
|
[`k-picker-${fe.sizeMap[u] || u}`]: u,
|
|
312
|
-
[`k-picker-${
|
|
313
|
-
[`k-rounded-${fe.roundedMap[
|
|
315
|
+
[`k-picker-${x}`]: x,
|
|
316
|
+
[`k-rounded-${fe.roundedMap[v] || v}`]: v,
|
|
314
317
|
"k-invalid": !Ue,
|
|
315
318
|
"k-disabled": N,
|
|
316
319
|
"k-focus": Re,
|
|
@@ -331,30 +334,29 @@ const pt = {
|
|
|
331
334
|
open: p,
|
|
332
335
|
onOpen: xe,
|
|
333
336
|
popupAnchor: s.current || void 0,
|
|
334
|
-
popupSettings: { id: `k-colorpicker-popup-${(
|
|
337
|
+
popupSettings: { id: `k-colorpicker-popup-${(le = o.id) != null ? le : 0}`, ...g },
|
|
335
338
|
input: /* @__PURE__ */ t.createElement("span", { onClick: Ne, className: "k-input-inner" }, /* @__PURE__ */ t.createElement(
|
|
336
339
|
"span",
|
|
337
340
|
{
|
|
338
341
|
className: Z("k-value-icon", "k-color-preview", {
|
|
339
|
-
"k-no-color": !
|
|
342
|
+
"k-no-color": !i,
|
|
340
343
|
"k-icon-color-preview": O || F || T
|
|
341
344
|
})
|
|
342
345
|
},
|
|
343
346
|
T && /* @__PURE__ */ t.createElement("span", { className: Z("k-color-preview-icon", T) }),
|
|
344
347
|
!T && (O || F) && /* @__PURE__ */ t.createElement(et, { name: O, icon: F }),
|
|
345
|
-
/* @__PURE__ */ t.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor:
|
|
348
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: i } })
|
|
346
349
|
)),
|
|
347
350
|
button: /* @__PURE__ */ t.createElement(
|
|
348
|
-
|
|
351
|
+
lt,
|
|
349
352
|
{
|
|
350
353
|
tabIndex: -1,
|
|
351
354
|
type: "button",
|
|
352
355
|
onClick: () => a(!p),
|
|
353
356
|
className: "k-input-button",
|
|
354
|
-
rounded: null,
|
|
355
357
|
icon: "caret-alt-down",
|
|
356
358
|
svgIcon: ct,
|
|
357
|
-
"aria-label":
|
|
359
|
+
"aria-label": w.toLanguageString(
|
|
358
360
|
Ce,
|
|
359
361
|
L[Ce]
|
|
360
362
|
)
|
|
@@ -379,18 +381,18 @@ Ee.propTypes = {
|
|
|
379
381
|
svgIcon: tt,
|
|
380
382
|
ariaLabelledBy: r.string,
|
|
381
383
|
ariaDescribedBy: r.string,
|
|
382
|
-
size: r.oneOf([
|
|
383
|
-
rounded: r.oneOf([
|
|
384
|
-
fillMode: r.oneOf([
|
|
384
|
+
size: r.oneOf(["small", "medium", "large"]),
|
|
385
|
+
rounded: r.oneOf(["small", "medium", "large", "full"]),
|
|
386
|
+
fillMode: r.oneOf(["solid", "flat", "outline"]),
|
|
385
387
|
className: r.string,
|
|
386
388
|
adaptive: r.bool,
|
|
387
389
|
adaptiveTitle: r.string,
|
|
388
390
|
adaptiveSubtitle: r.string
|
|
389
391
|
};
|
|
390
|
-
const
|
|
391
|
-
size:
|
|
392
|
-
rounded:
|
|
393
|
-
fillMode:
|
|
392
|
+
const C = {
|
|
393
|
+
size: void 0,
|
|
394
|
+
rounded: void 0,
|
|
395
|
+
fillMode: void 0,
|
|
394
396
|
view: "palette",
|
|
395
397
|
views: ["gradient", "palette"],
|
|
396
398
|
gradientSettings: pt,
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { ColorPickerView } from './interfaces/ColorPickerView.js';
|
|
9
|
+
import { ColorPickerGradientSettings } from './interfaces/ColorPickerGradientSettings.js';
|
|
10
|
+
import { ColorPickerPaletteSettings } from './interfaces/ColorPickerPaletteSettings.js';
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
/**
|
|
13
|
+
* The arguments for the `onChange` FlatColorPicker event.
|
|
14
|
+
*/
|
|
15
|
+
export interface FlatColorPickerChangeEvent {
|
|
16
|
+
/**
|
|
17
|
+
* The current value of the FlatColorPicker.
|
|
18
|
+
*/
|
|
19
|
+
value: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* A React Synthetic Event.
|
|
22
|
+
*/
|
|
23
|
+
syntheticEvent: React.SyntheticEvent<any>;
|
|
24
|
+
/**
|
|
25
|
+
* A native DOM event.
|
|
26
|
+
*/
|
|
27
|
+
nativeEvent: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Represents the properties of [FlatColorPicker](https://www.telerik.com/kendo-react-ui/components/inputs/api/flatcolorpicker) component.
|
|
31
|
+
*/
|
|
32
|
+
export interface FlatColorPickerProps {
|
|
33
|
+
/**
|
|
34
|
+
* Sets the `id` property of the top `div` element of the FlatColorPicker.
|
|
35
|
+
*/
|
|
36
|
+
id?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Sets additional CSS styles to the FlatColorPicker.
|
|
39
|
+
*/
|
|
40
|
+
style?: React.CSSProperties;
|
|
41
|
+
/**
|
|
42
|
+
* Sets additional classes to the FlatColorPicker.
|
|
43
|
+
*/
|
|
44
|
+
className?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the color value.
|
|
47
|
+
*/
|
|
48
|
+
value?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Sets the default color value.
|
|
51
|
+
*/
|
|
52
|
+
defaultValue?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The event handler that will be fired when the user changes the preview color.
|
|
55
|
+
*/
|
|
56
|
+
onPreviewChange?: (event: FlatColorPickerChangeEvent) => void;
|
|
57
|
+
/**
|
|
58
|
+
* The event handler that will be fired when the user click the "Apply" button or on blur when the "Apply" button is not present.
|
|
59
|
+
*/
|
|
60
|
+
onChange?: (event: FlatColorPickerChangeEvent) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Specifies whether we should display the opacity slider to allow selection of transparency.
|
|
63
|
+
*
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
opacity?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Sets the default input format in the gradient input editor.
|
|
69
|
+
*
|
|
70
|
+
* @default 'rgb'
|
|
71
|
+
*/
|
|
72
|
+
format?: 'hex' | 'rgba' | 'rgb';
|
|
73
|
+
/**
|
|
74
|
+
* Sets the `tabIndex` property of the FlatColorPicker.
|
|
75
|
+
*/
|
|
76
|
+
tabIndex?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Represents the label of the FlatColorPicker component.
|
|
79
|
+
*/
|
|
80
|
+
ariaLabel?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Identifies the element(s) which will label the component.
|
|
83
|
+
*/
|
|
84
|
+
ariaLabelledBy?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Determines whether the FlatColorPicker is disabled.
|
|
87
|
+
*/
|
|
88
|
+
disabled?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* **Deprecated**. Use `views` prop instead.
|
|
91
|
+
*
|
|
92
|
+
* @deprecated
|
|
93
|
+
*/
|
|
94
|
+
view?: 'ColorGradient' | 'ColorPalette' | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Specifies the views that will be rendered. By default both the gradient and palette views will be rendered.
|
|
97
|
+
*
|
|
98
|
+
* @default ['gradient', 'palette']`
|
|
99
|
+
*/
|
|
100
|
+
views?: ColorPickerView[];
|
|
101
|
+
/**
|
|
102
|
+
* Sets the initially active view when both 'gradient' and 'palette' views are rendered.
|
|
103
|
+
* Use with the `views` property.
|
|
104
|
+
*
|
|
105
|
+
* @default 'gradient''
|
|
106
|
+
*/
|
|
107
|
+
activeView?: ColorPickerView;
|
|
108
|
+
/**
|
|
109
|
+
* Sets custom header component.
|
|
110
|
+
*/
|
|
111
|
+
header?: React.ComponentType | React.ReactNode;
|
|
112
|
+
/**
|
|
113
|
+
* Specifies whether clear button will be rendered in the header.
|
|
114
|
+
*/
|
|
115
|
+
showClearButton?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Specifies whether preview and revert color boxes will be rendered in the header.
|
|
118
|
+
*/
|
|
119
|
+
showPreview?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Specifies whether action buttons will be rendered in the footer.
|
|
122
|
+
*/
|
|
123
|
+
showButtons?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Configures the `size` of the FlatColorPicker.
|
|
126
|
+
*
|
|
127
|
+
* The available options are:
|
|
128
|
+
* - `small`
|
|
129
|
+
* - `medium`
|
|
130
|
+
* - `large`
|
|
131
|
+
* - `null`—This option removes the the built-in size styles of the FlatColorPicker. Allows for custom `padding`.
|
|
132
|
+
*
|
|
133
|
+
* @default `medium`
|
|
134
|
+
*/
|
|
135
|
+
size?: 'small' | 'medium' | 'large';
|
|
136
|
+
/**
|
|
137
|
+
* @hidden
|
|
138
|
+
*/
|
|
139
|
+
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
140
|
+
/**
|
|
141
|
+
* @hidden
|
|
142
|
+
*/
|
|
143
|
+
_gradientSettings?: ColorPickerGradientSettings;
|
|
144
|
+
/**
|
|
145
|
+
* @hidden
|
|
146
|
+
*/
|
|
147
|
+
_paletteSettings?: ColorPickerPaletteSettings;
|
|
148
|
+
/**
|
|
149
|
+
* @hidden
|
|
150
|
+
*/
|
|
151
|
+
setAdaptiveModeValue?: (value: any) => void;
|
|
152
|
+
/**
|
|
153
|
+
* @hidden
|
|
154
|
+
*/
|
|
155
|
+
setOpen?: (value: boolean) => void;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Represents the target (element and props) of the FlatColorPicker.
|
|
159
|
+
*/
|
|
160
|
+
export interface FlatColorPickerHandle {
|
|
161
|
+
/**
|
|
162
|
+
* The current element or `null` if there is none.
|
|
163
|
+
*/
|
|
164
|
+
element: HTMLDivElement | null;
|
|
165
|
+
/**
|
|
166
|
+
* The props values of the FlatColorPicker.
|
|
167
|
+
*/
|
|
168
|
+
props: FlatColorPickerProps;
|
|
169
|
+
/**
|
|
170
|
+
* The focus event callback.
|
|
171
|
+
*/
|
|
172
|
+
focus: () => void;
|
|
173
|
+
/**
|
|
174
|
+
* The current value of the FlatColorPicker.
|
|
175
|
+
*/
|
|
176
|
+
value: string | undefined;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Represents the [KendoReact FlatColorPicker component](https://www.telerik.com/kendo-react-ui/components/inputs/flatcolorpicker).
|
|
180
|
+
* Accepts properties of type [FlatColorPickerProps](https://www.telerik.com/kendo-react-ui/components/inputs/api/flatcolorpickerprops). Obtaining the [FlatColorPickerHandle](https://www.telerik.com/kendo-react-ui/components/inputs/api/flatcolorpickerhandle).
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```jsx
|
|
184
|
+
* const App = () => {
|
|
185
|
+
* return <FlatColorPicker />;
|
|
186
|
+
* }
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
export declare const FlatColorPicker: React.ForwardRefExoticComponent<FlatColorPickerProps & React.RefAttributes<FlatColorPickerHandle | null>>;
|
|
@@ -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 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),L=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:E,showButtons:N=!0,showPreview:z=!0,showClearButton:T=!0,view:P=e.views?void 0:"ColorGradient",views:d=P?void 0:["gradient","palette"],activeView:S="gradient",size:i=void 0,rounded:j=void 0}=e,[v,D]=t.useState((P||"ColorGradient")==="ColorGradient"),[g,V]=t.useState((d!=null?d:[])[0]==="gradient"&&S==="gradient"),[c,y]=t.useState(e.value||E||void 0),[C,M]=t.useState(e.value||E||void 0),_=e.value!==void 0?e.value:void 0;t.useEffect(()=>{y(e.value)},[e.value]);const k=p.useLocalization(),R=t.useCallback(()=>{h.current&&h.current.focus()},[h]);t.useImperativeHandle(h,()=>({element:w.current,focus:R,props:e,value:_}),[_,R,e]),t.useImperativeHandle(b,()=>h.current);const q=t.useCallback(a=>{(a==="ColorGradient"&&!v||a==="ColorPalette"&&v)&&D(!v)},[v]),I=t.useCallback(a=>{a==="gradient"&&!g||a==="palette"&&g||a==="palette"&&S==="gradient"?V(!g):a==="gradient"&&S==="palette"&&V(!0)},[S,g]),K=t.useCallback(a=>{var u;const r=E||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)}},[E,e.onPreviewChange]),O=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(C),e.setOpen&&e.setOpen(!1)},[C]),$=t.useCallback(a=>{if(y(C),e.onPreviewChange){const r={value:C,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,r)}},[C,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]),A=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(A.triggerKeyboardEvent.bind(A),[]);return t.createElement("div",{id:e.id,role:"textbox","aria-label":e.ariaLabel,"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":k.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,size:i,fillMode:"flat",svgIcon:m.dropletSliderIcon,selected:g,onClick:()=>I("gradient")}),t.createElement(s.Button,{type:"button","aria-label":k.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,size:i,fillMode:"flat",svgIcon:m.paletteIcon,selected:!g,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":k.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:m.paletteIcon,selected:!g,onClick:()=>I("palette")}),t.createElement(s.Button,{type:"button","aria-label":k.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:m.dropletSliderIcon,selected:g,onClick:()=>I("gradient")})),P&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":k.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,selected:v,onClick:()=>q("ColorGradient"),icon:"droplet-slider",svgIcon:m.dropletSliderIcon}),t.createElement(s.Button,{type:"button","aria-label":k.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,selected:!v,onClick:()=>q("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":k.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":_===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":C===void 0}),onClick:$},t.createElement("span",{className:"k-color-preview-mask",style:{background:C||void 0}})))),f&&t.createElement(n.WatermarkOverlay,{message:B})),t.createElement("div",{className:"k-coloreditor-views k-vstack"},(P&&v||d&&g)&&t.createElement(Z.ColorGradient,{ref:F,role:"none",ariaLabel:void 0,value:c,onChange:O,opacity:e.opacity,format:e.format,size:i,rounded:j,_adaptive:e._gradientSettings?e._gradientSettings._adaptive:void 0,...e._gradientSettings}),(P&&!v||d&&!g)&&t.createElement(Y.ColorPalette,{ariaDisabled:!0,ariaLabelledBy:"required_label",value:c,onChange:O,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},l.messages[l.flatColorPickerApplyBtn]),t.createElement(s.Button,{type:"button",className:"k-coloreditor-cancel",onClick:W},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"])};L.displayName="KendoFlatColorPicker";L.propTypes=te;exports.FlatColorPicker=L;
|