@progress/kendo-react-inputs 8.1.0-develop.9 → 8.1.1-develop.1

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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("react"),t=require("prop-types"),l=require("@progress/kendo-react-common"),ve=require("../package-metadata.js"),Ce=require("@progress/kendo-react-intl"),O=require("../messages/index.js");function ye(s){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const m=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(u,r,m.get?m:{enumerable:!0,get:()=>s[r]})}}return u.default=s,Object.freeze(u)}const e=ye(ge),A=l.createPropsContext(),h=e.forwardRef((s,u)=>{l.validatePackage(ve.packageMetadata);const r=l.usePropsContext(A,s),{ariaDescribedBy:m,ariaLabelledBy:W,checked:B,className:G,labelClassName:J,children:Q,defaultChecked:X,disabled:n,defaultValue:Y,id:q,size:g,rounded:v,label:D,labelPlacement:T,name:Z,labelOptional:ee,onChange:C,onFocus:y,onBlur:x,tabIndex:te,value:i,required:P,valid:z,validationMessage:F,validityStyles:K,visited:Pe,touched:Ee,modified:Ve,...ae}=r,o=e.useRef(null),R=e.useCallback(()=>{o.current&&o.current.focus()},[]),d=e.useCallback(()=>({element:o.current,focus:R,get name(){return o.current&&o.current.name}}),[R]);e.useImperativeHandle(u,d);const[ne,le]=e.useState(X),[oe,ce]=e.useState(Y),w=typeof i=="boolean"||i===null,E=B!==void 0,b=w,V=b?i:oe,k=E?B:b?void 0:ne,j=k===void 0&&V,M=j?V:k,p=j||b?i===null?i:void 0:i||V,L=M===null||p===null,_=l.useId(),se=Ce.useLocalization(),H=a=>se.toLanguageString(a,O.messages[a]),U=H(O.checkboxValidation),re=H(O.checkboxOptionalText),N=z!==void 0?z:P?!!k:!0;e.useEffect(()=>{o.current&&o.current.setCustomValidity&&o.current.setCustomValidity(N?"":F||U)},[N,F,U]);const f=e.useCallback((a,c)=>{!b&&!n&&(ce(c),!E&&!n&&le(c)),C&&!n&&l.dispatchEvent(C,a,{...d(),value:c},{value:c})},[E,n,C,b,d]),ie=e.useCallback(a=>{const c=a.target.checked;f(a,c)},[f,i]),de=e.useCallback(a=>{if(n)return;const{keyCode:c}=a,he=a.currentTarget.checked;c===l.Keys.space&&(a.preventDefault(),a.stopPropagation(),f(a,!he))},[n,f]),ue=e.useCallback(a=>{if(n)return;const{keyCode:c}=a;c===l.Keys.space&&a.preventDefault()},[n]),be=e.useCallback(a=>{y&&!n&&l.dispatchEvent(y,a,d(),void 0)},[y,n,d]),me=e.useCallback(a=>{x&&!n&&l.dispatchEvent(x,a,d(),void 0)},[x,n,d]),ke=l.useDir(o,r.dir),pe=l.classNames("k-checkbox-wrap",G),$={type:"checkbox",className:l.classNames("k-checkbox",{[`k-checkbox-${l.kendoThemeMaps.sizeMap[g]||g}`]:g,[`k-rounded-${l.kendoThemeMaps.roundedMap[v]||v}`]:v,"k-indeterminate":L,"k-disabled":n,"k-invalid k-invalid":!(N||K!==void 0||K===!0)}),ref:o,name:Z,id:q||_,"aria-labelledby":W,"aria-describedby":m,checked:!!M,disabled:n,tabIndex:l.getTabIndex(te,n),role:"checkbox",required:P!==void 0?P:!1,"aria-checked":k||M?!0:L?"mixed":!1,"aria-disabled":n||void 0,...ae,onChange:ie,onKeyDown:de,onKeyUp:ue,onFocus:be,onBlur:me},fe=e.createElement(e.Fragment,null,p===void 0?e.createElement("input",{...$}):e.createElement("input",{...$,value:w?void 0:p===null?"":p})),S=e.createElement(e.Fragment,null,D!==void 0?e.createElement("label",{className:l.classNames("k-checkbox-label",J),htmlFor:q||_,style:{userSelect:"none"}},D,ee&&e.createElement("span",{className:"k-label-optional"},re)):null),I=e.createElement("span",{className:pe},fe,Q);return e.createElement(e.Fragment,null,T==="before"?e.createElement("div",{dir:"rtl"},I,S):T==="after"?e.createElement("div",{dir:"ltr"},I,S):e.createElement("div",{dir:ke},I,S))});h.propTypes={checked:t.bool,className:t.string,defaultChecked:t.bool,defaultValue:t.any,dir:t.string,disabled:t.bool,id:t.string,size:t.oneOf([null,"small","medium","large"]),rounded:t.oneOf([null,"small","medium","large"]),ariaLabelledBy:t.string,ariaDescribedBy:t.string,label:t.any,labelPlacement:t.string,labelOptional:t.bool,name:t.string,tabIndex:t.number,value:t.any,validationMessage:t.string,required:t.bool,validate:t.bool,valid:t.bool,onChange:t.func,onFocus:t.func,onBlur:t.func};const xe={size:"medium",rounded:"medium"};h.defaultProps=xe;h.displayName="KendoCheckbox";exports.Checkbox=h;exports.CheckboxPropsContext=A;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ve=require("react"),t=require("prop-types"),o=require("@progress/kendo-react-common"),Ce=require("../package-metadata.js"),ye=require("@progress/kendo-react-intl"),I=require("../messages/index.js");function xe(s){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const m=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(u,r,m.get?m:{enumerable:!0,get:()=>s[r]})}}return u.default=s,Object.freeze(u)}const e=xe(ve),W=o.createPropsContext(),O=e.forwardRef((s,u)=>{o.validatePackage(Ce.packageMetadata);const r=o.usePropsContext(W,s),{ariaDescribedBy:m,ariaLabelledBy:G,checked:B,className:J,labelClassName:Q,children:X,defaultChecked:Y,disabled:n,defaultValue:Z,id:q,size:h=A.size,rounded:g=A.rounded,label:z,labelPlacement:D,name:ee,labelOptional:te,onChange:v,onFocus:C,onBlur:y,tabIndex:ae,value:i,required:x,valid:T,validationMessage:F,validityStyles:K,visited:Pe,touched:Ee,modified:Ve,...ne}=r,l=e.useRef(null),R=e.useCallback(()=>{l.current&&l.current.focus()},[]),d=e.useCallback(()=>({element:l.current,focus:R,get name(){return l.current&&l.current.name}}),[R]);e.useImperativeHandle(u,d);const[oe,le]=e.useState(Y),[ce,se]=e.useState(Z),w=typeof i=="boolean"||i===null,P=B!==void 0,b=w,E=b?i:ce,k=P?B:b?void 0:oe,j=k===void 0&&E,V=j?E:k,p=j||b?i===null?i:void 0:i||E,L=V===null||p===null,_=o.useId(),re=ye.useLocalization(),H=a=>re.toLanguageString(a,I.messages[a]),U=H(I.checkboxValidation),ie=H(I.checkboxOptionalText),M=T!==void 0?T:x?!!k:!0;e.useEffect(()=>{l.current&&l.current.setCustomValidity&&l.current.setCustomValidity(M?"":F||U)},[M,F,U]);const f=e.useCallback((a,c)=>{!b&&!n&&(se(c),!P&&!n&&le(c)),v&&!n&&o.dispatchEvent(v,a,{...d(),value:c},{value:c})},[P,n,v,b,d]),de=e.useCallback(a=>{const c=a.target.checked;f(a,c)},[f,i]),ue=e.useCallback(a=>{if(n)return;const{keyCode:c}=a,ge=a.currentTarget.checked;c===o.Keys.space&&(a.preventDefault(),a.stopPropagation(),f(a,!ge))},[n,f]),be=e.useCallback(a=>{if(n)return;const{keyCode:c}=a;c===o.Keys.space&&a.preventDefault()},[n]),me=e.useCallback(a=>{C&&!n&&o.dispatchEvent(C,a,d(),void 0)},[C,n,d]),ke=e.useCallback(a=>{y&&!n&&o.dispatchEvent(y,a,d(),void 0)},[y,n,d]),pe=o.useDir(l,r.dir),fe=o.classNames("k-checkbox-wrap",J),$={type:"checkbox",className:o.classNames("k-checkbox",{[`k-checkbox-${o.kendoThemeMaps.sizeMap[h]||h}`]:h,[`k-rounded-${o.kendoThemeMaps.roundedMap[g]||g}`]:g,"k-indeterminate":L,"k-disabled":n,"k-invalid k-invalid":!(M||K!==void 0||K===!0)}),ref:l,name:ee,id:q||_,"aria-labelledby":G,"aria-describedby":m,checked:!!V,disabled:n,tabIndex:o.getTabIndex(ae,n),role:"checkbox",required:x!==void 0?x:!1,"aria-checked":k||V?!0:L?"mixed":!1,"aria-disabled":n||void 0,...ne,onChange:de,onKeyDown:ue,onKeyUp:be,onFocus:me,onBlur:ke},he=p===void 0?e.createElement("input",{...$}):e.createElement("input",{...$,value:w?void 0:p===null?"":p}),N=z!==void 0?e.createElement("label",{className:o.classNames("k-checkbox-label",Q),htmlFor:q||_,style:{userSelect:"none"}},e.createElement(e.Fragment,null,z),te&&e.createElement("span",{className:"k-label-optional"},ie)):null,S=e.createElement("span",{className:fe},he,X);return e.createElement(e.Fragment,null,D==="before"?e.createElement("div",{dir:"rtl"},S,N):D==="after"?e.createElement("div",{dir:"ltr"},S,N):e.createElement("div",{dir:pe},S,N))});O.propTypes={checked:t.bool,className:t.string,defaultChecked:t.bool,defaultValue:t.any,dir:t.string,disabled:t.bool,id:t.string,size:t.oneOf([null,"small","medium","large"]),rounded:t.oneOf([null,"small","medium","large"]),ariaLabelledBy:t.string,ariaDescribedBy:t.string,label:t.any,labelPlacement:t.string,labelOptional:t.bool,name:t.string,tabIndex:t.number,value:t.any,validationMessage:t.string,required:t.bool,validate:t.bool,valid:t.bool,onChange:t.func,onFocus:t.func,onBlur:t.func};const A={size:"medium",rounded:"medium"};O.displayName="KendoCheckbox";exports.Checkbox=O;exports.CheckboxPropsContext=W;
@@ -8,175 +8,173 @@
8
8
  "use client";
