@progress/kendo-react-inputs 9.4.0-develop.23 → 9.4.0-develop.3

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 +183 -312
  16. package/colors/FlatColorPicker.js +1 -1
  17. package/colors/FlatColorPicker.mjs +139 -224
  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 +23 -22
  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 -118
  36. package/index.d.ts +10 -118
  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 Be=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),Oe=require("../package-metadata.js"),De=require("./Picker.js"),ze=require("./ColorGradient.js"),K=require("./ColorPalette.js"),B=require("./FlatColorPicker.js"),Ne=require("@progress/kendo-react-buttons"),Le=require("@progress/kendo-svg-icons"),u=require("../messages/index.js"),xe=require("@progress/kendo-react-intl"),qe=require("../common/AdaptiveMode.js"),He=require("@progress/kendo-react-layout");function Ve(p){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const a in p)if(a!=="default"){const k=Object.getOwnPropertyDescriptor(p,a);Object.defineProperty(y,a,k.get?k:{enumerable:!0,get:()=>p[a]})}}return y.default=p,Object.freeze(y)}const t=Ve(Be),Me={opacity:!0},Ue={palette:K.DEFAULT_PRESET,tileSize:K.DEFAULT_TILE_SIZE},G=p=>p!==void 0,ue=n.createPropsContext(),W=t.forwardRef((p,y)=>{var re,oe;n.validatePackage(Oe.packageMetadata);const a=n.usePropsContext(ue,p),k=xe.useLocalization(),$=n.useAdaptiveModeContext(),{size:d=E.size,rounded:O=E.rounded,fillMode:_=E.fillMode,gradientSettings:Z=E.gradientSettings,paletteSettings:J=E.paletteSettings,flatColorPickerSettings:S,view:f=a.views?void 0:E.view,views:l=f?void 0:E.views,activeView:Q,popupSettings:C,valid:de,disabled:D,tabIndex:pe,icon:z,svgIcon:N,iconClassName:R,onChange:L,onFocus:x,onBlur:q,onActiveColorClick:H,className:fe,adaptive:ge,adaptiveTitle:X=k.toLanguageString(u.colorPickerAdaptiveTitle,u.messages[u.colorPickerAdaptiveTitle])}=a,i=t.useRef(null),T=t.useRef(null),A=t.useRef(null),v=t.useRef(null),w=t.useRef(),ke=t.useRef(null),[ve,Y]=t.useState(!1),[me,Ce]=t.useState(a.defaultValue),[be,Ee]=t.useState(!1),[I,we]=t.useState(),V=G(a.value),b=G(a.open),c=V?a.value:me,P=b?a.open:be,ee=t.useCallback(()=>{i.current&&i.current.focus()},[]);t.useImperativeHandle(y,()=>({element:i.current,actionElement:ke.current,value:c,focus:ee}),[c,ee]);const Pe=!!(I&&$&&I<=$.medium&&ge);t.useEffect(()=>{const e=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ie.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{document!=null&&document.body&&e&&e.disconnect()}},[]);const g=t.useCallback((e,s)=>{b||(!e&&!s&&i&&i.current&&i.current.focus(),Ee(e))},[b]),te=t.useMemo(()=>new n.Navigation({root:i,selectors:[".k-colorpicker",".k-color-picker-popup"],tabIndex:0,keyboardEvents:{keydown:{Escape:(e,s,r)=>{g(!1)},Enter:(e,s,r)=>{!b&&e===i.current&&(r.preventDefault(),r.stopPropagation(),g(!0))},ArrowDown:(e,s,r)=>{r.altKey&&(r.preventDefault(),r.stopPropagation(),g(!0))},ArrowUp:(e,s,r)=>{r.altKey&&(r.preventDefault(),r.stopPropagation(),g(!1))},Tab:(e,s,r)=>{var h,le,ie;if(n.getActiveElement(document)!==i.current){const ce=(h=A.current)==null?void 0:h.wrapperRef.current,F=(le=T.current)==null?void 0:le.wrapperRef.current,se=(ie=v.current)==null?void 0:ie.element;f==="palette"&&ce?n.keepFocusInContainer(r,ce):f==="gradient"&&F?n.keepFocusInContainer(r,F):f==="combo"&&F?n.keepFocusInContainer(r,F.parentElement):l&&se&&n.keepFocusInContainer(r,se)}}}}}),[g,b]),ye=t.useCallback(te.triggerKeyboardEvent.bind(te),[]),Se=t.useCallback(()=>{b||(T.current&&T.current.wrapperRef.current?n.focusFirstFocusableChild(T.current.wrapperRef.current):A.current?A.current.focus():v.current&&v.current.element&&n.focusFirstFocusableChild(v.current.element))},[b]),M=t.useCallback(()=>{g(!P,!0)},[P]),U=t.useCallback(()=>{g(!1,!0)},[g]),Te=t.useCallback(e=>{H&&H.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:c,target:{element:i.current,value:c}})},[H,c]),he=t.useCallback(e=>{w.current?(clearTimeout(w.current),w.current=void 0):Y(!0),x&&x.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[x]),_e=t.useCallback(()=>{g(!1,!0),Y(!1),w.current=void 0},[]),Re=t.useCallback(e=>{clearTimeout(w.current),w.current=window.setTimeout(_e),q&&q.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[q]),m=t.useCallback((e,s)=>{var h;const r=s?e.rgbaValue||"":(h=e.value)!=null?h:"";V||Ce(r),L&&L.call(void 0,{value:r,nativeEvent:e.nativeEvent,syntheticEvent:e.syntheticEvent,target:{element:i.current,value:r}})},[V,L]),ne=t.useCallback(e=>m(e,!0),[G,m]),j=t.useCallback(e=>t.createElement(t.Fragment,null,(f==="combo"||f==="gradient")&&t.createElement(ze.ColorGradient,{...Z,_adaptive:e,ref:T,isInsidePopup:!0,size:e?"large":d,fillMode:_,value:c,onChange:m}),(f==="combo"||f==="palette")&&t.createElement(K.ColorPalette,{...J,ref:A,size:e?"large":d,value:c,onChange:ne}),l&&l[0]==="gradient"&&l[1]==="palette"&&t.createElement(B.FlatColorPicker,{...S,_gradientSettings:{_adaptive:e},ref:v,size:e?"large":d,views:["gradient","palette"],activeView:Q,showButtons:!e,value:c,onChange:m}),l&&l[0]==="palette"&&l[1]==="gradient"&&t.createElement(B.FlatColorPicker,{...S,_gradientSettings:{_adaptive:e},ref:v,size:e?"large":d,views:["palette","gradient"],showButtons:!e,value:c,onChange:m}),l&&l.includes("gradient")&&!l.includes("palette")&&t.createElement(B.FlatColorPicker,{...S,_gradientSettings:{_adaptive:e},ref:v,size:e?"large":d,views:["gradient"],showButtons:!e,value:c,onChange:m}),l&&l.includes("palette")&&!l.includes("gradient")&&t.createElement(B.FlatColorPicker,{...S,_gradientSettings:{_adaptive:e},ref:v,size:e?"large":d,views:["palette"],showButtons:!e,value:c,onChange:m})),[Q,_,S,Z,m,ne,J,d,c,f,l]),Ae=t.useCallback(()=>{var s;const e={animation:!!((s=C==null?void 0:C.animate)==null||s),title:X,expand:P,onClose:U,windowWidth:I,footer:{cancelText:k.toLanguageString(u.flatColorPickerCancelBtn,u.messages[u.flatColorPickerCancelBtn]),onCancel:U,applyText:k.toLanguageString(u.flatColorPickerApplyBtn,u.messages[u.flatColorPickerApplyBtn]),onApply:M}};return t.createElement(qe.AdaptiveMode,{...e},t.createElement(He.ActionSheetContent,{overflowHidden:!0},j(!0)))},[C==null?void 0:C.animate,X,P,U,I,k,M,j]),Ie=t.useCallback(e=>{for(const s of e)we(s.target.clientWidth)},[]),ae=n.useDir(i,a.dir),Fe=de!==!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":P,"aria-controls":`k-colorpicker-popup-${(re=a.id)!=null?re:0}`,"aria-disabled":D?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[d]||d}`]:d,[`k-picker-${_}`]:_,[`k-rounded-${n.kendoThemeMaps.roundedMap[O]||O}`]:O,"k-invalid":!Fe,"k-disabled":D,"k-focus":ve,className:fe}),ref:i,tabIndex:n.getTabIndex(pe,D),title:a.title,onKeyDown:ye,onFocus:he,onBlur:Re,dir:ae},t.createElement(De.Picker,{dir:ae,open:P,onOpen:Se,popupAnchor:i.current||void 0,popupSettings:{id:`k-colorpicker-popup-${(oe=a.id)!=null?oe:0}`,...C},input:t.createElement("span",{onClick:Te,className:"k-input-inner"},t.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!c,"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:c}}))),button:t.createElement(Ne.Button,{tabIndex:-1,type:"button",onClick:M,className:"k-input-button",rounded:null,icon:"caret-alt-down",svgIcon:Le.caretAltDownIcon,"aria-label":k.toLanguageString(u.colorPickerDropdownButtonAriaLabel,u.messages[u.colorPickerDropdownButtonAriaLabel])}),content:j(!1),_mobileMode:Pe,_actionSheet:Ae()}))});W.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 E={size:"medium",rounded:"medium",fillMode:"solid",view:"palette",views:["gradient","palette"],gradientSettings:Me,paletteSettings:Ue};W.displayName="KendoColorPicker";exports.ColorPicker=W;exports.ColorPickerPropsContext=ue;
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;