@progress/kendo-react-inputs 14.5.0-develop.8 → 14.5.0-develop.9
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 +55 -55
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +95 -95
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +16 -11
- package/rating/Rating.js +1 -1
- package/rating/Rating.mjs +62 -62
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +38 -38
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 qe=require("react"),r=require("prop-types"),n=require("@progress/kendo-react-common"),me=require("../package-metadata.js"),Ve=require("./Picker.js"),Me=require("./ColorGradient.js"),X=require("./ColorPalette.js"),x=require("./FlatColorPicker.js"),He=require("@progress/kendo-react-buttons"),We=require("@progress/kendo-svg-icons"),d=require("../messages/index.js"),Ue=require("@progress/kendo-react-intl"),je=require("../common/AdaptiveMode.js"),Ge=require("@progress/kendo-react-layout");function Ke(f){const T=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const P in f)if(P!=="default"){const F=Object.getOwnPropertyDescriptor(f,P);Object.defineProperty(T,P,F.get?F:{enumerable:!0,get:()=>f[P]})}}return T.default=f,Object.freeze(T)}const t=Ke(qe),$e={opacity:!0},Ze={palette:X.DEFAULT_PRESET,tileSize:X.DEFAULT_TILE_SIZE},Q=f=>f!==void 0,Ce=n.createPropsContext(),Y=t.forwardRef((f,T)=>{var de,pe;const P=!n.validatePackage(me.packageMetadata,{component:"ColorPicker"}),F=n.getLicenseMessage(me.packageMetadata),l=n.usePropsContext(Ce,f),_=Ue.useLocalization(),ee=n.useAdaptiveModeContext(),{size:p=w.size,rounded:C=w.rounded,fillMode:q=w.fillMode,gradientSettings:y=w.gradientSettings,paletteSettings:R=w.paletteSettings,flatColorPickerSettings:A,view:g=l.views?void 0:w.view,views:s=g?void 0:w.views,activeView:te,popupSettings:b,valid:be,disabled:V,tabIndex:Ee,icon:M,svgIcon:H,iconClassName:O,onChange:W,onFocus:U,onBlur:j,onActiveColorClick:G,className:we,adaptive:Pe,adaptiveTitle:ne=_.toLanguageString(d.colorPickerAdaptiveTitle,d.messages[d.colorPickerAdaptiveTitle]),adaptiveSubtitle:ae,showButtons:S=!0}=l,u=t.useRef(null),I=t.useRef(null),D=t.useRef(null),m=t.useRef(null),h=t.useRef(void 0),ye=t.useRef(null),[Se,oe]=t.useState(!1),[he,Te]=t.useState(l.defaultValue||void 0),[_e,Re]=t.useState(!1),[L,Ae]=t.useState(),K=Q(l.value),E=Q(l.open),i=K?l.value:he,v=E?l.open:_e,re=t.useRef(i),le=t.useCallback(()=>{u.current&&u.current.focus()},[]);t.useImperativeHandle(T,()=>({element:u.current,actionElement:ye.current,value:i,focus:le}),[i,le]);const $=!!(L&&ee&&L<=ee.medium&&Pe);t.useEffect(()=>{const e=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ne.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)=>{E||(!e&&!c&&u&&u.current&&u.current.focus(),Re(e))},[E]),ie=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)=>{!E&&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 B,fe,ge;if(n.getActiveElement(document)!==u.current){const ve=(B=D.current)==null?void 0:B.wrapperRef.current,N=(fe=I.current)==null?void 0:fe.wrapperRef.current,ke=(ge=m.current)==null?void 0:ge.element;g==="palette"&&ve?n.keepFocusInContainer(a,ve):g==="gradient"&&N?n.keepFocusInContainer(a,N):g==="combo"&&N?n.keepFocusInContainer(a,N.parentElement):s&&ke&&n.keepFocusInContainer(a,ke)}}}}}),[o,E]),Ie=t.useCallback(ie.triggerKeyboardEvent.bind(ie),[]),Be=t.useCallback(()=>{E||(I.current&&I.current.wrapperRef.current?n.focusFirstFocusableChild(I.current.wrapperRef.current):D.current?D.current.focus():m.current&&m.current.element&&n.focusFirstFocusableChild(m.current.element))},[E]),z=e=>re.current=e,ce=t.useCallback(e=>{const c={value:re.current,nativeEvent:e.nativeEvent,syntheticEvent:e};k(c),o(!v,!0)},[v]),Z=t.useCallback(()=>{o(!1,!0)},[o]),Fe=t.useCallback(e=>{G&&G.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:{element:u.current,value:i}})},[G,i]),Oe=t.useCallback(e=>{h.current?(clearTimeout(h.current),h.current=void 0):(oe(!0),$&&!v&&o(!0)),U&&U.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[$,U,v,o]),De=t.useCallback(()=>{o(!1,!0),oe(!1),h.current=void 0},[]),Le=t.useCallback(e=>{clearTimeout(h.current),h.current=window.setTimeout(De),j&&j.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[j]),k=t.useCallback((e,c)=>{var B;const a=c?e.rgbaValue||"":(B=e.value)!=null?B:"";K||Te(a),W&&W.call(void 0,{value:a,nativeEvent:e.nativeEvent,syntheticEvent:e.syntheticEvent,target:{element:u.current,value:a}}),o(!1)},[K,W]),se=t.useCallback(e=>k(e,!0),[Q,k]),J=t.useCallback(e=>t.createElement(t.Fragment,null,(g==="combo"||g==="gradient")&&t.createElement(Me.ColorGradient,{...y,_adaptive:e,ref:I,isInsidePopup:!0,size:e?"large":p,value:i,onChange:k}),(g==="combo"||g==="palette")&&t.createElement(X.ColorPalette,{...R,ref:D,size:e?"large":p,value:i,onChange:se}),s&&s[0]==="gradient"&&s[1]==="palette"&&t.createElement(x.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["gradient","palette"],activeView:te,setOpen:o,showButtons:e?!1:S,value:i,onChange:k,setAdaptiveModeValue:z}),s&&s[0]==="palette"&&s[1]==="gradient"&&t.createElement(x.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["palette","gradient"],setOpen:o,showButtons:e?!1:S,value:i,onChange:k,setAdaptiveModeValue:z}),s&&s.includes("gradient")&&!s.includes("palette")&&t.createElement(x.FlatColorPicker,{...A,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["gradient"],showButtons:e?!1:S,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:z}),s&&s.includes("palette")&&!s.includes("gradient")&&t.createElement(x.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["palette"],showButtons:e?!1:S,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:z}),P&&t.createElement(n.WatermarkOverlay,{message:F})),[te,q,A,y,k,se,R,o,p,i,g,s]),ze=t.useCallback(()=>{var c;const e={animation:!!((c=b==null?void 0:b.animate)==null||c),title:ne,subTitle:ae,expand:v,onClose:Z,windowWidth:L,footer:S?{cancelText:_.toLanguageString(d.flatColorPickerCancelBtn,d.messages[d.flatColorPickerCancelBtn]),onCancel:Z,applyText:_.toLanguageString(d.flatColorPickerApplyBtn,d.messages[d.flatColorPickerApplyBtn]),onApply:ce}:void 0};return t.createElement(je.AdaptiveMode,{...e},t.createElement(Ge.ActionSheetContent,null,J(!0)))},[b==null?void 0:b.animate,ne,ae,v,Z,L,S,_,ce,J]),Ne=t.useCallback(e=>{for(const c of e)Ae(c.target.clientWidth)},[]),ue=n.useDir(u,l.dir),xe=be!==!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-${(de=l.id)!=null?de:0}`,"aria-disabled":V?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[p]||p}`]:p,[`k-picker-${q}`]:q,[`k-rounded-${n.kendoThemeMaps.roundedMap[C]||C}`]:C,"k-invalid":!xe,"k-disabled":V,"k-focus":Se,className:we}),ref:u,tabIndex:n.getTabIndex(Ee,V),title:l.title,onKeyDown:Ie,onFocus:Oe,onBlur:Le,dir:ue},t.createElement(Ve.Picker,{dir:ue,open:v,onOpen:Be,popupAnchor:u.current||void 0,popupSettings:{id:`k-colorpicker-popup-${(pe=l.id)!=null?pe:0}`,...b},input:t.createElement("span",{onClick:Fe,className:"k-input-inner"},t.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!i,"k-icon-color-preview":M||H||O})},O&&t.createElement("span",{className:n.classNames("k-color-preview-icon",O)}),!O&&(M||H)&&t.createElement(n.IconWrap,{name:M,icon:H}),t.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:i}}))),button:t.createElement(He.Button,{tabIndex:-1,type:"button",onClick:()=>o(!v),className:"k-input-button",icon:"
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qe=require("react"),r=require("prop-types"),n=require("@progress/kendo-react-common"),me=require("../package-metadata.js"),Ve=require("./Picker.js"),Me=require("./ColorGradient.js"),X=require("./ColorPalette.js"),x=require("./FlatColorPicker.js"),He=require("@progress/kendo-react-buttons"),We=require("@progress/kendo-svg-icons"),d=require("../messages/index.js"),Ue=require("@progress/kendo-react-intl"),je=require("../common/AdaptiveMode.js"),Ge=require("@progress/kendo-react-layout");function Ke(f){const T=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const P in f)if(P!=="default"){const F=Object.getOwnPropertyDescriptor(f,P);Object.defineProperty(T,P,F.get?F:{enumerable:!0,get:()=>f[P]})}}return T.default=f,Object.freeze(T)}const t=Ke(qe),$e={opacity:!0},Ze={palette:X.DEFAULT_PRESET,tileSize:X.DEFAULT_TILE_SIZE},Q=f=>f!==void 0,Ce=n.createPropsContext(),Y=t.forwardRef((f,T)=>{var de,pe;const P=!n.validatePackage(me.packageMetadata,{component:"ColorPicker"}),F=n.getLicenseMessage(me.packageMetadata),l=n.usePropsContext(Ce,f),_=Ue.useLocalization(),ee=n.useAdaptiveModeContext(),{size:p=w.size,rounded:C=w.rounded,fillMode:q=w.fillMode,gradientSettings:y=w.gradientSettings,paletteSettings:R=w.paletteSettings,flatColorPickerSettings:A,view:g=l.views?void 0:w.view,views:s=g?void 0:w.views,activeView:te,popupSettings:b,valid:be,disabled:V,tabIndex:Ee,icon:M,svgIcon:H,iconClassName:O,onChange:W,onFocus:U,onBlur:j,onActiveColorClick:G,className:we,adaptive:Pe,adaptiveTitle:ne=_.toLanguageString(d.colorPickerAdaptiveTitle,d.messages[d.colorPickerAdaptiveTitle]),adaptiveSubtitle:ae,showButtons:S=!0}=l,u=t.useRef(null),I=t.useRef(null),D=t.useRef(null),m=t.useRef(null),h=t.useRef(void 0),ye=t.useRef(null),[Se,oe]=t.useState(!1),[he,Te]=t.useState(l.defaultValue||void 0),[_e,Re]=t.useState(!1),[L,Ae]=t.useState(),K=Q(l.value),E=Q(l.open),i=K?l.value:he,v=E?l.open:_e,re=t.useRef(i),le=t.useCallback(()=>{u.current&&u.current.focus()},[]);t.useImperativeHandle(T,()=>({element:u.current,actionElement:ye.current,value:i,focus:le}),[i,le]);const $=!!(L&&ee&&L<=ee.medium&&Pe);t.useEffect(()=>{const e=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ne.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)=>{E||(!e&&!c&&u&&u.current&&u.current.focus(),Re(e))},[E]),ie=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)=>{!E&&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 B,fe,ge;if(n.getActiveElement(document)!==u.current){const ve=(B=D.current)==null?void 0:B.wrapperRef.current,N=(fe=I.current)==null?void 0:fe.wrapperRef.current,ke=(ge=m.current)==null?void 0:ge.element;g==="palette"&&ve?n.keepFocusInContainer(a,ve):g==="gradient"&&N?n.keepFocusInContainer(a,N):g==="combo"&&N?n.keepFocusInContainer(a,N.parentElement):s&&ke&&n.keepFocusInContainer(a,ke)}}}}}),[o,E]),Ie=t.useCallback(ie.triggerKeyboardEvent.bind(ie),[]),Be=t.useCallback(()=>{E||(I.current&&I.current.wrapperRef.current?n.focusFirstFocusableChild(I.current.wrapperRef.current):D.current?D.current.focus():m.current&&m.current.element&&n.focusFirstFocusableChild(m.current.element))},[E]),z=e=>re.current=e,ce=t.useCallback(e=>{const c={value:re.current,nativeEvent:e.nativeEvent,syntheticEvent:e};k(c),o(!v,!0)},[v]),Z=t.useCallback(()=>{o(!1,!0)},[o]),Fe=t.useCallback(e=>{G&&G.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:{element:u.current,value:i}})},[G,i]),Oe=t.useCallback(e=>{h.current?(clearTimeout(h.current),h.current=void 0):(oe(!0),$&&!v&&o(!0)),U&&U.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[$,U,v,o]),De=t.useCallback(()=>{o(!1,!0),oe(!1),h.current=void 0},[]),Le=t.useCallback(e=>{clearTimeout(h.current),h.current=window.setTimeout(De),j&&j.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[j]),k=t.useCallback((e,c)=>{var B;const a=c?e.rgbaValue||"":(B=e.value)!=null?B:"";K||Te(a),W&&W.call(void 0,{value:a,nativeEvent:e.nativeEvent,syntheticEvent:e.syntheticEvent,target:{element:u.current,value:a}}),o(!1)},[K,W]),se=t.useCallback(e=>k(e,!0),[Q,k]),J=t.useCallback(e=>t.createElement(t.Fragment,null,(g==="combo"||g==="gradient")&&t.createElement(Me.ColorGradient,{...y,_adaptive:e,ref:I,isInsidePopup:!0,size:e?"large":p,value:i,onChange:k}),(g==="combo"||g==="palette")&&t.createElement(X.ColorPalette,{...R,ref:D,size:e?"large":p,value:i,onChange:se}),s&&s[0]==="gradient"&&s[1]==="palette"&&t.createElement(x.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["gradient","palette"],activeView:te,setOpen:o,showButtons:e?!1:S,value:i,onChange:k,setAdaptiveModeValue:z}),s&&s[0]==="palette"&&s[1]==="gradient"&&t.createElement(x.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["palette","gradient"],setOpen:o,showButtons:e?!1:S,value:i,onChange:k,setAdaptiveModeValue:z}),s&&s.includes("gradient")&&!s.includes("palette")&&t.createElement(x.FlatColorPicker,{...A,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["gradient"],showButtons:e?!1:S,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:z}),s&&s.includes("palette")&&!s.includes("gradient")&&t.createElement(x.FlatColorPicker,{...A,_paletteSettings:R,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["palette"],showButtons:e?!1:S,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:z}),P&&t.createElement(n.WatermarkOverlay,{message:F})),[te,q,A,y,k,se,R,o,p,i,g,s]),ze=t.useCallback(()=>{var c;const e={animation:!!((c=b==null?void 0:b.animate)==null||c),title:ne,subTitle:ae,expand:v,onClose:Z,windowWidth:L,footer:S?{cancelText:_.toLanguageString(d.flatColorPickerCancelBtn,d.messages[d.flatColorPickerCancelBtn]),onCancel:Z,applyText:_.toLanguageString(d.flatColorPickerApplyBtn,d.messages[d.flatColorPickerApplyBtn]),onApply:ce}:void 0};return t.createElement(je.AdaptiveMode,{...e},t.createElement(Ge.ActionSheetContent,null,J(!0)))},[b==null?void 0:b.animate,ne,ae,v,Z,L,S,_,ce,J]),Ne=t.useCallback(e=>{for(const c of e)Ae(c.target.clientWidth)},[]),ue=n.useDir(u,l.dir),xe=be!==!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-${(de=l.id)!=null?de:0}`,"aria-disabled":V?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[p]||p}`]:p,[`k-picker-${q}`]:q,[`k-rounded-${n.kendoThemeMaps.roundedMap[C]||C}`]:C,"k-invalid":!xe,"k-disabled":V,"k-focus":Se,className:we}),ref:u,tabIndex:n.getTabIndex(Ee,V),title:l.title,onKeyDown:Ie,onFocus:Oe,onBlur:Le,dir:ue},t.createElement(Ve.Picker,{dir:ue,open:v,onOpen:Be,popupAnchor:u.current||void 0,popupSettings:{id:`k-colorpicker-popup-${(pe=l.id)!=null?pe:0}`,...b},input:t.createElement("span",{onClick:Fe,className:"k-input-inner"},t.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!i,"k-icon-color-preview":M||H||O})},O&&t.createElement("span",{className:n.classNames("k-color-preview-icon",O)}),!O&&(M||H)&&t.createElement(n.IconWrap,{name:M,icon:H}),t.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:i}}))),button:t.createElement(He.Button,{tabIndex:-1,type:"button",onClick:()=>o(!v),className:"k-input-button",icon:"chevron-down",svgIcon:We.chevronDownIcon,size:p,"aria-label":_.toLanguageString(d.colorPickerDropdownButtonAriaLabel,d.messages[d.colorPickerDropdownButtonAriaLabel])}),content:J(!1),_mobileMode:$,_actionSheet:ze()}))});Y.propTypes={value:r.string,defaultValue:r.string,disabled:r.bool,view:r.oneOf(["gradient","palette","combo"]),views:r.arrayOf(r.oneOf(["gradient","palette"])),dir:r.string,id:r.string,icon:r.string,svgIcon:n.svgIconPropType,ariaLabelledBy:r.string,ariaDescribedBy:r.string,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large","full","none"]),fillMode:r.oneOf(["solid","flat","outline"]),className:r.string,adaptive:r.bool,adaptiveTitle:r.string,adaptiveSubtitle:r.string};const w={size:void 0,rounded:void 0,fillMode:void 0,view:"palette",views:["gradient","palette"],gradientSettings:$e,paletteSettings:Ze};Y.displayName="KendoColorPicker";exports.ColorPicker=Y;exports.ColorPickerPropsContext=Ce;
|
package/colors/ColorPicker.mjs
CHANGED
|
@@ -11,10 +11,10 @@ import { validatePackage as $e, getLicenseMessage as Ge, usePropsContext as Me,
|
|
|
11
11
|
import { packageMetadata as ve } from "../package-metadata.mjs";
|
|
12
12
|
import { Picker as at } from "./Picker.mjs";
|
|
13
13
|
import { ColorGradient as ot } from "./ColorGradient.mjs";
|
|
14
|
-
import { DEFAULT_TILE_SIZE as rt, DEFAULT_PRESET as
|
|
14
|
+
import { DEFAULT_TILE_SIZE as rt, DEFAULT_PRESET as it, ColorPalette as lt } from "./ColorPalette.mjs";
|
|
15
15
|
import { FlatColorPicker as L } from "./FlatColorPicker.mjs";
|
|
16
16
|
import { Button as st } from "@progress/kendo-react-buttons";
|
|
17
|
-
import {
|
|
17
|
+
import { chevronDownIcon as ct } from "@progress/kendo-svg-icons";
|
|
18
18
|
import { colorPickerAdaptiveTitle as ge, messages as D, flatColorPickerApplyBtn as ke, flatColorPickerCancelBtn as Ce, colorPickerDropdownButtonAriaLabel as Ee } from "../messages/index.mjs";
|
|
19
19
|
import { useLocalization as ut } from "@progress/kendo-react-intl";
|
|
20
20
|
import { AdaptiveMode as dt } from "../common/AdaptiveMode.mjs";
|
|
@@ -22,22 +22,22 @@ import { ActionSheetContent as pt } from "@progress/kendo-react-layout";
|
|
|
22
22
|
const ft = {
|
|
23
23
|
opacity: !0
|
|
24
24
|
}, mt = {
|
|
25
|
-
palette:
|
|
25
|
+
palette: it,
|
|
26
26
|
tileSize: rt
|
|
27
27
|
}, q = (x) => x !== void 0, vt = tt(), be = t.forwardRef((x, we) => {
|
|
28
|
-
var
|
|
29
|
-
const Se = !$e(ve, { component: "ColorPicker" }),
|
|
28
|
+
var le, se;
|
|
29
|
+
const Se = !$e(ve, { component: "ColorPicker" }), he = Ge(ve), r = Me(vt, x), S = ut(), J = Ze(), {
|
|
30
30
|
size: u = C.size,
|
|
31
31
|
rounded: v = C.rounded,
|
|
32
32
|
fillMode: N = C.fillMode,
|
|
33
33
|
gradientSettings: E = C.gradientSettings,
|
|
34
|
-
paletteSettings:
|
|
35
|
-
flatColorPickerSettings:
|
|
34
|
+
paletteSettings: h = C.paletteSettings,
|
|
35
|
+
flatColorPickerSettings: y,
|
|
36
36
|
view: d = r.views ? void 0 : C.view,
|
|
37
37
|
views: s = d ? void 0 : C.views,
|
|
38
38
|
activeView: Q,
|
|
39
39
|
popupSettings: g,
|
|
40
|
-
valid:
|
|
40
|
+
valid: ye,
|
|
41
41
|
disabled: O,
|
|
42
42
|
tabIndex: _e,
|
|
43
43
|
icon: F,
|
|
@@ -52,7 +52,7 @@ const ft = {
|
|
|
52
52
|
adaptiveTitle: X = S.toLanguageString(ge, D[ge]),
|
|
53
53
|
adaptiveSubtitle: Y,
|
|
54
54
|
showButtons: b = !0
|
|
55
|
-
} = r, c = t.useRef(null), _ = t.useRef(null), R = t.useRef(null), m = t.useRef(null), w = t.useRef(void 0), Re = t.useRef(null), [Ae, ee] = t.useState(!1), [Ie, Be] = t.useState(r.defaultValue || void 0), [ze, Le] = t.useState(!1), [A, De] = t.useState(), $ = q(r.value), k = q(r.open),
|
|
55
|
+
} = r, c = t.useRef(null), _ = t.useRef(null), R = t.useRef(null), m = t.useRef(null), w = t.useRef(void 0), Re = t.useRef(null), [Ae, ee] = t.useState(!1), [Ie, Be] = t.useState(r.defaultValue || void 0), [ze, Le] = t.useState(!1), [A, De] = t.useState(), $ = q(r.value), k = q(r.open), i = $ ? r.value : Ie, p = k ? r.open : ze, te = t.useRef(i), ne = t.useCallback(() => {
|
|
56
56
|
c.current && c.current.focus();
|
|
57
57
|
}, []);
|
|
58
58
|
t.useImperativeHandle(
|
|
@@ -61,10 +61,10 @@ const ft = {
|
|
|
61
61
|
// we agreed that each element will have focus method exposed
|
|
62
62
|
element: c.current,
|
|
63
63
|
actionElement: Re.current,
|
|
64
|
-
value:
|
|
64
|
+
value: i,
|
|
65
65
|
focus: ne
|
|
66
66
|
}),
|
|
67
|
-
[
|
|
67
|
+
[i, ne]
|
|
68
68
|
);
|
|
69
69
|
const G = !!(A && J && A <= J.medium && Pe);
|
|
70
70
|
t.useEffect(() => {
|
|
@@ -74,8 +74,8 @@ const ft = {
|
|
|
74
74
|
};
|
|
75
75
|
}, []);
|
|
76
76
|
const a = t.useCallback(
|
|
77
|
-
(e,
|
|
78
|
-
k || (!e && !
|
|
77
|
+
(e, l) => {
|
|
78
|
+
k || (!e && !l && c && c.current && c.current.focus(), Le(e));
|
|
79
79
|
},
|
|
80
80
|
[k]
|
|
81
81
|
), ae = t.useMemo(() => new qe({
|
|
@@ -84,19 +84,19 @@ const ft = {
|
|
|
84
84
|
tabIndex: 0,
|
|
85
85
|
keyboardEvents: {
|
|
86
86
|
keydown: {
|
|
87
|
-
Escape: (e,
|
|
87
|
+
Escape: (e, l, n) => {
|
|
88
88
|
a(!1);
|
|
89
89
|
},
|
|
90
|
-
Enter: (e,
|
|
90
|
+
Enter: (e, l, n) => {
|
|
91
91
|
!k && e === c.current && (n.preventDefault(), n.stopPropagation(), a(!0));
|
|
92
92
|
},
|
|
93
|
-
ArrowDown: (e,
|
|
93
|
+
ArrowDown: (e, l, n) => {
|
|
94
94
|
n.altKey && (n.preventDefault(), n.stopPropagation(), a(!0));
|
|
95
95
|
},
|
|
96
|
-
ArrowUp: (e,
|
|
96
|
+
ArrowUp: (e, l, n) => {
|
|
97
97
|
n.altKey && (n.preventDefault(), n.stopPropagation(), a(!1));
|
|
98
98
|
},
|
|
99
|
-
Tab: (e,
|
|
99
|
+
Tab: (e, l, n) => {
|
|
100
100
|
var T, ce, ue;
|
|
101
101
|
if (Je(document) !== c.current) {
|
|
102
102
|
const de = (T = R.current) == null ? void 0 : T.wrapperRef.current, B = (ce = _.current) == null ? void 0 : ce.wrapperRef.current, pe = (ue = m.current) == null ? void 0 : ue.element;
|
|
@@ -109,12 +109,12 @@ const ft = {
|
|
|
109
109
|
k || (_.current && _.current.wrapperRef.current ? fe(_.current.wrapperRef.current) : R.current ? R.current.focus() : m.current && m.current.element && fe(m.current.element));
|
|
110
110
|
}, [k]), I = (e) => te.current = e, oe = t.useCallback(
|
|
111
111
|
(e) => {
|
|
112
|
-
const
|
|
112
|
+
const l = {
|
|
113
113
|
value: te.current,
|
|
114
114
|
nativeEvent: e.nativeEvent,
|
|
115
115
|
syntheticEvent: e
|
|
116
116
|
};
|
|
117
|
-
f(
|
|
117
|
+
f(l), a(!p, !0);
|
|
118
118
|
},
|
|
119
119
|
[p]
|
|
120
120
|
), M = t.useCallback(() => {
|
|
@@ -124,14 +124,14 @@ const ft = {
|
|
|
124
124
|
K && K.call(void 0, {
|
|
125
125
|
syntheticEvent: e,
|
|
126
126
|
nativeEvent: e.nativeEvent,
|
|
127
|
-
value:
|
|
127
|
+
value: i,
|
|
128
128
|
target: {
|
|
129
129
|
element: c.current,
|
|
130
|
-
value:
|
|
130
|
+
value: i
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
},
|
|
134
|
-
[K,
|
|
134
|
+
[K, i]
|
|
135
135
|
), Fe = t.useCallback(
|
|
136
136
|
(e) => {
|
|
137
137
|
w.current ? (clearTimeout(w.current), w.current = void 0) : (ee(!0), G && !p && a(!0)), W && W.call(void 0, {
|
|
@@ -151,9 +151,9 @@ const ft = {
|
|
|
151
151
|
},
|
|
152
152
|
[U]
|
|
153
153
|
), f = t.useCallback(
|
|
154
|
-
(e,
|
|
154
|
+
(e, l) => {
|
|
155
155
|
var T;
|
|
156
|
-
const n =
|
|
156
|
+
const n = l ? e.rgbaValue || "" : (T = e.value) != null ? T : "";
|
|
157
157
|
$ || Be(n), H && H.call(void 0, {
|
|
158
158
|
value: n,
|
|
159
159
|
nativeEvent: e.nativeEvent,
|
|
@@ -177,23 +177,23 @@ const ft = {
|
|
|
177
177
|
ref: _,
|
|
178
178
|
isInsidePopup: !0,
|
|
179
179
|
size: e ? "large" : u,
|
|
180
|
-
value:
|
|
180
|
+
value: i,
|
|
181
181
|
onChange: f
|
|
182
182
|
}
|
|
183
183
|
), (d === "combo" || d === "palette") && /* @__PURE__ */ t.createElement(
|
|
184
|
-
|
|
184
|
+
lt,
|
|
185
185
|
{
|
|
186
|
-
...
|
|
186
|
+
...h,
|
|
187
187
|
ref: R,
|
|
188
188
|
size: e ? "large" : u,
|
|
189
|
-
value:
|
|
189
|
+
value: i,
|
|
190
190
|
onChange: re
|
|
191
191
|
}
|
|
192
192
|
), s && s[0] === "gradient" && s[1] === "palette" && /* @__PURE__ */ t.createElement(
|
|
193
193
|
L,
|
|
194
194
|
{
|
|
195
|
-
...
|
|
196
|
-
_paletteSettings:
|
|
195
|
+
...y,
|
|
196
|
+
_paletteSettings: h,
|
|
197
197
|
_gradientSettings: { _adaptive: e, ...E },
|
|
198
198
|
ref: m,
|
|
199
199
|
size: e ? "large" : u,
|
|
@@ -202,15 +202,15 @@ const ft = {
|
|
|
202
202
|
activeView: Q,
|
|
203
203
|
setOpen: a,
|
|
204
204
|
showButtons: e ? !1 : b,
|
|
205
|
-
value:
|
|
205
|
+
value: i,
|
|
206
206
|
onChange: f,
|
|
207
207
|
setAdaptiveModeValue: I
|
|
208
208
|
}
|
|
209
209
|
), s && s[0] === "palette" && s[1] === "gradient" && /* @__PURE__ */ t.createElement(
|
|
210
210
|
L,
|
|
211
211
|
{
|
|
212
|
-
...
|
|
213
|
-
_paletteSettings:
|
|
212
|
+
...y,
|
|
213
|
+
_paletteSettings: h,
|
|
214
214
|
_gradientSettings: { _adaptive: e, ...E },
|
|
215
215
|
ref: m,
|
|
216
216
|
size: e ? "large" : u,
|
|
@@ -218,14 +218,14 @@ const ft = {
|
|
|
218
218
|
views: ["palette", "gradient"],
|
|
219
219
|
setOpen: a,
|
|
220
220
|
showButtons: e ? !1 : b,
|
|
221
|
-
value:
|
|
221
|
+
value: i,
|
|
222
222
|
onChange: f,
|
|
223
223
|
setAdaptiveModeValue: I
|
|
224
224
|
}
|
|
225
225
|
), s && s.includes("gradient") && !s.includes("palette") && /* @__PURE__ */ t.createElement(
|
|
226
226
|
L,
|
|
227
227
|
{
|
|
228
|
-
...
|
|
228
|
+
...y,
|
|
229
229
|
_gradientSettings: { _adaptive: e, ...E },
|
|
230
230
|
ref: m,
|
|
231
231
|
size: e ? "large" : u,
|
|
@@ -233,15 +233,15 @@ const ft = {
|
|
|
233
233
|
views: ["gradient"],
|
|
234
234
|
showButtons: e ? !1 : b,
|
|
235
235
|
setOpen: a,
|
|
236
|
-
value:
|
|
236
|
+
value: i,
|
|
237
237
|
onChange: f,
|
|
238
238
|
setAdaptiveModeValue: I
|
|
239
239
|
}
|
|
240
240
|
), s && s.includes("palette") && !s.includes("gradient") && /* @__PURE__ */ t.createElement(
|
|
241
241
|
L,
|
|
242
242
|
{
|
|
243
|
-
...
|
|
244
|
-
_paletteSettings:
|
|
243
|
+
...y,
|
|
244
|
+
_paletteSettings: h,
|
|
245
245
|
_gradientSettings: { _adaptive: e, ...E },
|
|
246
246
|
ref: m,
|
|
247
247
|
size: e ? "large" : u,
|
|
@@ -249,29 +249,29 @@ const ft = {
|
|
|
249
249
|
views: ["palette"],
|
|
250
250
|
showButtons: e ? !1 : b,
|
|
251
251
|
setOpen: a,
|
|
252
|
-
value:
|
|
252
|
+
value: i,
|
|
253
253
|
onChange: f,
|
|
254
254
|
setAdaptiveModeValue: I
|
|
255
255
|
}
|
|
256
|
-
), Se && /* @__PURE__ */ t.createElement(Qe, { message:
|
|
256
|
+
), Se && /* @__PURE__ */ t.createElement(Qe, { message: he })),
|
|
257
257
|
[
|
|
258
258
|
Q,
|
|
259
259
|
N,
|
|
260
|
-
|
|
260
|
+
y,
|
|
261
261
|
E,
|
|
262
262
|
f,
|
|
263
263
|
re,
|
|
264
|
-
|
|
264
|
+
h,
|
|
265
265
|
a,
|
|
266
266
|
u,
|
|
267
|
-
|
|
267
|
+
i,
|
|
268
268
|
d,
|
|
269
269
|
s
|
|
270
270
|
]
|
|
271
271
|
), We = t.useCallback(() => {
|
|
272
|
-
var
|
|
272
|
+
var l;
|
|
273
273
|
const e = {
|
|
274
|
-
animation: !!((
|
|
274
|
+
animation: !!((l = g == null ? void 0 : g.animate) == null || l),
|
|
275
275
|
title: X,
|
|
276
276
|
subTitle: Y,
|
|
277
277
|
expand: p,
|
|
@@ -300,9 +300,9 @@ const ft = {
|
|
|
300
300
|
oe,
|
|
301
301
|
Z
|
|
302
302
|
]), Ue = t.useCallback((e) => {
|
|
303
|
-
for (const
|
|
304
|
-
De(
|
|
305
|
-
}, []),
|
|
303
|
+
for (const l of e)
|
|
304
|
+
De(l.target.clientWidth);
|
|
305
|
+
}, []), ie = Xe(c, r.dir), Ke = ye !== !1;
|
|
306
306
|
return /* @__PURE__ */ t.createElement(
|
|
307
307
|
"span",
|
|
308
308
|
{
|
|
@@ -313,7 +313,7 @@ const ft = {
|
|
|
313
313
|
"aria-describedby": r.ariaDescribedBy,
|
|
314
314
|
"aria-haspopup": "dialog",
|
|
315
315
|
"aria-expanded": p,
|
|
316
|
-
"aria-controls": `k-colorpicker-popup-${(
|
|
316
|
+
"aria-controls": `k-colorpicker-popup-${(le = r.id) != null ? le : 0}`,
|
|
317
317
|
"aria-disabled": O ? "true" : void 0,
|
|
318
318
|
className: j("k-colorpicker", "k-picker", "k-icon-picker", {
|
|
319
319
|
[`k-picker-${me.sizeMap[u] || u}`]: u,
|
|
@@ -330,12 +330,12 @@ const ft = {
|
|
|
330
330
|
onKeyDown: xe,
|
|
331
331
|
onFocus: Fe,
|
|
332
332
|
onBlur: He,
|
|
333
|
-
dir:
|
|
333
|
+
dir: ie
|
|
334
334
|
},
|
|
335
335
|
/* @__PURE__ */ t.createElement(
|
|
336
336
|
at,
|
|
337
337
|
{
|
|
338
|
-
dir:
|
|
338
|
+
dir: ie,
|
|
339
339
|
open: p,
|
|
340
340
|
onOpen: Ne,
|
|
341
341
|
popupAnchor: c.current || void 0,
|
|
@@ -344,13 +344,13 @@ const ft = {
|
|
|
344
344
|
"span",
|
|
345
345
|
{
|
|
346
346
|
className: j("k-value-icon", "k-color-preview", {
|
|
347
|
-
"k-no-color": !
|
|
347
|
+
"k-no-color": !i,
|
|
348
348
|
"k-icon-color-preview": F || V || P
|
|
349
349
|
})
|
|
350
350
|
},
|
|
351
351
|
P && /* @__PURE__ */ t.createElement("span", { className: j("k-color-preview-icon", P) }),
|
|
352
352
|
!P && (F || V) && /* @__PURE__ */ t.createElement(et, { name: F, icon: V }),
|
|
353
|
-
/* @__PURE__ */ t.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor:
|
|
353
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: i } })
|
|
354
354
|
)),
|
|
355
355
|
button: /* @__PURE__ */ t.createElement(
|
|
356
356
|
st,
|
|
@@ -359,7 +359,7 @@ const ft = {
|
|
|
359
359
|
type: "button",
|
|
360
360
|
onClick: () => a(!p),
|
|
361
361
|
className: "k-input-button",
|
|
362
|
-
icon: "
|
|
362
|
+
icon: "chevron-down",
|
|
363
363
|
svgIcon: ct,
|
|
364
364
|
size: u,
|
|
365
365
|
"aria-label": S.toLanguageString(
|