@progress/kendo-react-inputs 11.0.0-develop.8 → 11.0.0

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.
@@ -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 J=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),s=require("@progress/kendo-react-buttons"),f=require("@progress/kendo-svg-icons"),Q=require("./ColorPalette.js"),U=require("./ColorGradient.js"),X=require("../package-metadata.js"),Y=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function Z(e){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const b in e)if(b!=="default"){const v=Object.getOwnPropertyDescriptor(e,b);Object.defineProperty(h,b,v.get?v:{enumerable:!0,get:()=>e[b]})}}return h.default=e,Object.freeze(h)}const t=Z(J),M=t.forwardRef((e,h)=>{const b=!n.validatePackage(X.packageMetadata,{component:"FlatColorPicker"}),v=t.useRef(null),B=t.useRef(null),A=t.useRef(null),{defaultValue:E,showButtons:w=!0,showPreview:x=!0,showClearButton:F=!0,view:P=e.views?void 0:"ColorGradient",views:d=P?void 0:["gradient","palette"],activeView:N="gradient",size:i="medium"}=e,[C,z]=t.useState((P||"ColorGradient")==="ColorGradient"),[g,V]=t.useState((d!=null?d:[])[0]==="gradient"&&N==="gradient"),[c,y]=t.useState(e.value||E||void 0),[k,G]=t.useState(e.value||E||void 0),_=e.value!==void 0?e.value:void 0;t.useEffect(()=>{y(e.value)},[e.value]);const m=Y.useLocalization(),L=t.useCallback(()=>{v.current&&v.current.focus()},[v]);t.useImperativeHandle(v,()=>({element:B.current,focus:L,props:e,value:_}),[_,L,e]),t.useImperativeHandle(h,()=>v.current);const R=t.useCallback(a=>{(a==="ColorGradient"&&!C||a==="ColorPalette"&&C)&&z(!C)},[C]),S=t.useCallback(a=>{a==="gradient"&&!g||a==="palette"&&g||a==="palette"&&N==="gradient"?V(!g):a==="gradient"&&N==="palette"&&V(!0)},[N,g]),T=t.useCallback(a=>{var u;const r=E||void 0;if(y(r),G(r),(u=e._gradientSettings)!=null&&u._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(r),e.onPreviewChange){const I={value:r,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,I)}},[E,e.onPreviewChange]),q=t.useCallback(a=>{var r;if(y(a.value),e.onPreviewChange){const u={value:a.value,nativeEvent:a.nativeEvent,syntheticEvent:a.syntheticEvent};e.onPreviewChange.call(void 0,u)}(r=e._gradientSettings)!=null&&r._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(a.value)},[e.onPreviewChange]),j=t.useCallback(a=>{if(c!==void 0&&G(c),e.onChange){const r={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,r)}},[c,e.onChange]),D=t.useCallback(()=>{y(k),e.setOpen&&e.setOpen(!1)},[k]),K=t.useCallback(a=>{if(y(k),e.onPreviewChange){const r={value:k,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,r)}},[k,e.onPreviewChange]),H=t.useCallback(a=>{var u,I;if((!a.relatedTarget||!((u=B.current)!=null&&u.contains(a.relatedTarget)))&&!((I=e._gradientSettings)!=null&&I._adaptive)&&(!w&&c!==void 0&&G(c),!w&&e.onChange)){const $={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,$)}},[c,w,e.onChange]),O=t.useMemo(()=>new n.Navigation({root:B,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))}}}}),[]),W=t.useCallback(O.triggerKeyboardEvent.bind(O),[]);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:B,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:H,onKeyDown:W},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":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:f.dropletSliderIcon,selected:g,onClick:()=>S("gradient")}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:f.paletteIcon,selected:!g,onClick:()=>S("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":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:f.paletteIcon,selected:!g,onClick:()=>S("palette")}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:f.dropletSliderIcon,selected:g,onClick:()=>S("gradient")})),P&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,selected:C,onClick:()=>R("ColorGradient"),icon:"droplet-slider",svgIcon:f.dropletSliderIcon}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,selected:!C,onClick:()=>R("ColorPalette"),icon:"palette",svgIcon:f.paletteIcon}))),t.createElement("div",{className:"k-spacer"}),t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},F&&t.createElement(s.Button,{type:"button",fillMode:"flat",size:i,onClick:T,"aria-label":m.toLanguageString(l.flatColorPickerClearBtn,l.messages[l.flatColorPickerClearBtn]),icon:"droplet-slash",svgIcon:f.dropletSlashIcon}),x&&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":k===void 0}),onClick:K},t.createElement("span",{className:"k-color-preview-mask",style:{background:k||void 0}})))),b&&t.createElement(n.WatermarkOverlay,null)),t.createElement("div",{className:"k-coloreditor-views k-vstack"},(P&&C||d&&g)&&t.createElement(U.ColorGradient,{ref:A,role:"none",ariaLabel:void 0,value:c,onChange:q,opacity:e.opacity,format:e.format,size:i,_adaptive:e._gradientSettings?e._gradientSettings._adaptive:void 0,...e._gradientSettings}),(P&&!C||d&&!g)&&t.createElement(Q.ColorPalette,{ariaDisabled:!0,ariaLabelledBy:"required_label",value:c,onChange:q,size:i,...e._paletteSettings})),w&&t.createElement("div",{className:"k-coloreditor-footer k-actions k-actions-end k-actions-horizontal"},t.createElement(s.Button,{type:"button",className:"k-coloreditor-cancel",size:i,onClick:D},l.messages[l.flatColorPickerCancelBtn]),t.createElement(s.Button,{type:"button",themeColor:"primary",className:"k-coloreditor-apply",size:i,onClick:j},l.messages[l.flatColorPickerApplyBtn])))}),p={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([null,"small","medium","large"])};M.displayName="KendoFlatColorPicker";M.propTypes=p;exports.FlatColorPicker=M;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),s=require("@progress/kendo-react-buttons"),f=require("@progress/kendo-svg-icons"),Q=require("./ColorPalette.js"),U=require("./ColorGradient.js"),X=require("../package-metadata.js"),Y=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function Z(e){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const b in e)if(b!=="default"){const v=Object.getOwnPropertyDescriptor(e,b);Object.defineProperty(h,b,v.get?v:{enumerable:!0,get:()=>e[b]})}}return h.default=e,Object.freeze(h)}const t=Z(J),M=t.forwardRef((e,h)=>{const b=!n.validatePackage(X.packageMetadata,{component:"FlatColorPicker"}),v=t.useRef(null),B=t.useRef(null),A=t.useRef(null),{defaultValue:E,showButtons:w=!0,showPreview:x=!0,showClearButton:F=!0,view:P=e.views?void 0:"ColorGradient",views:d=P?void 0:["gradient","palette"],activeView:N="gradient",size:i="medium"}=e,[C,z]=t.useState((P||"ColorGradient")==="ColorGradient"),[g,V]=t.useState((d!=null?d:[])[0]==="gradient"&&N==="gradient"),[c,y]=t.useState(e.value||E||void 0),[k,G]=t.useState(e.value||E||void 0),_=e.value!==void 0?e.value:void 0;t.useEffect(()=>{y(e.value)},[e.value]);const m=Y.useLocalization(),L=t.useCallback(()=>{v.current&&v.current.focus()},[v]);t.useImperativeHandle(v,()=>({element:B.current,focus:L,props:e,value:_}),[_,L,e]),t.useImperativeHandle(h,()=>v.current);const R=t.useCallback(a=>{(a==="ColorGradient"&&!C||a==="ColorPalette"&&C)&&z(!C)},[C]),S=t.useCallback(a=>{a==="gradient"&&!g||a==="palette"&&g||a==="palette"&&N==="gradient"?V(!g):a==="gradient"&&N==="palette"&&V(!0)},[N,g]),T=t.useCallback(a=>{var u;const r=E||void 0;if(y(r),G(r),(u=e._gradientSettings)!=null&&u._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(r),e.onPreviewChange){const I={value:r,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,I)}},[E,e.onPreviewChange]),q=t.useCallback(a=>{var r;if(y(a.value),e.onPreviewChange){const u={value:a.value,nativeEvent:a.nativeEvent,syntheticEvent:a.syntheticEvent};e.onPreviewChange.call(void 0,u)}(r=e._gradientSettings)!=null&&r._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(a.value)},[e.onPreviewChange]),j=t.useCallback(a=>{if(c!==void 0&&G(c),e.onChange){const r={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,r)}},[c,e.onChange]),D=t.useCallback(()=>{y(k),e.setOpen&&e.setOpen(!1)},[k]),K=t.useCallback(a=>{if(y(k),e.onPreviewChange){const r={value:k,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,r)}},[k,e.onPreviewChange]),H=t.useCallback(a=>{var u,I;if((!a.relatedTarget||!((u=B.current)!=null&&u.contains(a.relatedTarget)))&&!((I=e._gradientSettings)!=null&&I._adaptive)&&(!w&&c!==void 0&&G(c),!w&&e.onChange)){const $={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,$)}},[c,w,e.onChange]),O=t.useMemo(()=>new n.Navigation({root:B,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))}}}}),[]),W=t.useCallback(O.triggerKeyboardEvent.bind(O),[]);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:B,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:H,onKeyDown:W},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":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:f.dropletSliderIcon,selected:g,onClick:()=>S("gradient")}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:f.paletteIcon,selected:!g,onClick:()=>S("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":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:f.paletteIcon,selected:!g,onClick:()=>S("palette")}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,svgIcon:f.dropletSliderIcon,selected:g,onClick:()=>S("gradient")})),P&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),togglable:!0,fillMode:"flat",size:i,selected:C,onClick:()=>R("ColorGradient"),icon:"droplet-slider",svgIcon:f.dropletSliderIcon}),t.createElement(s.Button,{type:"button","aria-label":m.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),togglable:!0,fillMode:"flat",size:i,selected:!C,onClick:()=>R("ColorPalette"),icon:"palette",svgIcon:f.paletteIcon}))),t.createElement("div",{className:"k-spacer"}),t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},F&&t.createElement(s.Button,{type:"button",fillMode:"flat",size:i,onClick:T,"aria-label":m.toLanguageString(l.flatColorPickerClearBtn,l.messages[l.flatColorPickerClearBtn]),icon:"droplet-slash",svgIcon:f.dropletSlashIcon}),x&&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":k===void 0}),onClick:K},t.createElement("span",{className:"k-color-preview-mask",style:{background:k||void 0}})))),b&&t.createElement(n.WatermarkOverlay,null)),t.createElement("div",{className:"k-coloreditor-views k-vstack"},(P&&C||d&&g)&&t.createElement(U.ColorGradient,{ref:A,role:"none",ariaLabel:void 0,value:c,onChange:q,opacity:e.opacity,format:e.format,size:i,_adaptive:e._gradientSettings?e._gradientSettings._adaptive:void 0,...e._gradientSettings}),(P&&!C||d&&!g)&&t.createElement(Q.ColorPalette,{ariaDisabled:!0,ariaLabelledBy:"required_label",value:c,onChange:q,size:i,...e._paletteSettings})),w&&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",size:i,onClick:j},l.messages[l.flatColorPickerApplyBtn]),t.createElement(s.Button,{type:"button",className:"k-coloreditor-cancel",size:i,onClick:D},l.messages[l.flatColorPickerCancelBtn])))}),p={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([null,"small","medium","large"])};M.displayName="KendoFlatColorPicker";M.propTypes=p;exports.FlatColorPicker=M;
@@ -5,18 +5,18 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as a from "react";
8
+ import * as t from "react";
9
9
  import l from "prop-types";