9
9
  import * as e from "react";
10
10
  import a from "prop-types";
11
- import { createPropsContext as ge, validatePackage as Ce, usePropsContext as ye, useId as xe, dispatchEvent as E, Keys as $, useDir as Ve, classNames as P, kendoThemeMaps as A, getTabIndex as Ee } from "@progress/kendo-react-common";
12
- import { packageMetadata as Pe } from "../package-metadata.mjs";
13
- import { useLocalization as Be } from "@progress/kendo-react-intl";
14
- import { messages as Ie, checkboxValidation as Me, checkboxOptionalText as Ne } from "../messages/index.mjs";
15
- const Fe = ge(), B = e.forwardRef((W, j) => {
16
- Ce(Pe);
17
- const I = ye(Fe, W), {
18
- ariaDescribedBy: G,
19
- ariaLabelledBy: J,
20
- checked: M,
21
- className: Q,
22
- labelClassName: X,
23
- children: Y,
24
- defaultChecked: Z,
11
+ import { createPropsContext as ge, validatePackage as ye, usePropsContext as xe, useId as Ve, dispatchEvent as E, Keys as U, useDir as Ee, classNames as P, kendoThemeMaps as $, getTabIndex as Pe } from "@progress/kendo-react-common";
12
+ import { packageMetadata as Be } from "../package-metadata.mjs";
13
+ import { useLocalization as Ie } from "@progress/kendo-react-intl";
14
+ import { messages as Me, checkboxValidation as Ne, checkboxOptionalText as ze } from "../messages/index.mjs";
15
+ const Se = ge(), W = e.forwardRef((j, G) => {
16
+ ye(Be);
17
+ const B = xe(Se, j), {
18
+ ariaDescribedBy: J,
19
+ ariaLabelledBy: Q,
20
+ checked: I,
21
+ className: X,
22
+ labelClassName: Y,
23
+ children: Z,
24
+ defaultChecked: _,
25
25
  disabled: l,
26
- defaultValue: _,
27
- id: N,
28
- size: m,
29
- rounded: b,
30
- label: F,
31
- labelPlacement: S,
32
- name: ee,
33
- labelOptional: ae,
26
+ defaultValue: ee,
27
+ id: M,
28
+ size: m = A.size,
29
+ rounded: b = A.rounded,
30
+ label: N,
31
+ labelPlacement: z,
32
+ name: ae,
33
+ labelOptional: te,
34
34
  onChange: p,
35
35
  onFocus: k,
36
36
  onBlur: f,
37
- tabIndex: te,
38
- value: c,
37
+ tabIndex: le,
38
+ value: s,
39
39
  required: h,
40
- valid: z,
40
+ valid: S,
41
41
  validationMessage: D,
42
- validityStyles: K,
42
+ validityStyles: F,
43
43
  // Removed to support direct use in Form Field component
44
- visited: ze,
45
- touched: De,
44
+ visited: De,
45
+ touched: Fe,
46
46
  modified: Ke,
47
- ...le
48
- } = I, n = e.useRef(null), T = e.useCallback(
47
+ ...ne
48
+ } = B, n = e.useRef(null), K = e.useCallback(
49
49
  () => {
50
50
  n.current && n.current.focus();
51
51
  },
52
52
  []
53
- ), s = e.useCallback(
53
+ ), c = e.useCallback(
54
54
  () => ({
55
55
  element: n.current,
56
- focus: T,
56
+ focus: K,
57
57
  get name() {
58
58
  return n.current && n.current.name;
59
59
  }
60
60
  }),
61
- [T]
61
+ [K]
62
62
  );
63
- e.useImperativeHandle(j, s);
64
- const [ne, oe] = e.useState(Z), [ce, se] = e.useState(_), w = typeof c == "boolean" || c === null, v = M !== void 0, r = w, g = r ? c : ce, i = v ? M : r ? void 0 : ne, L = i === void 0 && g, C = L ? g : i, d = L || r ? c === null ? c : void 0 : c || g, O = C === null || d === null, R = xe(), re = Be(), q = (t) => re.toLanguageString(t, Ie[t]), H = q(Me), ie = q(Ne), y = z !== void 0 ? z : h ? !!i : !0;
63
+ e.useImperativeHandle(G, c);
64
+ const [oe, se] = e.useState(_), [ce, re] = e.useState(ee), T = typeof s == "boolean" || s === null, v = I !== void 0, r = T, C = r ? s : ce, i = v ? I : r ? void 0 : oe, w = i === void 0 && C, g = w ? C : i, d = w || r ? s === null ? s : void 0 : s || C, L = g === null || d === null, O = Ve(), ie = Ie(), R = (t) => ie.toLanguageString(t, Me[t]), q = R(Ne), de = R(ze), y = S !== void 0 ? S : h ? !!i : !0;
65
65
  e.useEffect(
66
66
  () => {
67
67
  n.current && n.current.setCustomValidity && n.current.setCustomValidity(
68
- y ? "" : D || H
68
+ y ? "" : D || q
69
69
  );
70
70
  },
71
- [y, D, H]
71
+ [y, D, q]
72
72
  );
73
73
  const u = e.useCallback(
74
74
  (t, o) => {
75
- !r && !l && (se(o), !v && !l && oe(o)), p && !l && E(
75
+ !r && !l && (re(o), !v && !l && se(o)), p && !l && E(
76
76
  p,
77
77
  t,
78
78
  {
79
- ...s(),
79
+ ...c(),
80
80
  value: o
81
81
  },
82
82
  { value: o }
83
83
  );
84
84
  },
85
- [v, l, p, r, s]
86
- ), de = e.useCallback(
85
+ [v, l, p, r, c]
86
+ ), ue = e.useCallback(
87
87
  (t) => {
88
88
  const o = t.target.checked;
89
89
  u(t, o);
90
90
  },
91
- [u, c]
92
- ), ue = e.useCallback(
91
+ [u, s]
92
+ ), me = e.useCallback(
93
93
  (t) => {
94
94
  if (l)
95
95
  return;
96
- const { keyCode: o } = t, ve = t.currentTarget.checked;
97
- o === $.space && (t.preventDefault(), t.stopPropagation(), u(t, !ve));
96
+ const { keyCode: o } = t, Ce = t.currentTarget.checked;
97
+ o === U.space && (t.preventDefault(), t.stopPropagation(), u(t, !Ce));
98
98
  },
99
99
  [l, u]
100
- ), me = e.useCallback(
100
+ ), be = e.useCallback(
101
101
  (t) => {
102
102
  if (l)
103
103
  return;
104
104
  const { keyCode: o } = t;
105
- o === $.space && t.preventDefault();
105
+ o === U.space && t.preventDefault();
106
106
  },
107
107
  [l]
108
- ), be = e.useCallback(
108
+ ), pe = e.useCallback(
109
109
  (t) => {
110
110
  k && !l && E(
111
111
  k,
112
112
  t,
113
- s(),
113
+ c(),
114
114
  void 0
115
115
  );
116
116
  },
117
- [k, l, s]
118
- ), pe = e.useCallback(
117
+ [k, l, c]
118
+ ), ke = e.useCallback(
119
119
  (t) => {
120
120
  f && !l && E(
121
121
  f,
122
122
  t,
123
- s(),
123
+ c(),
124
124
  void 0
125
125
  );
126
126
  },
127
- [f, l, s]
128
- ), ke = Ve(n, I.dir), fe = P(
127
+ [f, l, c]
128
+ ), fe = Ee(n, B.dir), he = P(
129
129
  "k-checkbox-wrap",
130
- Q
131
- ), U = {
130
+ X
131
+ ), H = {
132
132
  type: "checkbox",
133
133
  className: P(
134
134
  "k-checkbox",
135
135
  {
136
- [`k-checkbox-${A.sizeMap[m] || m}`]: m,
137
- [`k-rounded-${A.roundedMap[b] || b}`]: b,
138
- "k-indeterminate": O,
136
+ [`k-checkbox-${$.sizeMap[m] || m}`]: m,
137
+ [`k-rounded-${$.roundedMap[b] || b}`]: b,
138
+ "k-indeterminate": L,
139
139
  "k-disabled": l,
140
- "k-invalid k-invalid": !(y || K !== void 0 || K === !0)
140
+ "k-invalid k-invalid": !(y || F !== void 0 || F === !0)
141
141
  }
142
142
  ),
143
143
  ref: n,
144
- name: ee,
145
- id: N || R,
146
- "aria-labelledby": J,
147
- "aria-describedby": G,
148
- checked: !!C,
144
+ name: ae,
145
+ id: M || O,
146
+ "aria-labelledby": Q,
147
+ "aria-describedby": J,
148
+ checked: !!g,
149
149
  disabled: l,
150
- tabIndex: Ee(te, l),
150
+ tabIndex: Pe(le, l),
151
151
  role: "checkbox",
152
152
  required: h !== void 0 ? h : !1,
153
- "aria-checked": i || C ? !0 : O ? "mixed" : !1,
153
+ "aria-checked": i || g ? !0 : L ? "mixed" : !1,
154
154
  "aria-disabled": l || void 0,
155
- ...le,
156
- onChange: de,
157
- onKeyDown: ue,
158
- onKeyUp: me,
159
- onFocus: be,
160
- onBlur: pe
161
- }, he = /* @__PURE__ */ e.createElement(
162
- e.Fragment,
163
- null,
155
+ ...ne,
156
+ onChange: ue,
157
+ onKeyDown: me,
158
+ onKeyUp: be,
159
+ onFocus: pe,
160
+ onBlur: ke
161
+ }, ve = (
164
162
  // removing value prop is required due to bug in react where
165
163
  // value set to undefined override default submit value
166
- d === void 0 ? /* @__PURE__ */ e.createElement("input", { ...U }) : /* @__PURE__ */ e.createElement("input", { ...U, value: w ? void 0 : d === null ? "" : d })
167
- ), x = /* @__PURE__ */ e.createElement(e.Fragment, null, F !== void 0 ? /* @__PURE__ */ e.createElement(
164
+ d === void 0 ? /* @__PURE__ */ e.createElement("input", { ...H }) : /* @__PURE__ */ e.createElement("input", { ...H, value: T ? void 0 : d === null ? "" : d })
165
+ ), x = N !== void 0 ? /* @__PURE__ */ e.createElement(
168
166
  "label",
169
167
  {
170
- className: P("k-checkbox-label", X),
171
- htmlFor: N || R,
168
+ className: P("k-checkbox-label", Y),
169
+ htmlFor: M || O,
172
170
  style: { userSelect: "none" }
173
171
  },
174
- F,
175
- ae && /* @__PURE__ */ e.createElement("span", { className: "k-label-optional" }, ie)
176
- ) : null), V = /* @__PURE__ */ e.createElement("span", { className: fe }, he, Y);
177
- return /* @__PURE__ */ e.createElement(e.Fragment, null, S === "before" ? /* @__PURE__ */ e.createElement("div", { dir: "rtl" }, V, x) : S === "after" ? /* @__PURE__ */ e.createElement("div", { dir: "ltr" }, V, x) : /* @__PURE__ */ e.createElement("div", { dir: ke }, V, x));
172
+ /* @__PURE__ */ e.createElement(e.Fragment, null, N),
173
+ te && /* @__PURE__ */ e.createElement("span", { className: "k-label-optional" }, de)
174
+ ) : null, V = /* @__PURE__ */ e.createElement("span", { className: he }, ve, Z);
175
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, z === "before" ? /* @__PURE__ */ e.createElement("div", { dir: "rtl" }, V, x) : z === "after" ? /* @__PURE__ */ e.createElement("div", { dir: "ltr" }, V, x) : /* @__PURE__ */ e.createElement("div", { dir: fe }, V, x));
178
176
  });
179
- B.propTypes = {
177
+ W.propTypes = {
180
178
  checked: a.bool,
181
179
  className: a.string,
182
180
  defaultChecked: a.bool,
@@ -202,13 +200,12 @@ B.propTypes = {
202
200
  onFocus: a.func,
203
201
  onBlur: a.func
204
202
  };
205
- const Se = {
203
+ const A = {
206
204
  size: "medium",
207
205
  rounded: "medium"
208
206
  };
209
- B.defaultProps = Se;
210
- B.displayName = "KendoCheckbox";
207
+ W.displayName = "KendoCheckbox";
211
208
  export {
212
- B as Checkbox,
213
- Fe as CheckboxPropsContext
209
+ W as Checkbox,
210
+ Se as CheckboxPropsContext
214
211
  };
@@ -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 ce=require("react"),a=require("prop-types"),n=require("@progress/kendo-react-common"),ie=require("../package-metadata.js"),ue=require("./Picker.js"),de=require("./ColorGradient.js"),M=require("./ColorPalette.js"),pe=require("@progress/kendo-react-buttons"),fe=require("@progress/kendo-svg-icons"),A=require("../messages/index.js"),me=require("@progress/kendo-react-intl");function ke(l){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const o in l)if(o!=="default"){const k=Object.getOwnPropertyDescriptor(l,o);Object.defineProperty(m,o,k.get?k:{enumerable:!0,get:()=>l[o]})}}return m.default=l,Object.freeze(m)}const e=ke(ce),be={opacity:!0},ge={palette:M.DEFAULT_PRESET,tileSize:M.DEFAULT_TILE_SIZE},B=l=>l!==void 0,z=n.createPropsContext(),C=e.forwardRef((l,m)=>{n.validatePackage(ie.packageMetadata);const o=n.usePropsContext(z,l),k=me.useLocalization(),{size:E=v.size,rounded:y=v.rounded,fillMode:q=v.fillMode,popupSettings:F,gradientSettings:H,paletteSettings:V,valid:j,disabled:P,tabIndex:G,view:b,icon:T,svgIcon:S,iconClassName:g,onChange:w,onFocus:I,onBlur:R,onActiveColorClick:D,className:U}=o,r=e.useRef(null),N=e.useRef(null),O=e.useRef(null),d=e.useRef(),$=e.useRef(null),[W,x]=e.useState(!1),[Z,J]=e.useState(o.defaultValue),[Q,X]=e.useState(!1),h=B(o.value),i=B(o.open),c=h?o.value:Z,p=i?o.open:Q,K=e.useCallback(()=>{r.current&&r.current.focus()},[]);e.useImperativeHandle(m,()=>({element:r.current,actionElement:$.current,value:c,focus:K}),[c,K]);const u=e.useCallback((t,f)=>{i||(!t&&!f&&r&&r.current&&r.current.focus(),X(t))},[i]),Y=e.useCallback(t=>{const{altKey:f,keyCode:s}=t;if(s===n.Keys.esc){u(!1);return}if(s===n.Keys.enter&&!i){t.preventDefault(),t.stopPropagation(),u(!p);return}f&&(s===n.Keys.up||s===n.Keys.down)&&(t.preventDefault(),t.stopPropagation(),s===n.Keys.up&&r&&r.current&&(r.current.focus(),u(!1)),s===n.Keys.down&&u(!0))},[p,i]),ee=e.useCallback(()=>{i||(N.current?N.current.focus():O.current&&O.current.focus())},[i]),te=e.useCallback(()=>{u(!p,!0)},[p]),ne=e.useCallback(t=>{D&&D.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:c})},[D,c]),oe=e.useCallback(t=>{d.current?(clearTimeout(d.current),d.current=void 0):x(!0),I&&I.call(void 0,{nativeEvent:t.nativeEvent,syntheticEvent:t})},[I]),ae=e.useCallback(()=>{u(!1,!0),x(!1),d.current=void 0},[]),re=e.useCallback(t=>{clearTimeout(d.current),d.current=window.setTimeout(ae),R&&R.call(void 0,{nativeEvent:t.nativeEvent,syntheticEvent:t})},[R]),L=e.useCallback((t,f)=>{const s=f?t.rgbaValue:t.value;h||J(s),f&&u(!1),w&&w.call(void 0,{value:s,nativeEvent:t.nativeEvent,syntheticEvent:t.syntheticEvent})},[h,w]),le=e.useCallback(t=>L(t,!0),[B,L]),_=n.useDir(r,o.dir),se=j!==!1;return e.createElement("span",{id:o.id,role:"combobox","aria-label":o.ariaLabel,"aria-labelledby":o.ariaLabelledBy,"aria-describedby":o.ariaDescribedBy,"aria-haspopup":"dialog","aria-expanded":p,"aria-disabled":P?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[E]||E}`]:E,[`k-picker-${q}`]:q,[`k-rounded-${n.kendoThemeMaps.roundedMap[y]||y}`]:y,"k-invalid":!se,"k-disabled":P,"k-focus":W,className:U}),ref:r,tabIndex:n.getTabIndex(G,P),title:o.title,onKeyDown:Y,onFocus:oe,onBlur:re,dir:_},e.createElement(ue.Picker,{dir:_,open:p,onOpen:ee,popupAnchor:r.current||void 0,popupSettings:{...F},input:e.createElement("span",{onClick:ne,className:"k-input-inner"},e.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!c,"k-icon-color-preview":T||S||g})},g&&e.createElement("span",{className:n.classNames("k-color-preview-icon",g)}),!g&&(T||S)&&e.createElement(n.IconWrap,{name:T,icon:S}),e.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:c}}))),button:e.createElement(pe.Button,{tabIndex:-1,type:"button",onClick:te,className:"k-input-button",rounded:null,icon:"caret-alt-down",svgIcon:fe.caretAltDownIcon,"aria-label":k.toLanguageString(A.colorPickerDropdownButtonAriaLabel,A.messages[A.colorPickerDropdownButtonAriaLabel])}),content:e.createElement(e.Fragment,null,(b==="combo"||b==="gradient")&&e.createElement(de.ColorGradient,{...H,tabIndex:0,ref:N,value:c,onChange:L}),(b==="combo"||b==="palette")&&e.createElement(M.ColorPalette,{...V,ref:O,value:c,onChange:le}))}))});C.propTypes={value:a.string,defaultValue:a.string,disabled:a.bool,view:a.oneOf(["gradient","palette","combo"]),dir:a.string,id:a.string,icon:a.string,svgIcon:n.svgIconPropType,ariaLabelledBy:a.string,ariaDescribedBy:a.string,size:a.oneOf([null,"small","medium","large"]),rounded:a.oneOf([null,"small","medium","large","full"]),fillMode:a.oneOf([null,"solid","flat","outline"]),className:a.string};const v={size:"medium",rounded:"medium",fillMode:"solid",view:"palette",gradientSettings:be,paletteSettings:ge};C.defaultProps=v;C.displayName="KendoColorPicker";exports.ColorPicker=C;exports.ColorPickerPropsContext=z;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ce=require("react"),a=require("prop-types"),n=require("@progress/kendo-react-common"),ie=require("../package-metadata.js"),ue=require("./Picker.js"),de=require("./ColorGradient.js"),B=require("./ColorPalette.js"),pe=require("@progress/kendo-react-buttons"),fe=require("@progress/kendo-svg-icons"),L=require("../messages/index.js"),me=require("@progress/kendo-react-intl");function ke(l){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const o in l)if(o!=="default"){const b=Object.getOwnPropertyDescriptor(l,o);Object.defineProperty(k,o,b.get?b:{enumerable:!0,get:()=>l[o]})}}return k.default=l,Object.freeze(k)}const e=ke(ce),be={opacity:!0},ge={palette:B.DEFAULT_PRESET,tileSize:B.DEFAULT_TILE_SIZE},A=l=>l!==void 0,z=n.createPropsContext(),M=e.forwardRef((l,k)=>{n.validatePackage(ie.packageMetadata);const o=n.usePropsContext(z,l),b=me.useLocalization(),{size:C=m.size,rounded:E=m.rounded,fillMode:q=m.fillMode,gradientSettings:F=m.gradientSettings,paletteSettings:H=m.paletteSettings,view:g=m.view,popupSettings:V,valid:j,disabled:y,tabIndex:G,icon:P,svgIcon:S,iconClassName:v,onChange:T,onFocus:w,onBlur:I,onActiveColorClick:R,className:U}=o,r=e.useRef(null),D=e.useRef(null),N=e.useRef(null),d=e.useRef(),$=e.useRef(null),[W,x]=e.useState(!1),[Z,J]=e.useState(o.defaultValue),[Q,X]=e.useState(!1),O=A(o.value),i=A(o.open),c=O?o.value:Z,p=i?o.open:Q,K=e.useCallback(()=>{r.current&&r.current.focus()},[]);e.useImperativeHandle(k,()=>({element:r.current,actionElement:$.current,value:c,focus:K}),[c,K]);const u=e.useCallback((t,f)=>{i||(!t&&!f&&r&&r.current&&r.current.focus(),X(t))},[i]),Y=e.useCallback(t=>{const{altKey:f,keyCode:s}=t;if(s===n.Keys.esc){u(!1);return}if(s===n.Keys.enter&&!i){t.preventDefault(),t.stopPropagation(),u(!p);return}f&&(s===n.Keys.up||s===n.Keys.down)&&(t.preventDefault(),t.stopPropagation(),s===n.Keys.up&&r&&r.current&&(r.current.focus(),u(!1)),s===n.Keys.down&&u(!0))},[p,i]),ee=e.useCallback(()=>{i||(D.current?D.current.focus():N.current&&N.current.focus())},[i]),te=e.useCallback(()=>{u(!p,!0)},[p]),ne=e.useCallback(t=>{R&&R.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:c})},[R,c]),oe=e.useCallback(t=>{d.current?(clearTimeout(d.current),d.current=void 0):x(!0),w&&w.call(void 0,{nativeEvent:t.nativeEvent,syntheticEvent:t})},[w]),ae=e.useCallback(()=>{u(!1,!0),x(!1),d.current=void 0},[]),re=e.useCallback(t=>{clearTimeout(d.current),d.current=window.setTimeout(ae),I&&I.call(void 0,{nativeEvent:t.nativeEvent,syntheticEvent:t})},[I]),h=e.useCallback((t,f)=>{const s=f?t.rgbaValue:t.value;O||J(s),f&&u(!1),T&&T.call(void 0,{value:s,nativeEvent:t.nativeEvent,syntheticEvent:t.syntheticEvent})},[O,T]),le=e.useCallback(t=>h(t,!0),[A,h]),_=n.useDir(r,o.dir),se=j!==!1;return e.createElement("span",{id:o.id,role:"combobox","aria-label":o.ariaLabel,"aria-labelledby":o.ariaLabelledBy,"aria-describedby":o.ariaDescribedBy,"aria-haspopup":"dialog","aria-expanded":p,"aria-disabled":y?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[C]||C}`]:C,[`k-picker-${q}`]:q,[`k-rounded-${n.kendoThemeMaps.roundedMap[E]||E}`]:E,"k-invalid":!se,"k-disabled":y,"k-focus":W,className:U}),ref:r,tabIndex:n.getTabIndex(G,y),title:o.title,onKeyDown:Y,onFocus:oe,onBlur:re,dir:_},e.createElement(ue.Picker,{dir:_,open:p,onOpen:ee,popupAnchor:r.current||void 0,popupSettings:{...V},input:e.createElement("span",{onClick:ne,className:"k-input-inner"},e.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!c,"k-icon-color-preview":P||S||v})},v&&e.createElement("span",{className:n.classNames("k-color-preview-icon",v)}),!v&&(P||S)&&e.createElement(n.IconWrap,{name:P,icon:S}),e.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:c}}))),button:e.createElement(pe.Button,{tabIndex:-1,type:"button",onClick:te,className:"k-input-button",rounded:null,icon:"caret-alt-down",svgIcon:fe.caretAltDownIcon,"aria-label":b.toLanguageString(L.colorPickerDropdownButtonAriaLabel,L.messages[L.colorPickerDropdownButtonAriaLabel])}),content:e.createElement(e.Fragment,null,(g==="combo"||g==="gradient")&&e.createElement(de.ColorGradient,{...F,tabIndex:0,ref:D,value:c,onChange:h}),(g==="combo"||g==="palette")&&e.createElement(B.ColorPalette,{...H,ref:N,value:c,onChange:le}))}))});M.propTypes={value:a.string,defaultValue:a.string,disabled:a.bool,view:a.oneOf(["gradient","palette","combo"]),dir:a.string,id:a.string,icon:a.string,svgIcon:n.svgIconPropType,ariaLabelledBy:a.string,ariaDescribedBy:a.string,size:a.oneOf([null,"small","medium","large"]),rounded:a.oneOf([null,"small","medium","large","full"]),fillMode:a.oneOf([null,"solid","flat","outline"]),className:a.string};const m={size:"medium",rounded:"medium",fillMode:"solid",view:"palette",gradientSettings:be,paletteSettings:ge};M.displayName="KendoColorPicker";exports.ColorPicker=M;exports.ColorPickerPropsContext=z;
@@ -8,42 +8,42 @@
8
8
  "use client";
