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