10
- import { validatePackage as ee, Navigation as ae, getActiveElement as _, disableNavigatableContainer as K, keepFocusInContainer as te, focusFirstFocusableChild as le, enableNavigatableContainer as ne, getTabIndex as oe, classNames as V, kendoThemeMaps as ie, WatermarkOverlay as re } from "@progress/kendo-react-common";
10
+ import { validatePackage as ee, Navigation as te, getActiveElement as _, disableNavigatableContainer as K, keepFocusInContainer as ae, focusFirstFocusableChild as le, enableNavigatableContainer as ne, getTabIndex as oe, classNames as V, kendoThemeMaps as ie, WatermarkOverlay as re } from "@progress/kendo-react-common";
11
11
  import { ButtonGroup as L, Button as s } from "@progress/kendo-react-buttons";
12
12
  import { dropletSliderIcon as M, paletteIcon as G, dropletSlashIcon as ce } from "@progress/kendo-svg-icons";
13
13
  import { ColorPalette as de } from "./ColorPalette.mjs";
14
14
  import { ColorGradient as se } from "./ColorGradient.mjs";
15
15
  import { packageMetadata as ue } from "../package-metadata.mjs";
16
16
  import { useLocalization as ve } from "@progress/kendo-react-intl";
17
- import { flatColorPickerColorGradientBtn as k, messages as u, flatColorPickerColorPaletteBtn as C, flatColorPickerClearBtn as O, flatColorPickerCancelBtn as ge, flatColorPickerApplyBtn as me } from "../messages/index.mjs";
18
- const T = a.forwardRef((e, D) => {
19
- const H = !ee(ue, { component: "FlatColorPicker" }), f = a.useRef(null), y = a.useRef(null), W = a.useRef(null), {
17
+ import { flatColorPickerColorGradientBtn as k, messages as u, flatColorPickerColorPaletteBtn as C, flatColorPickerClearBtn as O, flatColorPickerApplyBtn as ge, flatColorPickerCancelBtn as me } from "../messages/index.mjs";
18
+ const T = t.forwardRef((e, D) => {
19
+ const H = !ee(ue, { component: "FlatColorPicker" }), f = t.useRef(null), y = t.useRef(null), W = t.useRef(null), {
20
20
  defaultValue: b,
21
21
  showButtons: w = !0,
22
22
  showPreview: q = !0,
@@ -25,18 +25,18 @@ const T = a.forwardRef((e, D) => {
25
25
  views: r = h ? void 0 : ["gradient", "palette"],
26
26
  activeView: P = "gradient",
27
27
  size: o = "medium"
28
- } = e, [v, j] = a.useState(
28
+ } = e, [v, j] = t.useState(
29
29
  (h || "ColorGradient") === "ColorGradient"
30
- ), [d, x] = a.useState(
30
+ ), [d, x] = t.useState(
31
31
  (r != null ? r : [])[0] === "gradient" && P === "gradient"
32
- ), [i, E] = a.useState(e.value || b || void 0), [g, I] = a.useState(e.value || b || void 0), B = e.value !== void 0 ? e.value : void 0;
33
- a.useEffect(() => {
32
+ ), [i, E] = t.useState(e.value || b || void 0), [g, I] = t.useState(e.value || b || void 0), B = e.value !== void 0 ? e.value : void 0;
33
+ t.useEffect(() => {
34
34
  E(e.value);
35
35
  }, [e.value]);
36
- const m = ve(), R = a.useCallback(() => {
36
+ const m = ve(), R = t.useCallback(() => {
37
37
  f.current && f.current.focus();
38
38
  }, [f]);
39
- a.useImperativeHandle(
39
+ t.useImperativeHandle(
40
40
  f,
41
41
  () => ({
42
42
  element: y.current,
@@ -45,106 +45,106 @@ const T = a.forwardRef((e, D) => {
45
45
  value: B
46
46
  }),
47
47
  [B, R, e]
48
- ), a.useImperativeHandle(D, () => f.current);
49
- const A = a.useCallback(
50
- (t) => {
51
- (t === "ColorGradient" && !v || t === "ColorPalette" && v) && j(!v);
48
+ ), t.useImperativeHandle(D, () => f.current);
49
+ const A = t.useCallback(
50
+ (a) => {
51
+ (a === "ColorGradient" && !v || a === "ColorPalette" && v) && j(!v);
52
52
  },
53
53
  [v]
54
- ), N = a.useCallback(
55
- (t) => {
56
- t === "gradient" && !d || t === "palette" && d || t === "palette" && P === "gradient" ? x(!d) : t === "gradient" && P === "palette" && x(!0);
54
+ ), N = t.useCallback(
55
+ (a) => {
56
+ a === "gradient" && !d || a === "palette" && d || a === "palette" && P === "gradient" ? x(!d) : a === "gradient" && P === "palette" && x(!0);
57
57
  },
58
58
  [P, d]
59
- ), J = a.useCallback(
60
- (t) => {
59
+ ), J = t.useCallback(
60
+ (a) => {
61
61
  var c;
62
62
  const n = b || void 0;
63
63
  if (E(n), I(n), (c = e._gradientSettings) != null && c._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(n), e.onPreviewChange) {
64
64
  const S = {
65
65
  value: n,
66
- nativeEvent: t.nativeEvent,
67
- syntheticEvent: t
66
+ nativeEvent: a.nativeEvent,
67
+ syntheticEvent: a
68
68
  };
69
69
  e.onPreviewChange.call(void 0, S);
70
70
  }
71
71
  },
72
72
  [b, e.onPreviewChange]
73
- ), F = a.useCallback(
74
- (t) => {
73
+ ), F = t.useCallback(
74
+ (a) => {
75
75
  var n;
76
- if (E(t.value), e.onPreviewChange) {
76
+ if (E(a.value), e.onPreviewChange) {
77
77
  const c = {
78
- value: t.value,
79
- nativeEvent: t.nativeEvent,
80
- syntheticEvent: t.syntheticEvent
78
+ value: a.value,
79
+ nativeEvent: a.nativeEvent,
80
+ syntheticEvent: a.syntheticEvent
81
81
  };
82
82
  e.onPreviewChange.call(void 0, c);
83
83
  }
84
- (n = e._gradientSettings) != null && n._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(t.value);
84
+ (n = e._gradientSettings) != null && n._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(a.value);
85
85
  },
86
86
  [e.onPreviewChange]
87
- ), Q = a.useCallback(
88
- (t) => {
87
+ ), Q = t.useCallback(
88
+ (a) => {
89
89
  if (i !== void 0 && I(i), e.onChange) {
90
90
  const n = {
91
91
  value: i,
92
- nativeEvent: t.nativeEvent,
93
- syntheticEvent: t
92
+ nativeEvent: a.nativeEvent,
93
+ syntheticEvent: a
94
94
  };
95
95
  e.onChange.call(void 0, n);
96
96
  }
97
97
  },
98
98
  [i, e.onChange]
99
- ), U = a.useCallback(() => {
99
+ ), U = t.useCallback(() => {
100
100
  E(g), e.setOpen && e.setOpen(!1);
101
- }, [g]), X = a.useCallback(
102
- (t) => {
101
+ }, [g]), X = t.useCallback(
102
+ (a) => {
103
103
  if (E(g), e.onPreviewChange) {
104
104
  const n = {
105
105
  value: g,
106
- nativeEvent: t.nativeEvent,
107
- syntheticEvent: t
106
+ nativeEvent: a.nativeEvent,
107
+ syntheticEvent: a
108
108
  };
109
109
  e.onPreviewChange.call(void 0, n);
110
110
  }
111
111
  },
112
112
  [g, e.onPreviewChange]
113
- ), Y = a.useCallback(
114
- (t) => {
113
+ ), Y = t.useCallback(
114
+ (a) => {
115
115
  var c, S;
116
- if ((!t.relatedTarget || !((c = y.current) != null && c.contains(t.relatedTarget))) && !((S = e._gradientSettings) != null && S._adaptive) && (!w && i !== void 0 && I(i), !w && e.onChange)) {
116
+ if ((!a.relatedTarget || !((c = y.current) != null && c.contains(a.relatedTarget))) && !((S = e._gradientSettings) != null && S._adaptive) && (!w && i !== void 0 && I(i), !w && e.onChange)) {
117
117
  const p = {
118
118
  value: i,
119
- nativeEvent: t.nativeEvent,
120
- syntheticEvent: t
119
+ nativeEvent: a.nativeEvent,
120
+ syntheticEvent: a
121
121
  };
122
122
  e.onChange.call(void 0, p);
123
123
  }
124
124
  },
125
125
  [i, w, e.onChange]
126
- ), z = a.useMemo(
127
- () => new ae({
126
+ ), z = t.useMemo(
127
+ () => new te({
128
128
  root: y,
129
129
  selectors: [".k-coloreditor"],
130
130
  tabIndex: 0,
131
131
  keyboardEvents: {
132
132
  keydown: {
133
- Tab: (t, n, c) => {
134
- _(document) === t ? K(t) : te(c, t);
133
+ Tab: (a, n, c) => {
134
+ _(document) === a ? K(a) : ae(c, a);
135
135
  },
136
- Enter: (t, n, c) => {
137
- _(document) === t && (le(t), ne(t));
136
+ Enter: (a, n, c) => {
137
+ _(document) === a && (le(a), ne(a));
138
138
  },
139
- Escape: (t, n, c) => {
140
- _(document) !== t && (t.focus(), K(t));
139
+ Escape: (a, n, c) => {
140
+ _(document) !== a && (a.focus(), K(a));
141
141
  }
142
142
  }
143
143
  }
144
144
  }),
145
145
  []
146
- ), Z = a.useCallback(z.triggerKeyboardEvent.bind(z), []);
147
- return /* @__PURE__ */ a.createElement(
146
+ ), Z = t.useCallback(z.triggerKeyboardEvent.bind(z), []);
147
+ return /* @__PURE__ */ t.createElement(
148
148
  "div",
149
149
  {
150
150
  id: e.id,
@@ -166,7 +166,7 @@ const T = a.forwardRef((e, D) => {
166
166
  onBlur: Y,
167
167
  onKeyDown: Z
168
168
  },
169
- e.header || /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header k-hstack" }, /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, r && r[0] === "gradient" && r[1] === "palette" && /* @__PURE__ */ a.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
169
+ e.header || /* @__PURE__ */ t.createElement("div", { className: "k-coloreditor-header k-hstack" }, /* @__PURE__ */ t.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, r && r[0] === "gradient" && r[1] === "palette" && /* @__PURE__ */ t.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ t.createElement(
170
170
  s,
171
171
  {
172
172
  type: "button",
@@ -181,7 +181,7 @@ const T = a.forwardRef((e, D) => {
181
181
  selected: d,
182
182
  onClick: () => N("gradient")
183
183
  }
184
- ), /* @__PURE__ */ a.createElement(
184
+ ), /* @__PURE__ */ t.createElement(
185
185
  s,
186
186
  {
187
187
  type: "button",
@@ -196,7 +196,7 @@ const T = a.forwardRef((e, D) => {
196
196
  selected: !d,
197
197
  onClick: () => N("palette")
198
198
  }
199
- )), r && r[0] === "palette" && r[1] === "gradient" && /* @__PURE__ */ a.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
199
+ )), r && r[0] === "palette" && r[1] === "gradient" && /* @__PURE__ */ t.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ t.createElement(
200
200
  s,
201
201
  {
202
202
  type: "button",
@@ -211,7 +211,7 @@ const T = a.forwardRef((e, D) => {
211
211
  selected: !d,
212
212
  onClick: () => N("palette")
213
213
  }
214
- ), /* @__PURE__ */ a.createElement(
214
+ ), /* @__PURE__ */ t.createElement(
215
215
  s,
216
216
  {
217
217
  type: "button",
@@ -226,7 +226,7 @@ const T = a.forwardRef((e, D) => {
226
226
  selected: d,
227
227
  onClick: () => N("gradient")
228
228
  }
229
- )), h && /* @__PURE__ */ a.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
229
+ )), h && /* @__PURE__ */ t.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ t.createElement(
230
230
  s,
231
231
  {
232
232
  type: "button",
@@ -242,7 +242,7 @@ const T = a.forwardRef((e, D) => {
242
242
  icon: "droplet-slider",
243
243
  svgIcon: M
244
244
  }
245
- ), /* @__PURE__ */ a.createElement(
245
+ ), /* @__PURE__ */ t.createElement(
246
246
  s,
247
247
  {
248
248
  type: "button",
@@ -258,7 +258,7 @@ const T = a.forwardRef((e, D) => {
258
258
  icon: "palette",
259
259
  svgIcon: G
260
260
  }
261
- ))), /* @__PURE__ */ a.createElement("div", { className: "k-spacer" }), /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, $ && /* @__PURE__ */ a.createElement(
261
+ ))), /* @__PURE__ */ t.createElement("div", { className: "k-spacer" }), /* @__PURE__ */ t.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, $ && /* @__PURE__ */ t.createElement(
262
262
  s,
263
263
  {
264
264
  type: "button",
@@ -272,21 +272,21 @@ const T = a.forwardRef((e, D) => {
272
272
  icon: "droplet-slash",
273
273
  svgIcon: ce
274
274
  }
275
- ), q && /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-preview k-vstack" }, /* @__PURE__ */ a.createElement(
275
+ ), q && /* @__PURE__ */ t.createElement("div", { className: "k-coloreditor-preview k-vstack" }, /* @__PURE__ */ t.createElement(
276
276
  "span",
277
277
  {
278
278
  className: V("k-coloreditor-preview-color", "k-color-preview", {
279
279
  "k-no-color": B === void 0
280
280
  })
281
281
  },
282
- /* @__PURE__ */ a.createElement(
282
+ /* @__PURE__ */ t.createElement(
283
283
  "span",
284
284
  {
285
285
  className: "k-color-preview-mask",
286
286
  style: { background: i || void 0 }
287
287
  }
288
288
  )
289
- ), /* @__PURE__ */ a.createElement(
289
+ ), /* @__PURE__ */ t.createElement(
290
290
  "span",
291
291
  {
292
292
  className: V("k-coloreditor-current-color", "k-color-preview", {
@@ -294,15 +294,15 @@ const T = a.forwardRef((e, D) => {
294
294
  }),
295
295
  onClick: X
296
296
  },
297
- /* @__PURE__ */ a.createElement(
297
+ /* @__PURE__ */ t.createElement(
298
298
  "span",
299
299
  {
300
300
  className: "k-color-preview-mask",
301
301
  style: { background: g || void 0 }
302
302
  }
303
303
  )
304
- ))), H && /* @__PURE__ */ a.createElement(re, null)),
305
- /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-views k-vstack" }, (h && v || r && d) && /* @__PURE__ */ a.createElement(
304
+ ))), H && /* @__PURE__ */ t.createElement(re, null)),
305
+ /* @__PURE__ */ t.createElement("div", { className: "k-coloreditor-views k-vstack" }, (h && v || r && d) && /* @__PURE__ */ t.createElement(
306
306
  se,
307
307
  {
308
308
  ref: W,
@@ -316,7 +316,7 @@ const T = a.forwardRef((e, D) => {
316
316
  _adaptive: e._gradientSettings ? e._gradientSettings._adaptive : void 0,
317
317
  ...e._gradientSettings
318
318
  }
319
- ), (h && !v || r && !d) && /* @__PURE__ */ a.createElement(
319
+ ), (h && !v || r && !d) && /* @__PURE__ */ t.createElement(
320
320
  de,
321
321
  {
322
322
  ariaDisabled: !0,
@@ -327,7 +327,7 @@ const T = a.forwardRef((e, D) => {
327
327
  ...e._paletteSettings
328
328
  }
329
329
  )),
330
- w && /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-footer k-actions k-actions-end k-actions-horizontal" }, /* @__PURE__ */ a.createElement(s, { type: "button", className: "k-coloreditor-cancel", size: o, onClick: U }, u[ge]), /* @__PURE__ */ a.createElement(
330
+ w && /* @__PURE__ */ t.createElement("div", { className: "k-coloreditor-footer k-actions k-actions-start k-actions-horizontal" }, /* @__PURE__ */ t.createElement(
331
331
  s,
332
332
  {
333
333
  type: "button",
@@ -336,8 +336,8 @@ const T = a.forwardRef((e, D) => {
336
336
  size: o,
337
337
  onClick: Q
338
338
  },
339
- u[me]
340
- ))
339
+ u[ge]
340
+ ), /* @__PURE__ */ t.createElement(s, { type: "button", className: "k-coloreditor-cancel", size: o, onClick: U }, u[me]))
341
341
  );
342
342
  }), ke = {
343
343
  id: l.string,