9
9
  import * as e from "react";
10
10
  import n from "prop-types";
11
- import { createPropsContext as se, validatePackage as ce, usePropsContext as ue, Keys as p, useDir as de, classNames as h, kendoThemeMaps as O, getTabIndex as pe, IconWrap as fe, svgIconPropType as me } from "@progress/kendo-react-common";
11
+ import { createPropsContext as se, validatePackage as ce, usePropsContext as ue, Keys as p, useDir as de, classNames as h, kendoThemeMaps as H, getTabIndex as pe, IconWrap as fe, svgIconPropType as me } from "@progress/kendo-react-common";
12
12
  import { packageMetadata as ke } from "../package-metadata.mjs";
13
- import { Picker as be } from "./Picker.mjs";
14
- import { ColorGradient as ve } from "./ColorGradient.mjs";
13
+ import { Picker as ve } from "./Picker.mjs";
14
+ import { ColorGradient as be } from "./ColorGradient.mjs";
15
15
  import { ColorPalette as ge, DEFAULT_PRESET as Ee, DEFAULT_TILE_SIZE as Ce } from "./ColorPalette.mjs";
16
16
  import { Button as ye } from "@progress/kendo-react-buttons";
17
17
  import { caretAltDownIcon as Te } from "@progress/kendo-svg-icons";
