@progress/kendo-react-inputs 9.5.0 → 10.0.0-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.
@@ -7,17 +7,16 @@
7
7
  */
8
8
  import * as a from "react";
9
9
  import l from "prop-types";
10
- import { validatePackage as p, Navigation as ee, getActiveElement as _, disableNavigatableContainer as K, keepFocusInContainer as ae, focusFirstFocusableChild as te, enableNavigatableContainer as le, getTabIndex as ne, classNames as V, kendoThemeMaps as oe } from "@progress/kendo-react-common";
11
- import { ButtonGroup as M, Button as s } from "@progress/kendo-react-buttons";
12
- import { dropletSliderIcon as L, paletteIcon as G, dropletSlashIcon as ie } from "@progress/kendo-svg-icons";
13
- import { ColorPalette as re } from "./ColorPalette.mjs";
14
- import { ColorGradient as ce } from "./ColorGradient.mjs";
15
- import { packageMetadata as de } from "../package-metadata.mjs";
16
- import { useLocalization as se } from "@progress/kendo-react-intl";
17
- import { flatColorPickerColorGradientBtn as C, messages as u, flatColorPickerColorPaletteBtn as k, flatColorPickerClearBtn as T, flatColorPickerCancelBtn as ue, flatColorPickerApplyBtn as ve } from "../messages/index.mjs";
18
- const D = a.forwardRef((e, O) => {
19
- p(de);
20
- const f = a.useRef(null), y = a.useRef(null), H = a.useRef(null), {
10
+ import { validatePackage as ee, Navigation as ae, getActiveElement as _, disableNavigatableContainer as K, keepFocusInContainer as te, focusFirstFocusableChild as le, enableNavigatableContainer as ne, getTabIndex as oe, classNames as V, kendoThemeMaps as ie, WatermarkOverlay as re } from "@progress/kendo-react-common";
11
+ import { ButtonGroup as L, Button as s } from "@progress/kendo-react-buttons";
12
+ import { dropletSliderIcon as M, paletteIcon as G, dropletSlashIcon as ce } from "@progress/kendo-svg-icons";
13
+ import { ColorPalette as de } from "./ColorPalette.mjs";
14
+ import { ColorGradient as se } from "./ColorGradient.mjs";
15
+ import { packageMetadata as ue } from "../package-metadata.mjs";
16
+ import { useLocalization as ve } from "@progress/kendo-react-intl";
17
+ import { flatColorPickerColorGradientBtn as k, messages as u, flatColorPickerColorPaletteBtn as C, flatColorPickerClearBtn as O, flatColorPickerCancelBtn as ge, flatColorPickerApplyBtn as me } from "../messages/index.mjs";
18
+ const T = a.forwardRef((e, D) => {
19
+ const H = !ee(ue, { component: "FlatColorPicker" }), f = a.useRef(null), y = a.useRef(null), W = a.useRef(null), {
21
20
  defaultValue: b,
22
21
  showButtons: w = !0,
23
22
  showPreview: q = !0,
@@ -34,7 +33,7 @@ const D = a.forwardRef((e, O) => {
34
33
  a.useEffect(() => {
35
34
  E(e.value);
36
35
  }, [e.value]);
37
- const m = se(), R = a.useCallback(() => {
36
+ const m = ve(), R = a.useCallback(() => {
38
37
  f.current && f.current.focus();
39
38
  }, [f]);
40
39
  a.useImperativeHandle(
@@ -46,7 +45,7 @@ const D = a.forwardRef((e, O) => {
46
45
  value: B
47
46
  }),
48
47
  [B, R, e]
49
- ), a.useImperativeHandle(O, () => f.current);
48
+ ), a.useImperativeHandle(D, () => f.current);
50
49
  const A = a.useCallback(
51
50
  (t) => {
52
51
  (t === "ColorGradient" && !v || t === "ColorPalette" && v) && j(!v);
@@ -71,7 +70,7 @@ const D = a.forwardRef((e, O) => {
71
70
  }
72
71
  },
73
72
  [b, e.onPreviewChange]
74
- ), z = a.useCallback(
73
+ ), F = a.useCallback(
75
74
  (t) => {
76
75
  var n;
77
76
  if (E(t.value), e.onPreviewChange) {
@@ -99,7 +98,7 @@ const D = a.forwardRef((e, O) => {
99
98
  [i, e.onChange]
100
99
  ), U = a.useCallback(() => {
101
100
  E(g), e.setOpen && e.setOpen(!1);
102
- }, [g]), W = a.useCallback(
101
+ }, [g]), X = a.useCallback(
103
102
  (t) => {
104
103
  if (E(g), e.onPreviewChange) {
105
104
  const n = {
@@ -111,31 +110,31 @@ const D = a.forwardRef((e, O) => {
111
110
  }
112
111
  },
113
112
  [g, e.onPreviewChange]
114
- ), X = a.useCallback(
113
+ ), Y = a.useCallback(
115
114
  (t) => {
116
115
  var c, S;
117
116
  if ((!t.relatedTarget || !((c = y.current) != null && c.contains(t.relatedTarget))) && !((S = e._gradientSettings) != null && S._adaptive) && (!w && i !== void 0 && I(i), !w && e.onChange)) {
118
- const Z = {
117
+ const p = {
119
118
  value: i,
120
119
  nativeEvent: t.nativeEvent,
121
120
  syntheticEvent: t
122
121
  };
123
- e.onChange.call(void 0, Z);
122
+ e.onChange.call(void 0, p);
124
123
  }
125
124
  },
126
125
  [i, w, e.onChange]
127
- ), F = a.useMemo(
128
- () => new ee({
126
+ ), z = a.useMemo(
127
+ () => new ae({
129
128
  root: y,
130
129
  selectors: [".k-coloreditor"],
131
130
  tabIndex: 0,
132
131
  keyboardEvents: {
133
132
  keydown: {
134
133
  Tab: (t, n, c) => {
135
- _(document) === t ? K(t) : ae(c, t);
134
+ _(document) === t ? K(t) : te(c, t);
136
135
  },
137
136
  Enter: (t, n, c) => {
138
- _(document) === t && (te(t), le(t));
137
+ _(document) === t && (le(t), ne(t));
139
138
  },
140
139
  Escape: (t, n, c) => {
141
140
  _(document) !== t && (t.focus(), K(t));
@@ -144,7 +143,7 @@ const D = a.forwardRef((e, O) => {
144
143
  }
145
144
  }),
146
145
  []
147
- ), Y = a.useCallback(F.triggerKeyboardEvent.bind(F), []);
146
+ ), Z = a.useCallback(z.triggerKeyboardEvent.bind(z), []);
148
147
  return /* @__PURE__ */ a.createElement(
149
148
  "div",
150
149
  {
@@ -153,32 +152,32 @@ const D = a.forwardRef((e, O) => {
153
152
  "aria-label": e.ariaLabel,
154
153
  "aria-labelledby": e.ariaLabelledBy,
155
154
  "aria-disabled": e.disabled ? "true" : void 0,
156
- style: e.style,
155
+ style: { position: "relative", ...e.style },
157
156
  ref: y,
158
- tabIndex: ne(e.tabIndex, e.disabled),
157
+ tabIndex: oe(e.tabIndex, e.disabled),
159
158
  className: V(
160
159
  "k-flatcolorpicker k-coloreditor",
161
160
  {
162
- [`k-coloreditor-${oe.sizeMap[o] || o}`]: o,
161
+ [`k-coloreditor-${ie.sizeMap[o] || o}`]: o,
163
162
  "k-disabled": e.disabled
164
163
  },
165
164
  e.className
166
165
  ),
167
- onBlur: X,
168
- onKeyDown: Y
166
+ onBlur: Y,
167
+ onKeyDown: Z
169
168
  },
170
- e.header || /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header k-hstack" }, /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, r && r[0] === "gradient" && r[1] === "palette" && /* @__PURE__ */ a.createElement(M, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
169
+ e.header || /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header k-hstack" }, /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, r && r[0] === "gradient" && r[1] === "palette" && /* @__PURE__ */ a.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
171
170
  s,
172
171
  {
173
172
  type: "button",
174
173
  "aria-label": m.toLanguageString(
175
- C,
176
- u[C]
174
+ k,
175
+ u[k]
177
176
  ),
178
177
  togglable: !0,
179
178
  fillMode: "flat",
180
179
  size: o,
181
- svgIcon: L,
180
+ svgIcon: M,
182
181
  selected: d,
183
182
  onClick: () => N("gradient")
184
183
  }
@@ -187,8 +186,8 @@ const D = a.forwardRef((e, O) => {
187
186
  {
188
187
  type: "button",
189
188
  "aria-label": m.toLanguageString(
190
- k,
191
- u[k]
189
+ C,
190
+ u[C]
192
191
  ),
193
192
  togglable: !0,
194
193
  fillMode: "flat",
@@ -197,13 +196,13 @@ const D = a.forwardRef((e, O) => {
197
196
  selected: !d,
198
197
  onClick: () => N("palette")
199
198
  }
200
- )), r && r[0] === "palette" && r[1] === "gradient" && /* @__PURE__ */ a.createElement(M, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
199
+ )), r && r[0] === "palette" && r[1] === "gradient" && /* @__PURE__ */ a.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
201
200
  s,
202
201
  {
203
202
  type: "button",
204
203
  "aria-label": m.toLanguageString(
205
- k,
206
- u[k]
204
+ C,
205
+ u[C]
207
206
  ),
208
207
  togglable: !0,
209
208
  fillMode: "flat",
@@ -217,23 +216,23 @@ const D = a.forwardRef((e, O) => {
217
216
  {
218
217
  type: "button",
219
218
  "aria-label": m.toLanguageString(
220
- C,
221
- u[C]
219
+ k,
220
+ u[k]
222
221
  ),
223
222
  togglable: !0,
224
223
  fillMode: "flat",
225
224
  size: o,
226
- svgIcon: L,
225
+ svgIcon: M,
227
226
  selected: d,
228
227
  onClick: () => N("gradient")
229
228
  }
230
- )), h && /* @__PURE__ */ a.createElement(M, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
229
+ )), h && /* @__PURE__ */ a.createElement(L, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
231
230
  s,
232
231
  {
233
232
  type: "button",
234
233
  "aria-label": m.toLanguageString(
235
- C,
236
- u[C]
234
+ k,
235
+ u[k]
237
236
  ),
238
237
  togglable: !0,
239
238
  fillMode: "flat",
@@ -241,15 +240,15 @@ const D = a.forwardRef((e, O) => {
241
240
  selected: v,
242
241
  onClick: () => A("ColorGradient"),
243
242
  icon: "droplet-slider",
244
- svgIcon: L
243
+ svgIcon: M
245
244
  }
246
245
  ), /* @__PURE__ */ a.createElement(
247
246
  s,
248
247
  {
249
248
  type: "button",
250
249
  "aria-label": m.toLanguageString(
251
- k,
252
- u[k]
250
+ C,
251
+ u[C]
253
252
  ),
254
253
  togglable: !0,
255
254
  fillMode: "flat",
@@ -267,11 +266,11 @@ const D = a.forwardRef((e, O) => {
267
266
  size: o,
268
267
  onClick: J,
269
268
  "aria-label": m.toLanguageString(
270
- T,
271
- u[T]
269
+ O,
270
+ u[O]
272
271
  ),
273
272
  icon: "droplet-slash",
274
- svgIcon: ie
273
+ svgIcon: ce
275
274
  }
276
275
  ), q && /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-preview k-vstack" }, /* @__PURE__ */ a.createElement(
277
276
  "span",
@@ -293,7 +292,7 @@ const D = a.forwardRef((e, O) => {
293
292
  className: V("k-coloreditor-current-color", "k-color-preview", {
294
293
  "k-no-color": g === void 0
295
294
  }),
296
- onClick: W
295
+ onClick: X
297
296
  },
298
297
  /* @__PURE__ */ a.createElement(
299
298
  "span",
@@ -302,15 +301,15 @@ const D = a.forwardRef((e, O) => {
302
301
  style: { background: g || void 0 }
303
302
  }
304
303
  )
305
- )))),
304
+ ))), H && /* @__PURE__ */ a.createElement(re, null)),
306
305
  /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-views k-vstack" }, (h && v || r && d) && /* @__PURE__ */ a.createElement(
307
- ce,
306
+ se,
308
307
  {
309
- ref: H,
308
+ ref: W,
310
309
  role: "none",
311
310
  ariaLabel: void 0,
312
311
  value: i,
313
- onChange: z,
312
+ onChange: F,
314
313
  opacity: e.opacity,
315
314
  format: e.format,
316
315
  size: o,
@@ -318,16 +317,16 @@ const D = a.forwardRef((e, O) => {
318
317
  ...e._gradientSettings
319
318
  }
320
319
  ), (h && !v || r && !d) && /* @__PURE__ */ a.createElement(
321
- re,
320
+ de,
322
321
  {
323
322
  ariaDisabled: !0,
324
323
  ariaLabelledBy: "required_label",
325
324
  value: i,
326
- onChange: z,
325
+ onChange: F,
327
326
  size: o
328
327
  }
329
328
  )),
330
- w && /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-footer k-actions k-actions-end k-actions-horizontal" }, /* @__PURE__ */ a.createElement(s, { type: "button", className: "k-coloreditor-cancel", size: o, onClick: U }, u[ue]), /* @__PURE__ */ a.createElement(
329
+ w && /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-footer k-actions k-actions-end k-actions-horizontal" }, /* @__PURE__ */ a.createElement(s, { type: "button", className: "k-coloreditor-cancel", size: o, onClick: U }, u[ge]), /* @__PURE__ */ a.createElement(
331
330
  s,
332
331
  {
333
332
  type: "button",
@@ -336,10 +335,10 @@ const D = a.forwardRef((e, O) => {
336
335
  size: o,
337
336
  onClick: Q
338
337
  },
339
- u[ve]
338
+ u[me]
340
339
  ))
341
340
  );
342
- }), ge = {
341
+ }), ke = {
343
342
  id: l.string,
344
343
  style: l.any,
345
344
  className: l.string,
@@ -361,8 +360,8 @@ const D = a.forwardRef((e, O) => {
361
360
  views: l.array,
362
361
  size: l.oneOf([null, "small", "medium", "large"])
363
362
  };
364
- D.displayName = "KendoFlatColorPicker";
365
- D.propTypes = ge;
363
+ T.displayName = "KendoFlatColorPicker";
364
+ T.propTypes = ke;
366
365
  export {
367
- D as FlatColorPicker
366
+ T as FlatColorPicker
368
367
  };