@progress/kendo-react-inputs 9.4.0-develop.24 → 9.4.0-develop.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/NOTICE.txt +51 -40
  2. package/checkbox/Checkbox.js +1 -1
  3. package/checkbox/Checkbox.mjs +1 -0
  4. package/colors/ColorContrastLabels.js +1 -1
  5. package/colors/ColorContrastLabels.mjs +3 -2
  6. package/colors/ColorContrastSvg.js +1 -1
  7. package/colors/ColorContrastSvg.mjs +12 -11
  8. package/colors/ColorGradient.js +1 -1
  9. package/colors/ColorGradient.mjs +75 -85
  10. package/colors/ColorInput.js +1 -1
  11. package/colors/ColorInput.mjs +45 -55
  12. package/colors/ColorPalette.js +1 -1
  13. package/colors/ColorPalette.mjs +47 -55
  14. package/colors/ColorPicker.js +1 -1
  15. package/colors/ColorPicker.mjs +184 -327
  16. package/colors/FlatColorPicker.js +1 -1
  17. package/colors/FlatColorPicker.mjs +157 -246
  18. package/colors/HexInput.js +1 -1
  19. package/colors/HexInput.mjs +9 -10
  20. package/colors/Picker.js +1 -1
  21. package/colors/Picker.mjs +21 -20
  22. package/colors/models/palette-presets.js +1 -1
  23. package/colors/models/palette-presets.mjs +2 -1
  24. package/colors/utils/color-cache.js +1 -1
  25. package/colors/utils/color-cache.mjs +13 -12
  26. package/colors/utils/color-palette.service.js +1 -1
  27. package/colors/utils/color-palette.service.mjs +1 -0
  28. package/colors/utils/color-parser.js +1 -1
  29. package/colors/utils/color-parser.mjs +6 -5
  30. package/colors/utils/misc.js +1 -1
  31. package/colors/utils/misc.mjs +1 -0
  32. package/colors/utils/svg-calc.js +1 -1
  33. package/colors/utils/svg-calc.mjs +10 -9
  34. package/dist/cdn/js/kendo-react-inputs.js +1 -8
  35. package/index.d.mts +10 -126
  36. package/index.d.ts +10 -126
  37. package/index.js +1 -2
  38. package/index.mjs +4 -4
  39. package/input/Input.js +1 -1
  40. package/input/Input.mjs +9 -8
  41. package/input/InputClearValue.js +1 -1
  42. package/input/InputClearValue.mjs +4 -3
  43. package/input/InputPrefix.js +1 -1
  44. package/input/InputPrefix.mjs +5 -4
  45. package/input/InputSeparator.js +1 -1
  46. package/input/InputSeparator.mjs +9 -8
  47. package/input/InputSuffix.js +1 -1
  48. package/input/InputSuffix.mjs +5 -4
  49. package/input/InputValidationIcon.js +1 -1
  50. package/input/InputValidationIcon.mjs +4 -3
  51. package/maskedtextbox/MaskedTextBox.js +1 -1
  52. package/maskedtextbox/MaskedTextBox.mjs +1 -0
  53. package/maskedtextbox/masking.service.js +1 -1
  54. package/maskedtextbox/masking.service.mjs +1 -0
  55. package/maskedtextbox/parsing/combinators.js +1 -1
  56. package/maskedtextbox/parsing/combinators.mjs +9 -8
  57. package/maskedtextbox/parsing/parsers.js +1 -1
  58. package/maskedtextbox/parsing/parsers.mjs +1 -0
  59. package/maskedtextbox/parsing/result.js +1 -1
  60. package/maskedtextbox/parsing/result.mjs +8 -7
  61. package/maskedtextbox/parsing/stream.js +1 -1
  62. package/maskedtextbox/parsing/stream.mjs +1 -0
  63. package/maskedtextbox/utils.js +1 -1
  64. package/maskedtextbox/utils.mjs +12 -11
  65. package/messages/index.js +1 -1
  66. package/messages/index.mjs +38 -39
  67. package/numerictextbox/NumericTextBox.js +1 -1
  68. package/numerictextbox/NumericTextBox.mjs +1 -0
  69. package/numerictextbox/utils/index.js +1 -1
  70. package/numerictextbox/utils/index.mjs +1 -0
  71. package/package-metadata.js +1 -1
  72. package/package-metadata.mjs +3 -2
  73. package/package.json +10 -10
  74. package/radiobutton/RadioButton.js +1 -1
  75. package/radiobutton/RadioButton.mjs +1 -0
  76. package/radiobutton/RadioGroup.js +1 -1
  77. package/radiobutton/RadioGroup.mjs +1 -0
  78. package/range-slider/RangeSlider.js +1 -1
  79. package/range-slider/RangeSlider.mjs +1 -0
  80. package/range-slider/range-raducer.js +1 -1
  81. package/range-slider/range-raducer.mjs +3 -2
  82. package/rating/Rating.js +1 -1
  83. package/rating/Rating.mjs +1 -0
  84. package/rating/RatingItem.js +1 -1
  85. package/rating/RatingItem.mjs +1 -0
  86. package/rating/rating-reducer.js +1 -1
  87. package/rating/rating-reducer.mjs +1 -0
  88. package/rating/utils/index.js +1 -1
  89. package/rating/utils/index.mjs +1 -0
  90. package/signature/Signature.js +1 -1
  91. package/signature/Signature.mjs +1 -0
  92. package/signature/utils/index.js +1 -1
  93. package/signature/utils/index.mjs +4 -3
  94. package/slider/Slider.js +1 -1
  95. package/slider/Slider.mjs +1 -0
  96. package/slider/SliderLabel.js +1 -1
  97. package/slider/SliderLabel.mjs +4 -3
  98. package/switch/Switch.js +1 -1
  99. package/switch/Switch.mjs +1 -0
  100. package/textarea/TextArea.js +1 -1
  101. package/textarea/TextArea.mjs +1 -0
  102. package/textbox/Textbox.js +1 -1
  103. package/textbox/Textbox.mjs +8 -7
  104. package/common/AdaptiveMode.js +0 -8
  105. package/common/AdaptiveMode.mjs +0 -73