18
- import { colorPickerDropdownButtonAriaLabel as z, messages as Se } from "../messages/index.mjs";
19
- import { useLocalization as Pe } from "@progress/kendo-react-intl";
20
- const we = {
18
+ import { colorPickerDropdownButtonAriaLabel as O, messages as Se } from "../messages/index.mjs";
19
+ import { useLocalization as we } from "@progress/kendo-react-intl";
20
+ const Ie = {
21
21
  opacity: !0
22
- }, Ie = {
22
+ }, Pe = {
23
23
  palette: Ee,
24
24
  tileSize: Ce
25
- }, L = (b) => b !== void 0, De = se(), A = e.forwardRef((b, M) => {
25
+ }, L = (v) => v !== void 0, De = se(), z = e.forwardRef((v, M) => {
26
26
  ce(ke);
27
- const o = ue(De, b), V = Pe(), {
28
- size: v = k.size,
29
- rounded: g = k.rounded,
30
- fillMode: x = k.fillMode,
31
- popupSettings: _,
32
- gradientSettings: K,
33
- paletteSettings: G,
27
+ const o = ue(De, v), V = we(), {
28
+ size: b = f.size,
29
+ rounded: g = f.rounded,
30
+ fillMode: A = f.fillMode,
31
+ gradientSettings: _ = f.gradientSettings,
32
+ paletteSettings: K = f.paletteSettings,
33
+ view: m = f.view,
34
+ popupSettings: G,
34
35
  valid: U,
35
36
  disabled: E,
36
37
  tabIndex: $,
37
- view: f,
38
38
  icon: C,
39
39
  svgIcon: y,
40
- iconClassName: m,
40
+ iconClassName: k,
41
41
  onChange: T,
42
42
  onFocus: S,
43
- onBlur: P,
44
- onActiveColorClick: w,
43
+ onBlur: w,
44
+ onActiveColorClick: I,
45
45
  className: W
46
- } = o, a = e.useRef(null), I = e.useRef(null), D = e.useRef(null), c = e.useRef(), Z = e.useRef(null), [j, B] = e.useState(!1), [q, J] = e.useState(o.defaultValue), [Q, X] = e.useState(!1), N = L(o.value), i = L(o.open), l = N ? o.value : q, u = i ? o.open : Q, F = e.useCallback(
46
+ } = o, a = e.useRef(null), P = e.useRef(null), D = e.useRef(null), c = e.useRef(), Z = e.useRef(null), [j, x] = e.useState(!1), [q, J] = e.useState(o.defaultValue), [Q, X] = e.useState(!1), N = L(o.value), i = L(o.open), l = N ? o.value : q, u = i ? o.open : Q, B = e.useCallback(
47
47
  () => {
48
48
  a.current && a.current.focus();
49
49
  },
@@ -54,8 +54,8 @@ const we = {
54
54
  element: a.current,
55
55
  actionElement: Z.current,
56
56
  value: l,
57
- focus: F
58
- }), [l, F]);
57
+ focus: B
58
+ }), [l, B]);
59
59
  const s = e.useCallback(
60
60
  (t, d) => {
61
61
  i || (!t && !d && a && a.current && a.current.focus(), X(t));
@@ -77,7 +77,7 @@ const we = {
77
77
  [u, i]
78
78
  ), ee = e.useCallback(
79
79
  () => {
80
- i || (I.current ? I.current.focus() : D.current && D.current.focus());
80
+ i || (P.current ? P.current.focus() : D.current && D.current.focus());
81
81
  },
82
82
  [i]
83
83
  ), te = e.useCallback(
@@ -87,16 +87,16 @@ const we = {
87
87
  [u]
88
88
  ), ne = e.useCallback(
89
89
  (t) => {
90
- w && w.call(void 0, {
90
+ I && I.call(void 0, {
91
91
  syntheticEvent: t,
92
92
  nativeEvent: t.nativeEvent,
93
93
  value: l
94
94
  });
95
95
  },
96
- [w, l]
96
+ [I, l]
97
97
  ), oe = e.useCallback(
98
98
  (t) => {
99
- c.current ? (clearTimeout(c.current), c.current = void 0) : B(!0), S && S.call(void 0, {
99
+ c.current ? (clearTimeout(c.current), c.current = void 0) : x(!0), S && S.call(void 0, {
100
100
  nativeEvent: t.nativeEvent,
101
101
  syntheticEvent: t
102
102
  });
@@ -104,17 +104,17 @@ const we = {
104
104
  [S]
105
105
  ), ae = e.useCallback(
106
106
  () => {
107
- s(!1, !0), B(!1), c.current = void 0;
107
+ s(!1, !0), x(!1), c.current = void 0;
108
108
  },
109
109
  []
110
110
  ), re = e.useCallback(
111
111
  (t) => {
112
- clearTimeout(c.current), c.current = window.setTimeout(ae), P && P.call(void 0, {
112
+ clearTimeout(c.current), c.current = window.setTimeout(ae), w && w.call(void 0, {
113
113
  nativeEvent: t.nativeEvent,
114
114
  syntheticEvent: t
115
115
  });
116
116
  },
117
- [P]
117
+ [w]
118
118
  ), R = e.useCallback(
119
119
  (t, d) => {
120
120
  const r = d ? t.rgbaValue : t.value;
@@ -128,7 +128,7 @@ const we = {
128
128
  ), le = e.useCallback(
129
129
  (t) => R(t, !0),
130
130
  [L, R]
131
- ), H = de(a, o.dir), ie = U !== !1;
131
+ ), F = de(a, o.dir), ie = U !== !1;
132
132
  return /* @__PURE__ */ e.createElement(
133
133
  "span",
134
134
  {
@@ -145,9 +145,9 @@ const we = {
145
145
  "k-picker",
146
146
  "k-icon-picker",
147
147
  {
148
- [`k-picker-${O.sizeMap[v] || v}`]: v,
149
- [`k-picker-${x}`]: x,
150
- [`k-rounded-${O.roundedMap[g] || g}`]: g,
148
+ [`k-picker-${H.sizeMap[b] || b}`]: b,
149
+ [`k-picker-${A}`]: A,
150
+ [`k-rounded-${H.roundedMap[g] || g}`]: g,
151
151
  "k-invalid": !ie,
152
152
  "k-disabled": E,
153
153
  "k-focus": j,
@@ -160,16 +160,16 @@ const we = {
160
160
  onKeyDown: Y,
161
161
  onFocus: oe,
162
162
  onBlur: re,
163
- dir: H
163
+ dir: F
164
164
  },
165
165
  /* @__PURE__ */ e.createElement(
166
- be,
166
+ ve,
167
167
  {
168
- dir: H,
168
+ dir: F,
169
169
  open: u,
170
170
  onOpen: ee,
171
171
  popupAnchor: a.current || void 0,
172
- popupSettings: { ..._ },
172
+ popupSettings: { ...G },
173
173
  input: /* @__PURE__ */ e.createElement("span", { onClick: ne, className: "k-input-inner" }, /* @__PURE__ */ e.createElement(
174
174
  "span",
175
175
  {
@@ -178,12 +178,12 @@ const we = {
178
178
  "k-color-preview",
179
179
  {
180
180
  "k-no-color": !l,
181
- "k-icon-color-preview": C || y || m
181
+ "k-icon-color-preview": C || y || k
182
182
  }
183
183
  )
184
184
  },
185
- m && /* @__PURE__ */ e.createElement("span", { className: h("k-color-preview-icon", m) }),
186
- !m && (C || y) && /* @__PURE__ */ e.createElement(fe, { name: C, icon: y }),
185
+ k && /* @__PURE__ */ e.createElement("span", { className: h("k-color-preview-icon", k) }),
186
+ !k && (C || y) && /* @__PURE__ */ e.createElement(fe, { name: C, icon: y }),
187
187
  /* @__PURE__ */ e.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: l } })
188
188
  )),
189
189
  button: /* @__PURE__ */ e.createElement(
@@ -196,22 +196,22 @@ const we = {
196
196
  rounded: null,
197
197
  icon: "caret-alt-down",
198
198
  svgIcon: Te,
199
- "aria-label": V.toLanguageString(z, Se[z])
199
+ "aria-label": V.toLanguageString(O, Se[O])
200
200
  }
201
201
  ),
202
- content: /* @__PURE__ */ e.createElement(e.Fragment, null, (f === "combo" || f === "gradient") && /* @__PURE__ */ e.createElement(
203
- ve,
202
+ content: /* @__PURE__ */ e.createElement(e.Fragment, null, (m === "combo" || m === "gradient") && /* @__PURE__ */ e.createElement(
203
+ be,
204
204
  {
205
- ...K,
205
+ ..._,
206
206
  tabIndex: 0,
207
- ref: I,
207
+ ref: P,
208
208
  value: l,
209
209
  onChange: R
210
210
  }
211
- ), (f === "combo" || f === "palette") && /* @__PURE__ */ e.createElement(
211
+ ), (m === "combo" || m === "palette") && /* @__PURE__ */ e.createElement(
212
212
  ge,
213
213
  {
214
- ...G,
214
+ ...K,
215
215
  ref: D,
216
216
  value: l,
217
217
  onChange: le
@@ -221,7 +221,7 @@ const we = {
221
221
  )
222
222
  );
223
223
  });
224
- A.propTypes = {
224
+ z.propTypes = {
225
225
  value: n.string,
226
226
  defaultValue: n.string,
227
227
  disabled: n.bool,
@@ -237,17 +237,16 @@ A.propTypes = {
237
237
  fillMode: n.oneOf([null, "solid", "flat", "outline"]),
238
238
  className: n.string
239
239
  };
240
- const k = {
240
+ const f = {
241
241
  size: "medium",
242
242
  rounded: "medium",
243
243
  fillMode: "solid",
244
244
  view: "palette",
245
- gradientSettings: we,
246
- paletteSettings: Ie
245
+ gradientSettings: Ie,
246
+ paletteSettings: Pe
247
247
  };
248
- A.defaultProps = k;
249
- A.displayName = "KendoColorPicker";
248
+ z.displayName = "KendoColorPicker";
250
249
  export {
251
- A as ColorPicker,
250
+ z as ColorPicker,
252
251
  De as ColorPickerPropsContext
253
252
  };