@progress/kendo-react-inputs 8.2.0-develop.29 → 8.2.0-develop.30
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/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +181 -121
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +29 -29
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +168 -152
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +120 -104
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +78 -41
- package/index.d.ts +78 -41
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
package/colors/ColorPalette.mjs
CHANGED
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as i from "react";
|
|
10
10
|
import s from "prop-types";
|
|
11
11
|
import { ColorPaletteService as E } from "./utils/color-palette.service.mjs";
|
|
12
|
-
import {
|
|
12
|
+
import { KEYS as a, validatePackage as k, classNames as C, getTabIndex as R, dispatchEvent as F, createPropsContext as N, withIdHOC as P, withPropsContext as T } from "@progress/kendo-react-common";
|
|
13
13
|
import { packageMetadata as I } from "../package-metadata.mjs";
|
|
14
14
|
import { PALETTEPRESETS as D } from "./models/palette-presets.mjs";
|
|
15
15
|
import { isPresent as L } from "./utils/misc.mjs";
|
|
16
16
|
import { parseColor as U } from "./utils/color-parser.mjs";
|
|
17
|
-
const x = 24,
|
|
17
|
+
const x = 24, m = 10, z = "office", n = class n extends i.Component {
|
|
18
18
|
constructor(t) {
|
|
19
|
-
super(t), this.
|
|
20
|
-
this.
|
|
19
|
+
super(t), this.wrapperRef = i.createRef(), this.paletteService = null, this.focus = () => {
|
|
20
|
+
this.wrapperRef && this.wrapperRef.current && this.wrapperRef.current.focus();
|
|
21
21
|
}, this.onKeyDown = (e) => {
|
|
22
|
-
switch (e.
|
|
22
|
+
switch (e.key) {
|
|
23
23
|
case a.down:
|
|
24
24
|
this.handleCellNavigation(0, 1);
|
|
25
25
|
break;
|
|
@@ -62,23 +62,23 @@ const x = 24, g = 10, z = "office", n = class n extends l.Component {
|
|
|
62
62
|
render() {
|
|
63
63
|
const t = this.getPaletteInfo(), e = this.paletteService = new E();
|
|
64
64
|
e.setColorMatrix(t.colors, t.columns);
|
|
65
|
-
const o = e.getCellCoordsFor(this.state.selectedColor), r = e.getCellCoordsFor(this.state.focusedColor),
|
|
66
|
-
return t.colors.length ? /* @__PURE__ */
|
|
65
|
+
const o = e.getCellCoordsFor(this.state.selectedColor), r = e.getCellCoordsFor(this.state.focusedColor), l = C("k-colorpalette", { "k-disabled": this.props.disabled }, this.props.className);
|
|
66
|
+
return t.colors.length ? /* @__PURE__ */ i.createElement(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
69
|
id: this.props.id,
|
|
70
70
|
role: "grid",
|
|
71
|
-
className:
|
|
71
|
+
className: l,
|
|
72
72
|
onFocus: this.onFocus,
|
|
73
73
|
onBlur: this.onBlur,
|
|
74
74
|
onKeyDown: this.onKeyDown,
|
|
75
75
|
"aria-disabled": this.props.ariaDisabled || (this.props.disabled ? "true" : void 0),
|
|
76
76
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
77
77
|
"aria-describedby": this.props.ariaDescribedBy,
|
|
78
|
-
tabIndex:
|
|
79
|
-
ref:
|
|
78
|
+
tabIndex: R(this.props.tabIndex, this.props.disabled),
|
|
79
|
+
ref: this.wrapperRef
|
|
80
80
|
},
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ i.createElement("table", { className: "k-colorpalette-table", role: "presentation" }, /* @__PURE__ */ i.createElement("tbody", { role: "rowgroup" }, this.renderRows(e.colorRows, o, r)))
|
|
82
82
|
) : "";
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
@@ -110,7 +110,7 @@ const x = 24, g = 10, z = "office", n = class n extends l.Component {
|
|
|
110
110
|
this.isUncontrolled && this.setState({ selectedColor: this.state.focusedColor }), this.dispatchChangeEvent(this.state.focusedColor, t);
|
|
111
111
|
}
|
|
112
112
|
dispatchChangeEvent(t, e) {
|
|
113
|
-
|
|
113
|
+
F(this.props.onChange, e, this, { value: t, rgbaValue: U(t, "rgba") });
|
|
114
114
|
}
|
|
115
115
|
get focusedColorCooridanates() {
|
|
116
116
|
return this.state.focusedColor && this.paletteService ? this.paletteService.getCellCoordsFor(this.state.focusedColor) : void 0;
|
|
@@ -123,33 +123,33 @@ const x = 24, g = 10, z = "office", n = class n extends l.Component {
|
|
|
123
123
|
const t = D[this.props.palette];
|
|
124
124
|
return L(t) ? {
|
|
125
125
|
colors: t.colors,
|
|
126
|
-
columns: this.props.columns || t.columns ||
|
|
126
|
+
columns: this.props.columns || t.columns || m
|
|
127
127
|
} : { colors: [], columns: 0 };
|
|
128
128
|
} else
|
|
129
|
-
return { colors: this.props.palette || [], columns: this.props.columns ||
|
|
129
|
+
return { colors: this.props.palette || [], columns: this.props.columns || m };
|
|
130
130
|
}
|
|
131
131
|
renderRows(t, e, o) {
|
|
132
|
-
return t.map((r,
|
|
132
|
+
return t.map((r, l) => /* @__PURE__ */ i.createElement("tr", { role: "row", key: l }, this.renderColumns(r, l, e, o)));
|
|
133
133
|
}
|
|
134
134
|
renderColumns(t, e, o, r) {
|
|
135
|
-
const
|
|
136
|
-
return t.map((
|
|
137
|
-
const
|
|
135
|
+
const l = o !== void 0 && o.row === e, g = o && o.col, v = r !== void 0 && r.row === e, b = r && r.col, h = typeof this.props.tileSize != "number" ? this.props.tileSize : { width: this.props.tileSize, height: this.props.tileSize }, u = h.width + "px", S = h.height + "px";
|
|
136
|
+
return t.map((d, c) => {
|
|
137
|
+
const f = l && g === c, w = C(
|
|
138
138
|
"k-colorpalette-tile",
|
|
139
139
|
{
|
|
140
|
-
"k-selected":
|
|
140
|
+
"k-selected": f,
|
|
141
141
|
"k-focus": v && b === c
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ i.createElement(
|
|
145
145
|
"td",
|
|
146
146
|
{
|
|
147
147
|
role: "gridcell",
|
|
148
148
|
className: w,
|
|
149
|
-
"aria-label":
|
|
150
|
-
"aria-selected":
|
|
151
|
-
style: { backgroundColor:
|
|
152
|
-
onClick: (y) => this.onColorClick(
|
|
149
|
+
"aria-label": d,
|
|
150
|
+
"aria-selected": f ? !0 : this.props.disabled ? void 0 : !1,
|
|
151
|
+
style: { backgroundColor: d, width: u, height: S, minWidth: u },
|
|
152
|
+
onClick: (y) => this.onColorClick(d, y),
|
|
153
153
|
id: this.createCellId({ row: e, col: c }),
|
|
154
154
|
key: c
|
|
155
155
|
}
|
|
@@ -178,14 +178,14 @@ n.displayName = "ColorPalette", n.propTypes = {
|
|
|
178
178
|
palette: z,
|
|
179
179
|
tileSize: x
|
|
180
180
|
};
|
|
181
|
-
let
|
|
182
|
-
const B =
|
|
181
|
+
let p = n;
|
|
182
|
+
const B = N(), A = P(T(B, p));
|
|
183
183
|
A.displayName = "KendoReactColorPalette";
|
|
184
184
|
export {
|
|
185
185
|
A as ColorPalette,
|
|
186
186
|
B as ColorPalettePropsContext,
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
p as ColorPaletteWithoutContext,
|
|
188
|
+
m as DEFAULT_COLUMNS_COUNT,
|
|
189
189
|
z as DEFAULT_PRESET,
|
|
190
190
|
x as DEFAULT_TILE_SIZE
|
|
191
191
|
};
|
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("react"),r=require("prop-types"),o=require("@progress/kendo-react-common"),ke=require("../package-metadata.js"),me=require("./Picker.js"),ge=require("./ColorGradient.js"),M=require("./ColorPalette.js"),be=require("@progress/kendo-react-buttons"),ve=require("@progress/kendo-svg-icons"),F=require("../messages/index.js"),Ee=require("@progress/kendo-react-intl");function Ce(c){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const a in c)if(a!=="default"){const b=Object.getOwnPropertyDescriptor(c,a);Object.defineProperty(m,a,b.get?b:{enumerable:!0,get:()=>c[a]})}}return m.default=c,Object.freeze(m)}const e=Ce(fe),ye={opacity:!0},Pe={palette:M.DEFAULT_PRESET,tileSize:M.DEFAULT_TILE_SIZE},L=c=>c!==void 0,K=o.createPropsContext(),B=e.forwardRef((c,m)=>{o.validatePackage(ke.packageMetadata);const a=o.usePropsContext(K,c),b=Ee.useLocalization(),{size:P=k.size,rounded:T=k.rounded,fillMode:q=k.fillMode,gradientSettings:U=k.gradientSettings,paletteSettings:$=k.paletteSettings,view:u=k.view,popupSettings:W,valid:Z,disabled:w,tabIndex:J,icon:S,svgIcon:I,iconClassName:v,onChange:R,onFocus:D,onBlur:N,onActiveColorClick:h,className:Q}=a,l=e.useRef(null),g=e.useRef(null),E=e.useRef(null),f=e.useRef(),X=e.useRef(null),[Y,x]=e.useState(!1),[ee,te]=e.useState(a.defaultValue),[ne,oe]=e.useState(!1),A=L(a.value),d=L(a.open),i=A?a.value:ee,C=d?a.open:ne,_=e.useCallback(()=>{l.current&&l.current.focus()},[]);e.useImperativeHandle(m,()=>({element:l.current,actionElement:X.current,value:i,focus:_}),[i,_]);const p=e.useCallback((t,s)=>{d||(!t&&!s&&l&&l.current&&l.current.focus(),oe(t))},[d]),z=e.useMemo(()=>new o.Navigation({root:l,selectors:[".k-colorpicker",".k-color-picker-popup"],tabIndex:0,keyboardEvents:{keydown:{Escape:(t,s,n)=>{p(!1)},Enter:(t,s,n)=>{!d&&t===l.current&&(n.preventDefault(),n.stopPropagation(),p(!0))},ArrowDown:(t,s,n)=>{n.altKey&&(n.preventDefault(),n.stopPropagation(),p(!0))},ArrowUp:(t,s,n)=>{n.altKey&&(n.preventDefault(),n.stopPropagation(),p(!1))},Tab:(t,s,n)=>{var V,j;if(o.getActiveElement(document)!==l.current){const G=(V=E.current)==null?void 0:V.wrapperRef.current,y=(j=g.current)==null?void 0:j.wrapperRef.current;u==="palette"&&G?o.keepFocusInContainer(n,G):u==="gradient"&&y?o.keepFocusInContainer(n,y):u==="combo"&&y&&o.keepFocusInContainer(n,y.parentElement)}}}}}),[p,d]),ae=e.useCallback(z.triggerKeyboardEvent.bind(z),[]),re=e.useCallback(()=>{d||(g.current&&g.current.wrapperRef.current?o.focusFirstFocusableChild(g.current.wrapperRef.current):E.current&&E.current.focus())},[d]),le=e.useCallback(()=>{p(!C,!0)},[C]),ce=e.useCallback(t=>{h&&h.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:i})},[h,i]),ie=e.useCallback(t=>{f.current?(clearTimeout(f.current),f.current=void 0):x(!0),D&&D.call(void 0,{nativeEvent:t.nativeEvent,syntheticEvent:t})},[D]),se=e.useCallback(()=>{p(!1,!0),x(!1),f.current=void 0},[]),ue=e.useCallback(t=>{clearTimeout(f.current),f.current=window.setTimeout(se),N&&N.call(void 0,{nativeEvent:t.nativeEvent,syntheticEvent:t})},[N]),O=e.useCallback((t,s)=>{const n=s?t.rgbaValue:t.value;A||te(n),R&&R.call(void 0,{value:n,nativeEvent:t.nativeEvent,syntheticEvent:t.syntheticEvent})},[A,R]),de=e.useCallback(t=>O(t,!0),[L,O]),H=o.useDir(l,a.dir),pe=Z!==!1;return e.createElement("span",{id:a.id,role:"combobox","aria-label":a.ariaLabel,"aria-labelledby":a.ariaLabelledBy,"aria-describedby":a.ariaDescribedBy,"aria-haspopup":"dialog","aria-expanded":C,"aria-disabled":w?"true":void 0,className:o.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${o.kendoThemeMaps.sizeMap[P]||P}`]:P,[`k-picker-${q}`]:q,[`k-rounded-${o.kendoThemeMaps.roundedMap[T]||T}`]:T,"k-invalid":!pe,"k-disabled":w,"k-focus":Y,className:Q}),ref:l,tabIndex:o.getTabIndex(J,w),title:a.title,onKeyDown:ae,onFocus:ie,onBlur:ue,dir:H},e.createElement(me.Picker,{dir:H,open:C,onOpen:re,popupAnchor:l.current||void 0,popupSettings:{...W},input:e.createElement("span",{onClick:ce,className:"k-input-inner"},e.createElement("span",{className:o.classNames("k-value-icon","k-color-preview",{"k-no-color":!i,"k-icon-color-preview":S||I||v})},v&&e.createElement("span",{className:o.classNames("k-color-preview-icon",v)}),!v&&(S||I)&&e.createElement(o.IconWrap,{name:S,icon:I}),e.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:i}}))),button:e.createElement(be.Button,{tabIndex:-1,type:"button",onClick:le,className:"k-input-button",rounded:null,icon:"caret-alt-down",svgIcon:ve.caretAltDownIcon,"aria-label":b.toLanguageString(F.colorPickerDropdownButtonAriaLabel,F.messages[F.colorPickerDropdownButtonAriaLabel])}),content:e.createElement(e.Fragment,null,(u==="combo"||u==="gradient")&&e.createElement(ge.ColorGradient,{...U,ref:g,isInsidePopup:!0,value:i,onChange:O}),(u==="combo"||u==="palette")&&e.createElement(M.ColorPalette,{...$,ref:E,value:i,onChange:de}))}))});B.propTypes={value:r.string,defaultValue:r.string,disabled:r.bool,view:r.oneOf(["gradient","palette","combo"]),dir:r.string,id:r.string,icon:r.string,svgIcon:o.svgIconPropType,ariaLabelledBy:r.string,ariaDescribedBy:r.string,size:r.oneOf([null,"small","medium","large"]),rounded:r.oneOf([null,"small","medium","large","full"]),fillMode:r.oneOf([null,"solid","flat","outline"]),className:r.string};const k={size:"medium",rounded:"medium",fillMode:"solid",view:"palette",gradientSettings:ye,paletteSettings:Pe};B.displayName="KendoColorPicker";exports.ColorPicker=B;exports.ColorPickerPropsContext=K;
|
package/colors/ColorPicker.mjs
CHANGED
|
@@ -7,246 +7,262 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
|
-
import
|
|
11
|
-
import { createPropsContext as
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
import { Picker as
|
|
14
|
-
import { ColorGradient as
|
|
15
|
-
import { ColorPalette as
|
|
16
|
-
import { Button as
|
|
17
|
-
import { caretAltDownIcon as
|
|
18
|
-
import { colorPickerDropdownButtonAriaLabel as
|
|
19
|
-
import { useLocalization as
|
|
20
|
-
const
|
|
10
|
+
import o from "prop-types";
|
|
11
|
+
import { createPropsContext as fe, validatePackage as me, usePropsContext as ve, Navigation as ke, getActiveElement as ge, keepFocusInContainer as h, focusFirstFocusableChild as be, useDir as Ee, classNames as A, kendoThemeMaps as _, getTabIndex as Ce, IconWrap as we, svgIconPropType as ye } from "@progress/kendo-react-common";
|
|
12
|
+
import { packageMetadata as Te } from "../package-metadata.mjs";
|
|
13
|
+
import { Picker as Se } from "./Picker.mjs";
|
|
14
|
+
import { ColorGradient as Pe } from "./ColorGradient.mjs";
|
|
15
|
+
import { ColorPalette as Ie, DEFAULT_PRESET as Re, DEFAULT_TILE_SIZE as De } from "./ColorPalette.mjs";
|
|
16
|
+
import { Button as Ne } from "@progress/kendo-react-buttons";
|
|
17
|
+
import { caretAltDownIcon as he } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { colorPickerDropdownButtonAriaLabel as K, messages as Ae } from "../messages/index.mjs";
|
|
19
|
+
import { useLocalization as Fe } from "@progress/kendo-react-intl";
|
|
20
|
+
const Le = {
|
|
21
21
|
opacity: !0
|
|
22
|
-
},
|
|
23
|
-
palette:
|
|
24
|
-
tileSize:
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
size:
|
|
29
|
-
rounded:
|
|
30
|
-
fillMode:
|
|
31
|
-
gradientSettings:
|
|
32
|
-
paletteSettings:
|
|
33
|
-
view:
|
|
34
|
-
popupSettings:
|
|
35
|
-
valid:
|
|
36
|
-
disabled:
|
|
37
|
-
tabIndex:
|
|
38
|
-
icon:
|
|
39
|
-
svgIcon:
|
|
40
|
-
iconClassName:
|
|
41
|
-
onChange:
|
|
42
|
-
onFocus:
|
|
43
|
-
onBlur:
|
|
44
|
-
onActiveColorClick:
|
|
45
|
-
className:
|
|
46
|
-
} =
|
|
22
|
+
}, xe = {
|
|
23
|
+
palette: Re,
|
|
24
|
+
tileSize: De
|
|
25
|
+
}, F = (b) => b !== void 0, Be = fe(), U = e.forwardRef((b, G) => {
|
|
26
|
+
me(Te);
|
|
27
|
+
const a = ve(Be, b), $ = Fe(), {
|
|
28
|
+
size: E = d.size,
|
|
29
|
+
rounded: C = d.rounded,
|
|
30
|
+
fillMode: L = d.fillMode,
|
|
31
|
+
gradientSettings: W = d.gradientSettings,
|
|
32
|
+
paletteSettings: Z = d.paletteSettings,
|
|
33
|
+
view: s = d.view,
|
|
34
|
+
popupSettings: j,
|
|
35
|
+
valid: q,
|
|
36
|
+
disabled: w,
|
|
37
|
+
tabIndex: J,
|
|
38
|
+
icon: y,
|
|
39
|
+
svgIcon: T,
|
|
40
|
+
iconClassName: m,
|
|
41
|
+
onChange: S,
|
|
42
|
+
onFocus: P,
|
|
43
|
+
onBlur: I,
|
|
44
|
+
onActiveColorClick: R,
|
|
45
|
+
className: Q
|
|
46
|
+
} = a, r = e.useRef(null), f = e.useRef(null), v = e.useRef(null), p = e.useRef(), X = e.useRef(null), [Y, x] = e.useState(!1), [ee, te] = e.useState(a.defaultValue), [ne, oe] = e.useState(!1), D = F(a.value), c = F(a.open), l = D ? a.value : ee, k = c ? a.open : ne, B = e.useCallback(
|
|
47
47
|
() => {
|
|
48
|
-
|
|
48
|
+
r.current && r.current.focus();
|
|
49
49
|
},
|
|
50
50
|
[]
|
|
51
51
|
);
|
|
52
|
-
e.useImperativeHandle(
|
|
52
|
+
e.useImperativeHandle(G, () => ({
|
|
53
53
|
// we agreed that each element will have focus method exposed
|
|
54
|
-
element:
|
|
55
|
-
actionElement:
|
|
54
|
+
element: r.current,
|
|
55
|
+
actionElement: X.current,
|
|
56
56
|
value: l,
|
|
57
57
|
focus: B
|
|
58
58
|
}), [l, B]);
|
|
59
|
-
const
|
|
60
|
-
(t,
|
|
61
|
-
|
|
59
|
+
const u = e.useCallback(
|
|
60
|
+
(t, i) => {
|
|
61
|
+
c || (!t && !i && r && r.current && r.current.focus(), oe(t));
|
|
62
62
|
},
|
|
63
|
-
[
|
|
64
|
-
),
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
[c]
|
|
64
|
+
), M = e.useMemo(
|
|
65
|
+
() => new ke({
|
|
66
|
+
root: r,
|
|
67
|
+
selectors: [".k-colorpicker", ".k-color-picker-popup"],
|
|
68
|
+
tabIndex: 0,
|
|
69
|
+
keyboardEvents: {
|
|
70
|
+
keydown: {
|
|
71
|
+
Escape: (t, i, n) => {
|
|
72
|
+
u(!1);
|
|
73
|
+
},
|
|
74
|
+
Enter: (t, i, n) => {
|
|
75
|
+
!c && t === r.current && (n.preventDefault(), n.stopPropagation(), u(!0));
|
|
76
|
+
},
|
|
77
|
+
ArrowDown: (t, i, n) => {
|
|
78
|
+
n.altKey && (n.preventDefault(), n.stopPropagation(), u(!0));
|
|
79
|
+
},
|
|
80
|
+
ArrowUp: (t, i, n) => {
|
|
81
|
+
n.altKey && (n.preventDefault(), n.stopPropagation(), u(!1));
|
|
82
|
+
},
|
|
83
|
+
Tab: (t, i, n) => {
|
|
84
|
+
var z, H;
|
|
85
|
+
if (ge(document) !== r.current) {
|
|
86
|
+
const V = (z = v.current) == null ? void 0 : z.wrapperRef.current, g = (H = f.current) == null ? void 0 : H.wrapperRef.current;
|
|
87
|
+
s === "palette" && V ? h(n, V) : s === "gradient" && g ? h(n, g) : s === "combo" && g && h(n, g.parentElement);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
74
91
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
), ee = e.useCallback(
|
|
92
|
+
}),
|
|
93
|
+
[u, c]
|
|
94
|
+
), ae = e.useCallback(M.triggerKeyboardEvent.bind(M), []), re = e.useCallback(
|
|
79
95
|
() => {
|
|
80
|
-
|
|
96
|
+
c || (f.current && f.current.wrapperRef.current ? be(f.current.wrapperRef.current) : v.current && v.current.focus());
|
|
81
97
|
},
|
|
82
|
-
[
|
|
83
|
-
),
|
|
98
|
+
[c]
|
|
99
|
+
), le = e.useCallback(
|
|
84
100
|
() => {
|
|
85
|
-
|
|
101
|
+
u(!k, !0);
|
|
86
102
|
},
|
|
87
|
-
[
|
|
88
|
-
),
|
|
103
|
+
[k]
|
|
104
|
+
), ie = e.useCallback(
|
|
89
105
|
(t) => {
|
|
90
|
-
|
|
106
|
+
R && R.call(void 0, {
|
|
91
107
|
syntheticEvent: t,
|
|
92
108
|
nativeEvent: t.nativeEvent,
|
|
93
109
|
value: l
|
|
94
110
|
});
|
|
95
111
|
},
|
|
96
|
-
[
|
|
97
|
-
),
|
|
112
|
+
[R, l]
|
|
113
|
+
), se = e.useCallback(
|
|
98
114
|
(t) => {
|
|
99
|
-
|
|
115
|
+
p.current ? (clearTimeout(p.current), p.current = void 0) : x(!0), P && P.call(void 0, {
|
|
100
116
|
nativeEvent: t.nativeEvent,
|
|
101
117
|
syntheticEvent: t
|
|
102
118
|
});
|
|
103
119
|
},
|
|
104
|
-
[
|
|
105
|
-
),
|
|
120
|
+
[P]
|
|
121
|
+
), ce = e.useCallback(
|
|
106
122
|
() => {
|
|
107
|
-
|
|
123
|
+
u(!1, !0), x(!1), p.current = void 0;
|
|
108
124
|
},
|
|
109
125
|
[]
|
|
110
|
-
),
|
|
126
|
+
), ue = e.useCallback(
|
|
111
127
|
(t) => {
|
|
112
|
-
clearTimeout(
|
|
128
|
+
clearTimeout(p.current), p.current = window.setTimeout(ce), I && I.call(void 0, {
|
|
113
129
|
nativeEvent: t.nativeEvent,
|
|
114
130
|
syntheticEvent: t
|
|
115
131
|
});
|
|
116
132
|
},
|
|
117
|
-
[
|
|
118
|
-
),
|
|
119
|
-
(t,
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
value:
|
|
133
|
+
[I]
|
|
134
|
+
), N = e.useCallback(
|
|
135
|
+
(t, i) => {
|
|
136
|
+
const n = i ? t.rgbaValue : t.value;
|
|
137
|
+
D || te(n), S && S.call(void 0, {
|
|
138
|
+
value: n,
|
|
123
139
|
nativeEvent: t.nativeEvent,
|
|
124
140
|
syntheticEvent: t.syntheticEvent
|
|
125
141
|
});
|
|
126
142
|
},
|
|
127
|
-
[
|
|
128
|
-
),
|
|
129
|
-
(t) =>
|
|
130
|
-
[
|
|
131
|
-
),
|
|
143
|
+
[D, S]
|
|
144
|
+
), pe = e.useCallback(
|
|
145
|
+
(t) => N(t, !0),
|
|
146
|
+
[F, N]
|
|
147
|
+
), O = Ee(r, a.dir), de = q !== !1;
|
|
132
148
|
return /* @__PURE__ */ e.createElement(
|
|
133
149
|
"span",
|
|
134
150
|
{
|
|
135
|
-
id:
|
|
151
|
+
id: a.id,
|
|
136
152
|
role: "combobox",
|
|
137
|
-
"aria-label":
|
|
138
|
-
"aria-labelledby":
|
|
139
|
-
"aria-describedby":
|
|
153
|
+
"aria-label": a.ariaLabel,
|
|
154
|
+
"aria-labelledby": a.ariaLabelledBy,
|
|
155
|
+
"aria-describedby": a.ariaDescribedBy,
|
|
140
156
|
"aria-haspopup": "dialog",
|
|
141
|
-
"aria-expanded":
|
|
142
|
-
"aria-disabled":
|
|
143
|
-
className:
|
|
157
|
+
"aria-expanded": k,
|
|
158
|
+
"aria-disabled": w ? "true" : void 0,
|
|
159
|
+
className: A(
|
|
144
160
|
"k-colorpicker",
|
|
145
161
|
"k-picker",
|
|
146
162
|
"k-icon-picker",
|
|
147
163
|
{
|
|
148
|
-
[`k-picker-${
|
|
149
|
-
[`k-picker-${
|
|
150
|
-
[`k-rounded-${
|
|
151
|
-
"k-invalid": !
|
|
152
|
-
"k-disabled":
|
|
153
|
-
"k-focus":
|
|
154
|
-
className:
|
|
164
|
+
[`k-picker-${_.sizeMap[E] || E}`]: E,
|
|
165
|
+
[`k-picker-${L}`]: L,
|
|
166
|
+
[`k-rounded-${_.roundedMap[C] || C}`]: C,
|
|
167
|
+
"k-invalid": !de,
|
|
168
|
+
"k-disabled": w,
|
|
169
|
+
"k-focus": Y,
|
|
170
|
+
className: Q
|
|
155
171
|
}
|
|
156
172
|
),
|
|
157
|
-
ref:
|
|
158
|
-
tabIndex:
|
|
159
|
-
title:
|
|
160
|
-
onKeyDown:
|
|
161
|
-
onFocus:
|
|
162
|
-
onBlur:
|
|
163
|
-
dir:
|
|
173
|
+
ref: r,
|
|
174
|
+
tabIndex: Ce(J, w),
|
|
175
|
+
title: a.title,
|
|
176
|
+
onKeyDown: ae,
|
|
177
|
+
onFocus: se,
|
|
178
|
+
onBlur: ue,
|
|
179
|
+
dir: O
|
|
164
180
|
},
|
|
165
181
|
/* @__PURE__ */ e.createElement(
|
|
166
|
-
|
|
182
|
+
Se,
|
|
167
183
|
{
|
|
168
|
-
dir:
|
|
169
|
-
open:
|
|
170
|
-
onOpen:
|
|
171
|
-
popupAnchor:
|
|
172
|
-
popupSettings: { ...
|
|
173
|
-
input: /* @__PURE__ */ e.createElement("span", { onClick:
|
|
184
|
+
dir: O,
|
|
185
|
+
open: k,
|
|
186
|
+
onOpen: re,
|
|
187
|
+
popupAnchor: r.current || void 0,
|
|
188
|
+
popupSettings: { ...j },
|
|
189
|
+
input: /* @__PURE__ */ e.createElement("span", { onClick: ie, className: "k-input-inner" }, /* @__PURE__ */ e.createElement(
|
|
174
190
|
"span",
|
|
175
191
|
{
|
|
176
|
-
className:
|
|
192
|
+
className: A(
|
|
177
193
|
"k-value-icon",
|
|
178
194
|
"k-color-preview",
|
|
179
195
|
{
|
|
180
196
|
"k-no-color": !l,
|
|
181
|
-
"k-icon-color-preview":
|
|
197
|
+
"k-icon-color-preview": y || T || m
|
|
182
198
|
}
|
|
183
199
|
)
|
|
184
200
|
},
|
|
185
|
-
|
|
186
|
-
!
|
|
201
|
+
m && /* @__PURE__ */ e.createElement("span", { className: A("k-color-preview-icon", m) }),
|
|
202
|
+
!m && (y || T) && /* @__PURE__ */ e.createElement(we, { name: y, icon: T }),
|
|
187
203
|
/* @__PURE__ */ e.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: l } })
|
|
188
204
|
)),
|
|
189
205
|
button: /* @__PURE__ */ e.createElement(
|
|
190
|
-
|
|
206
|
+
Ne,
|
|
191
207
|
{
|
|
192
208
|
tabIndex: -1,
|
|
193
209
|
type: "button",
|
|
194
|
-
onClick:
|
|
210
|
+
onClick: le,
|
|
195
211
|
className: "k-input-button",
|
|
196
212
|
rounded: null,
|
|
197
213
|
icon: "caret-alt-down",
|
|
198
|
-
svgIcon:
|
|
199
|
-
"aria-label":
|
|
214
|
+
svgIcon: he,
|
|
215
|
+
"aria-label": $.toLanguageString(K, Ae[K])
|
|
200
216
|
}
|
|
201
217
|
),
|
|
202
|
-
content: /* @__PURE__ */ e.createElement(e.Fragment, null, (
|
|
203
|
-
|
|
218
|
+
content: /* @__PURE__ */ e.createElement(e.Fragment, null, (s === "combo" || s === "gradient") && /* @__PURE__ */ e.createElement(
|
|
219
|
+
Pe,
|
|
204
220
|
{
|
|
205
|
-
...
|
|
206
|
-
|
|
207
|
-
|
|
221
|
+
...W,
|
|
222
|
+
ref: f,
|
|
223
|
+
isInsidePopup: !0,
|
|
208
224
|
value: l,
|
|
209
|
-
onChange:
|
|
225
|
+
onChange: N
|
|
210
226
|
}
|
|
211
|
-
), (
|
|
212
|
-
|
|
227
|
+
), (s === "combo" || s === "palette") && /* @__PURE__ */ e.createElement(
|
|
228
|
+
Ie,
|
|
213
229
|
{
|
|
214
|
-
...
|
|
215
|
-
ref:
|
|
230
|
+
...Z,
|
|
231
|
+
ref: v,
|
|
216
232
|
value: l,
|
|
217
|
-
onChange:
|
|
233
|
+
onChange: pe
|
|
218
234
|
}
|
|
219
235
|
))
|
|
220
236
|
}
|
|
221
237
|
)
|
|
222
238
|
);
|
|
223
239
|
});
|
|
224
|
-
|
|
225
|
-
value:
|
|
226
|
-
defaultValue:
|
|
227
|
-
disabled:
|
|
228
|
-
view:
|
|
229
|
-
dir:
|
|
230
|
-
id:
|
|
231
|
-
icon:
|
|
232
|
-
svgIcon:
|
|
233
|
-
ariaLabelledBy:
|
|
234
|
-
ariaDescribedBy:
|
|
235
|
-
size:
|
|
236
|
-
rounded:
|
|
237
|
-
fillMode:
|
|
238
|
-
className:
|
|
240
|
+
U.propTypes = {
|
|
241
|
+
value: o.string,
|
|
242
|
+
defaultValue: o.string,
|
|
243
|
+
disabled: o.bool,
|
|
244
|
+
view: o.oneOf(["gradient", "palette", "combo"]),
|
|
245
|
+
dir: o.string,
|
|
246
|
+
id: o.string,
|
|
247
|
+
icon: o.string,
|
|
248
|
+
svgIcon: ye,
|
|
249
|
+
ariaLabelledBy: o.string,
|
|
250
|
+
ariaDescribedBy: o.string,
|
|
251
|
+
size: o.oneOf([null, "small", "medium", "large"]),
|
|
252
|
+
rounded: o.oneOf([null, "small", "medium", "large", "full"]),
|
|
253
|
+
fillMode: o.oneOf([null, "solid", "flat", "outline"]),
|
|
254
|
+
className: o.string
|
|
239
255
|
};
|
|
240
|
-
const
|
|
256
|
+
const d = {
|
|
241
257
|
size: "medium",
|
|
242
258
|
rounded: "medium",
|
|
243
259
|
fillMode: "solid",
|
|
244
260
|
view: "palette",
|
|
245
|
-
gradientSettings:
|
|
246
|
-
paletteSettings:
|
|
261
|
+
gradientSettings: Le,
|
|
262
|
+
paletteSettings: xe
|
|
247
263
|
};
|
|
248
|
-
|
|
264
|
+
U.displayName = "KendoColorPicker";
|
|
249
265
|
export {
|
|
250
|
-
|
|
251
|
-
|
|
266
|
+
U as ColorPicker,
|
|
267
|
+
Be as ColorPickerPropsContext
|
|
252
268
|
};
|