@@ -5,33 +5,34 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
+ "use client";
8
9
  import * as i from "react";
9
10
  import s from "prop-types";
10
- import { ColorPaletteService as S } from "./utils/color-palette.service.mjs";
11
- import { KEYS as l, validatePackage as w, classNames as u, kendoThemeMaps as E, getTabIndex as k, dispatchEvent as y, createPropsContext as R, withIdHOC as F, withPropsContext as N } from "@progress/kendo-react-common";
12
- import { packageMetadata as P } from "../package-metadata.mjs";
13
- import { PALETTEPRESETS as T } from "./models/palette-presets.mjs";
14
- import { isPresent as I } from "./utils/misc.mjs";
15
- import { parseColor as D } from "./utils/color-parser.mjs";
16
- const z = 24, f = 10, L = "office", a = class a extends i.Component {
11
+ import { ColorPaletteService as E } from "./utils/color-palette.service.mjs";
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
+ import { packageMetadata as I } from "../package-metadata.mjs";
14
+ import { PALETTEPRESETS as D } from "./models/palette-presets.mjs";
15
+ import { isPresent as L } from "./utils/misc.mjs";
16
+ import { parseColor as U } from "./utils/color-parser.mjs";
17
+ const x = 24, m = 10, z = "office", n = class n extends i.Component {
17
18
  constructor(t) {
18
19
  super(t), this.wrapperRef = i.createRef(), this.paletteService = null, this.focus = () => {
19
20
  this.wrapperRef && this.wrapperRef.current && this.wrapperRef.current.focus();
20
21
  }, this.onKeyDown = (e) => {
21
22
  switch (e.key) {
22
- case l.down:
23
+ case a.down:
23
24
  this.handleCellNavigation(0, 1);
24
25
  break;
25
- case l.up:
26
+ case a.up:
26
27
  this.handleCellNavigation(0, -1);
27
28
  break;
28
- case l.right:
29
+ case a.right:
29
30
  this.handleCellNavigation(1, 0);
30
31
  break;
31
- case l.left:
32
+ case a.left:
32
33
  this.handleCellNavigation(-1, 0);
33
34
  break;
34
- case l.enter:
35
+ case a.enter:
35
36
  this.handleEnter(e);
36
37
  break;
37
38
  default:
@@ -44,7 +45,7 @@ const z = 24, f = 10, L = "office", a = class a extends i.Component {
44
45
  this.paletteService && (this.setState({ focusedColor: this.state.selectedColor || this.paletteService.colorRows[0][0] }), this.props.onFocus && this.props.onFocus.call(void 0, e));
45
46
  }, this.onBlur = () => {
46
47
  this.setState({ focusedColor: void 0 });
47
- }, w(P), this.state = {
48
+ }, k(I), this.state = {
48
49
  selectedColor: this.props.value !== void 0 ? this.props.value : this.props.defaultValue ? this.props.defaultValue : void 0,
49
50
  isFirstRender: !0
50
51
  };
@@ -56,29 +57,22 @@ const z = 24, f = 10, L = "office", a = class a extends i.Component {
56
57
  * @hidden
57
58
  */
58
59
  render() {
59
- const t = this.getPaletteInfo(), e = this.paletteService = new S();
60
+ const t = this.getPaletteInfo(), e = this.paletteService = new E();
60
61
  e.setColorMatrix(t.colors, t.columns);
61
- const o = e.getCellCoordsFor(this.state.selectedColor), r = e.getCellCoordsFor(this.state.focusedColor);
62
+ 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);
62
63
  return t.colors.length ? /* @__PURE__ */ i.createElement(
63
64
  "div",
64
65
  {
65
66
  id: this.props.id,
66
67
  role: "grid",
67
- className: u(
68
- "k-colorpalette",
69
- {
70
- [`k-colorpalette-${E.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
71
- "k-disabled": this.props.disabled
72
- },
73
- this.props.className
74
- ),
68
+ className: l,
75
69
  onFocus: this.onFocus,
76
70
  onBlur: this.onBlur,
77
71
  onKeyDown: this.onKeyDown,
78
72
  "aria-disabled": this.props.ariaDisabled || (this.props.disabled ? "true" : void 0),
79
73
  "aria-labelledby": this.props.ariaLabelledBy,
80
74
  "aria-describedby": this.props.ariaDescribedBy,
81
- tabIndex: k(this.props.tabIndex, this.props.disabled),
75
+ tabIndex: R(this.props.tabIndex, this.props.disabled),
82
76
  ref: this.wrapperRef
83
77
  },
84
78
  /* @__PURE__ */ i.createElement("table", { className: "k-colorpalette-table", role: "presentation" }, /* @__PURE__ */ i.createElement("tbody", { role: "rowgroup" }, this.renderRows(e.colorRows, o, r)))
@@ -113,7 +107,7 @@ const z = 24, f = 10, L = "office", a = class a extends i.Component {
113
107
  this.isUncontrolled && this.setState({ selectedColor: this.state.focusedColor }), this.dispatchChangeEvent(this.state.focusedColor, t);
114
108
  }
115
109
  dispatchChangeEvent(t, e) {
116
- y(this.props.onChange, e, this, { value: t, rgbaValue: D(t, "rgba") });
110
+ F(this.props.onChange, e, this, { value: t, rgbaValue: U(t, "rgba") });
117
111
  }
118
112
  get focusedColorCooridanates() {
119
113
  return this.state.focusedColor && this.paletteService ? this.paletteService.getCellCoordsFor(this.state.focusedColor) : void 0;
@@ -123,33 +117,33 @@ const z = 24, f = 10, L = "office", a = class a extends i.Component {
123
117
  }
124
118
  getPaletteInfo() {
125
119
  if (typeof this.props.palette == "string") {
126
- const t = T[this.props.palette];
127
- return I(t) ? {
120
+ const t = D[this.props.palette];
121
+ return L(t) ? {
128
122
  colors: t.colors,
129
- columns: this.props.columns || t.columns || f
123
+ columns: this.props.columns || t.columns || m
130
124
  } : { colors: [], columns: 0 };
131
125
  }
132
- return { colors: this.props.palette || [], columns: this.props.columns || f };
126
+ return { colors: this.props.palette || [], columns: this.props.columns || m };
133
127
  }
134
128
  renderRows(t, e, o) {
135
- return t.map((r, n) => /* @__PURE__ */ i.createElement("tr", { role: "row", key: n }, this.renderColumns(r, n, e, o)));
129
+ return t.map((r, l) => /* @__PURE__ */ i.createElement("tr", { role: "row", key: l }, this.renderColumns(r, l, e, o)));
136
130
  }
137
131
  renderColumns(t, e, o, r) {
138
- const n = o !== void 0 && o.row === e, C = o && o.col, m = r !== void 0 && r.row === e, g = r && r.col;
132
+ 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";
139
133
  return t.map((d, c) => {
140
- const h = n && C === c, v = u("k-colorpalette-tile", {
141
- "k-selected": h,
142
- "k-focus": m && g === c
134
+ const f = l && g === c, w = C("k-colorpalette-tile", {
135
+ "k-selected": f,
136
+ "k-focus": v && b === c
143
137
  });
144
138
  return /* @__PURE__ */ i.createElement(
145
139
  "td",
146
140
  {
147
141
  role: "gridcell",
148
- className: v,
142
+ className: w,
149
143
  "aria-label": d,
150
- "aria-selected": h ? !0 : this.props.disabled ? void 0 : !1,
151
- style: { backgroundColor: d },
152
- onClick: (b) => this.onColorClick(d, b),
144
+ "aria-selected": f ? !0 : this.props.disabled ? void 0 : !1,
145
+ style: { backgroundColor: d, width: u, height: S, minWidth: u },
146
+ onClick: (y) => this.onColorClick(d, y),
153
147
  id: this.createCellId({ row: e, col: c }),
154
148
  key: c
155
149
  }
@@ -160,7 +154,7 @@ const z = 24, f = 10, L = "office", a = class a extends i.Component {
160
154
  return `${this.guid}_${t.row}_${t.col}`;
161
155
  }
162
156
  };
163
- a.displayName = "ColorPalette", a.propTypes = {
157
+ n.displayName = "ColorPalette", n.propTypes = {
164
158
  palette: s.oneOfType([s.arrayOf(s.string.isRequired), s.string]),
165
159
  columns: s.number,
166
160
  tileSize: s.any,
@@ -173,26 +167,24 @@ a.displayName = "ColorPalette", a.propTypes = {
173
167
  id: s.string,
174
168
  ariaLabelledBy: s.string,
175
169
  ariaDescribedBy: s.string,
176
- className: s.string,
177
- size: s.oneOf(["small", "medium", "large", null])
178
- }, a.defaultProps = {
179
- palette: L,
180
- tileSize: z,
181
- size: "medium"
170
+ className: s.string
171
+ }, n.defaultProps = {
172
+ palette: z,
173
+ tileSize: x
182
174
  };
183
- let p = a;
184
- const U = R(), B = F(
185
- N(
186
- U,
175
+ let p = n;
176
+ const B = N(), A = P(
177
+ T(
178
+ B,
187
179
  p
188
180
  )
189
181
  );
190
- B.displayName = "KendoReactColorPalette";
182
+ A.displayName = "KendoReactColorPalette";
191
183
  export {
192
- B as ColorPalette,
193
- U as ColorPalettePropsContext,
184
+ A as ColorPalette,
185
+ B as ColorPalettePropsContext,
194
186
  p as ColorPaletteWithoutContext,
195
- f as DEFAULT_COLUMNS_COUNT,
196
- L as DEFAULT_PRESET,
197
- z as DEFAULT_TILE_SIZE
187
+ m as DEFAULT_COLUMNS_COUNT,
188
+ z as DEFAULT_PRESET,
189
+ x as DEFAULT_TILE_SIZE
198
190
  };
@@ -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 De=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),ze=require("../package-metadata.js"),Ne=require("./Picker.js"),Le=require("./ColorGradient.js"),G=require("./ColorPalette.js"),B=require("./FlatColorPicker.js"),xe=require("@progress/kendo-react-buttons"),qe=require("@progress/kendo-svg-icons"),d=require("../messages/index.js"),Ve=require("@progress/kendo-react-intl"),He=require("../common/AdaptiveMode.js"),Me=require("@progress/kendo-react-layout");function Ue(f){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const a in f)if(a!=="default"){const k=Object.getOwnPropertyDescriptor(f,a);Object.defineProperty(y,a,k.get?k:{enumerable:!0,get:()=>f[a]})}}return y.default=f,Object.freeze(y)}const t=Ue(De),je={opacity:!0},Ge={palette:G.DEFAULT_PRESET,tileSize:G.DEFAULT_TILE_SIZE},j=f=>f!==void 0,pe=n.createPropsContext(),K=t.forwardRef((f,y)=>{var le,ce;n.validatePackage(ze.packageMetadata);const a=n.usePropsContext(pe,f),k=Ve.useLocalization(),W=n.useAdaptiveModeContext(),{size:p=w.size,rounded:O=w.rounded,fillMode:_=w.fillMode,gradientSettings:$=w.gradientSettings,paletteSettings:Z=w.paletteSettings,flatColorPickerSettings:S,view:g=a.views?void 0:w.view,views:s=g?void 0:w.views,activeView:J,popupSettings:C,valid:fe,disabled:D,tabIndex:ge,icon:z,svgIcon:N,iconClassName:R,onChange:L,onFocus:x,onBlur:q,onActiveColorClick:V,className:ve,adaptive:ke,adaptiveTitle:Q=k.toLanguageString(d.colorPickerAdaptiveTitle,d.messages[d.colorPickerAdaptiveTitle])}=a,u=t.useRef(null),T=t.useRef(null),A=t.useRef(null),m=t.useRef(null),P=t.useRef(),me=t.useRef(null),[Ce,X]=t.useState(!1),[be,Ee]=t.useState(a.defaultValue),[we,Pe]=t.useState(!1),[I,ye]=t.useState(),H=j(a.value),b=j(a.open),l=H?a.value:be,E=b?a.open:we,Y=t.useRef(l),ee=t.useCallback(()=>{u.current&&u.current.focus()},[]);t.useImperativeHandle(y,()=>({element:u.current,actionElement:me.current,value:l,focus:ee}),[l,ee]);const Se=!!(I&&W&&I<=W.medium&&ke);t.useEffect(()=>{const e=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Be.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{document!=null&&document.body&&e&&e.disconnect()}},[]);const c=t.useCallback((e,i)=>{b||(!e&&!i&&u&&u.current&&u.current.focus(),Pe(e))},[b]),te=t.useMemo(()=>new n.Navigation({root:u,selectors:[".k-colorpicker",".k-color-picker-popup"],tabIndex:0,keyboardEvents:{keydown:{Escape:(e,i,r)=>{c(!1)},Enter:(e,i,r)=>{!b&&e===u.current&&(r.preventDefault(),r.stopPropagation(),c(!0))},ArrowDown:(e,i,r)=>{r.altKey&&(r.preventDefault(),r.stopPropagation(),c(!0))},ArrowUp:(e,i,r)=>{r.altKey&&(r.preventDefault(),r.stopPropagation(),c(!1))},Tab:(e,i,r)=>{var h,ie,se;if(n.getActiveElement(document)!==u.current){const ue=(h=A.current)==null?void 0:h.wrapperRef.current,F=(ie=T.current)==null?void 0:ie.wrapperRef.current,de=(se=m.current)==null?void 0:se.element;g==="palette"&&ue?n.keepFocusInContainer(r,ue):g==="gradient"&&F?n.keepFocusInContainer(r,F):g==="combo"&&F?n.keepFocusInContainer(r,F.parentElement):s&&de&&n.keepFocusInContainer(r,de)}}}}}),[c,b]),Te=t.useCallback(te.triggerKeyboardEvent.bind(te),[]),he=t.useCallback(()=>{b||(T.current&&T.current.wrapperRef.current?n.focusFirstFocusableChild(T.current.wrapperRef.current):A.current?A.current.focus():m.current&&m.current.element&&n.focusFirstFocusableChild(m.current.element))},[b]),ne=e=>Y.current=e,ae=t.useCallback(e=>{const i={value:Y.current,nativeEvent:e.nativeEvent,syntheticEvent:e};v(i),c(!E,!0)},[E]),M=t.useCallback(()=>{c(!1,!0)},[c]),_e=t.useCallback(e=>{V&&V.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:l,target:{element:u.current,value:l}})},[V,l]),Re=t.useCallback(e=>{P.current?(clearTimeout(P.current),P.current=void 0):X(!0),x&&x.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[x]),Ae=t.useCallback(()=>{c(!1,!0),X(!1),P.current=void 0},[]),Ie=t.useCallback(e=>{clearTimeout(P.current),P.current=window.setTimeout(Ae),q&&q.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[q]),v=t.useCallback((e,i)=>{var h;const r=i?e.rgbaValue||"":(h=e.value)!=null?h:"";H||Ee(r),L&&L.call(void 0,{value:r,nativeEvent:e.nativeEvent,syntheticEvent:e.syntheticEvent,target:{element:u.current,value:r}}),c(!1)},[H,L]),re=t.useCallback(e=>v(e,!0),[j,v]),U=t.useCallback(e=>t.createElement(t.Fragment,null,(g==="combo"||g==="gradient")&&t.createElement(Le.ColorGradient,{...$,_adaptive:e,ref:T,isInsidePopup:!0,size:e?"large":p,fillMode:_,value:l,onChange:v}),(g==="combo"||g==="palette")&&t.createElement(G.ColorPalette,{...Z,ref:A,size:e?"large":p,value:l,onChange:re}),s&&s[0]==="gradient"&&s[1]==="palette"&&t.createElement(B.FlatColorPicker,{...S,_gradientSettings:{_adaptive:e},ref:m,size:e?"large":p,views:["gradient","palette"],activeView:J,setOpen:c,showButtons:!e,value:l,onChange:v}),s&&s[0]==="palette"&&s[1]==="gradient"&&t.createElement(B.FlatColorPicker,{...S,_gradientSettings:{_adaptive:e},ref:m,size:e?"large":p,views:["palette","gradient"],setOpen:c,showButtons:!e,value:l,onChange:v}),s&&s.includes("gradient")&&!s.includes("palette")&&t.createElement(B.FlatColorPicker,{...S,_gradientSettings:{_adaptive:e},ref:m,size:e?"large":p,views:["gradient"],showButtons:!e,setOpen:c,value:l,onChange:v,setAdaptiveModeValue:ne}),s&&s.includes("palette")&&!s.includes("gradient")&&t.createElement(B.FlatColorPicker,{...S,_gradientSettings:{_adaptive:e},ref:m,size:e?"large":p,views:["palette"],showButtons:!e,setOpen:c,value:l,onChange:v,setAdaptiveModeValue:ne})),[J,_,S,$,v,re,Z,p,l,g,s]),Fe=t.useCallback(()=>{var i;const e={animation:!!((i=C==null?void 0:C.animate)==null||i),title:Q,expand:E,onClose:M,windowWidth:I,footer:{cancelText:k.toLanguageString(d.flatColorPickerCancelBtn,d.messages[d.flatColorPickerCancelBtn]),onCancel:M,applyText:k.toLanguageString(d.flatColorPickerApplyBtn,d.messages[d.flatColorPickerApplyBtn]),onApply:ae}};return t.createElement(He.AdaptiveMode,{...e},t.createElement(Me.ActionSheetContent,{overflowHidden:!0},U(!0)))},[C==null?void 0:C.animate,Q,E,M,I,k,ae,U]),Be=t.useCallback(e=>{for(const i of e)ye(i.target.clientWidth)},[]),oe=n.useDir(u,a.dir),Oe=fe!==!1;return t.createElement("span",{id:a.id,role:"combobox","aria-label":a.ariaLabel,"aria-labelledby":a.ariaLabelledBy,"aria-describedby":a.ariaDescribedBy,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":`k-colorpicker-popup-${(le=a.id)!=null?le:0}`,"aria-disabled":D?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[p]||p}`]:p,[`k-picker-${_}`]:_,[`k-rounded-${n.kendoThemeMaps.roundedMap[O]||O}`]:O,"k-invalid":!Oe,"k-disabled":D,"k-focus":Ce,className:ve}),ref:u,tabIndex:n.getTabIndex(ge,D),title:a.title,onKeyDown:Te,onFocus:Re,onBlur:Ie,dir:oe},t.createElement(Ne.Picker,{dir:oe,open:E,onOpen:he,popupAnchor:u.current||void 0,popupSettings:{id:`k-colorpicker-popup-${(ce=a.id)!=null?ce:0}`,...C},input:t.createElement("span",{onClick:_e,className:"k-input-inner"},t.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!l,"k-icon-color-preview":z||N||R})},R&&t.createElement("span",{className:n.classNames("k-color-preview-icon",R)}),!R&&(z||N)&&t.createElement(n.IconWrap,{name:z,icon:N}),t.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:l}}))),button:t.createElement(xe.Button,{tabIndex:-1,type:"button",onClick:()=>c(!E),className:"k-input-button",rounded:null,icon:"caret-alt-down",svgIcon:qe.caretAltDownIcon,"aria-label":k.toLanguageString(d.colorPickerDropdownButtonAriaLabel,d.messages[d.colorPickerDropdownButtonAriaLabel])}),content:U(!1),_mobileMode:Se,_actionSheet:Fe()}))});K.propTypes={value:o.string,defaultValue:o.string,disabled:o.bool,view:o.oneOf(["gradient","palette","combo"]),views:o.arrayOf(o.oneOf(["gradient","palette"])),dir:o.string,id:o.string,icon:o.string,svgIcon:n.svgIconPropType,ariaLabelledBy:o.string,ariaDescribedBy:o.string,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"]),className:o.string,adaptive:o.bool,adaptiveTitle:o.string};const w={size:"medium",rounded:"medium",fillMode:"solid",view:"palette",views:["gradient","palette"],gradientSettings:je,paletteSettings:Ge};K.displayName="KendoColorPicker";exports.ColorPicker=K;exports.ColorPickerPropsContext=pe;
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;