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