@progress/kendo-react-dateinputs 11.0.0-develop.5 → 11.0.0-develop.7

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,20 +7,20 @@
7
7
  */
8
8
  import * as i from "react";
9
9
  import e from "prop-types";
10
- import { Popup as T } from "@progress/kendo-react-popup";
10
+ import { Popup as _ } from "@progress/kendo-react-popup";
11
11
  import { cloneDate as w } from "@progress/kendo-date-math";
12
- import { classNames as b, Keys as c, validatePackage as _, canUseDOM as D, IconWrap as A, WatermarkOverlay as F, getActiveElement as P, createPropsContext as B, withIdHOC as z, withPropsContext as N, withAdaptiveModeContext as L } from "@progress/kendo-react-common";
13
- import { provideLocalizationService as m, registerForLocalization as V } from "@progress/kendo-react-intl";
14
- import { arrowsSwapIcon as W } from "@progress/kendo-svg-icons";
15
- import { packageMetadata as K } from "../package-metadata.mjs";
12
+ import { classNames as b, Keys as c, validatePackage as F, canUseDOM as D, IconWrap as P, WatermarkOverlay as z, getActiveElement as B, createPropsContext as L, withIdHOC as N, withPropsContext as V, withAdaptiveModeContext as W } from "@progress/kendo-react-common";
13
+ import { provideLocalizationService as m, registerForLocalization as K } from "@progress/kendo-react-intl";
14
+ import { arrowsSwapIcon as U } from "@progress/kendo-svg-icons";
15
+ import { packageMetadata as q } from "../package-metadata.mjs";
16
16
  import { DateInput as f } from "../dateinput/DateInput.mjs";
17
- import { MultiViewCalendar as U } from "../calendar/components/MultiViewCalendar.mjs";
17
+ import { MultiViewCalendar as j } from "../calendar/components/MultiViewCalendar.mjs";
18
18
  import { EMPTY_SELECTIONRANGE as r } from "../calendar/models/SelectionRange.mjs";
19
- import { nullable as h, MAX_DATE as q, MIN_DATE as j } from "../utils.mjs";
20
- import { start as I, messages as l, end as C, separator as S, swapStartEnd as u } from "../messages/index.mjs";
21
- import { Button as G } from "@progress/kendo-react-buttons";
22
- import { AdaptiveMode as H } from "../common/AdaptiveMode.mjs";
23
- import { ActionSheetContent as X } from "@progress/kendo-react-layout";
19
+ import { nullable as h, MAX_DATE as G, MIN_DATE as H } from "../utils.mjs";
20
+ import { dateRangePickerCancel as I, messages as l, dateRangePickerSet as C, start as S, end as E, separator as y, swapStartEnd as p } from "../messages/index.mjs";
21
+ import { Button as X } from "@progress/kendo-react-buttons";
22
+ import { AdaptiveMode as Y } from "../common/AdaptiveMode.mjs";
23
+ import { ActionSheetContent as Z } from "@progress/kendo-react-layout";
24
24
  const o = class o extends i.Component {
25
25
  constructor(a) {
26
26
  super(a), this._element = null, this._calendar = null, this._startDateInput = i.createRef(), this._endDateInput = i.createRef(), this.shouldFocusDateInput = !1, this.shouldFocusCalendar = !1, this.showLicenseWatermark = !1, this.focus = () => {
@@ -44,7 +44,7 @@ const o = class o extends i.Component {
44
44
  dir: this.props.dir,
45
45
  onChange: this.handleCalendarChange
46
46
  };
47
- return this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { ...s }) : /* @__PURE__ */ i.createElement(U, { ...s, ref: this.setCalendarRef });
47
+ return this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { ...s }) : /* @__PURE__ */ i.createElement(j, { ...s, ref: this.setCalendarRef });
48
48
  }, this.renderPopup = () => {
49
49
  const t = {
50
50
  popupClass: b("k-calendar-container", "k-daterangepicker-popup"),
@@ -62,16 +62,24 @@ const o = class o extends i.Component {
62
62
  ...this.props.popupSettings,
63
63
  show: this.show
64
64
  };
65
- return this.props.popup ? /* @__PURE__ */ i.createElement(this.props.popup, { ...t }, this.renderCalendar()) : /* @__PURE__ */ i.createElement(T, { ...t }, this.renderCalendar());
65
+ return this.props.popup ? /* @__PURE__ */ i.createElement(this.props.popup, { ...t }, this.renderCalendar()) : /* @__PURE__ */ i.createElement(_, { ...t }, this.renderCalendar());
66
66
  }, this.renderAdaptivePopup = () => {
67
67
  const { windowWidth: t = 0 } = this.state, s = {
68
68
  expand: this.show,
69
- onClose: (n) => this.handleBlur(n),
69
+ onClose: (n) => this.handleCancel(n),
70
70
  title: this.props.adaptiveTitle,
71
- subTitle: this.props.adaptiveSubtitle,
72
- windowWidth: t
71
+ windowWidth: t,
72
+ footer: {
73
+ cancelText: this.localizationService.toLanguageString(
74
+ I,
75
+ l[I]
76
+ ),
77
+ onCancel: this.handleCancel,
78
+ applyText: this.localizationService.toLanguageString(C, l[C]),
79
+ onApply: this.handleBlur
80
+ }
73
81
  };
74
- return /* @__PURE__ */ i.createElement(H, { ...s }, /* @__PURE__ */ i.createElement(X, null, /* @__PURE__ */ i.createElement("div", { className: "k-scrollable-wrap" }, this.renderCalendar())));
82
+ return /* @__PURE__ */ i.createElement(Y, { ...s }, /* @__PURE__ */ i.createElement(Z, null, /* @__PURE__ */ i.createElement("div", { className: "k-scrollable-wrap" }, this.renderCalendar())));
75
83
  }, this.handleReverseClick = (t) => {
76
84
  const s = {
77
85
  start: this.value.end,
@@ -141,7 +149,7 @@ const o = class o extends i.Component {
141
149
  n.call(void 0, d);
142
150
  }
143
151
  this.valueDuringOnChange = void 0;
144
- }, this.showLicenseWatermark = !_(K, { component: "DateRangePicker" }), this.state = {
152
+ }, this.showLicenseWatermark = !F(q, { component: "DateRangePicker" }), this.state = {
145
153
  show: this.props.show || this.props.defaultShow || o.defaultProps.defaultShow,
146
154
  value: this.props.value || this.props.defaultValue || o.defaultProps.defaultValue,
147
155
  currentValue: r
@@ -238,15 +246,15 @@ const o = class o extends i.Component {
238
246
  * @hidden
239
247
  */
240
248
  render() {
241
- const { autoFocus: a, inputAttributes: t } = this.props, s = this.value || r, n = this.mobileMode && this.show ? this.state.currentValue : s, d = (this.props.startDateInputSettings || {}).id || this._startInputId, E = (this.props.endDateInputSettings || {}).id || this._endInputId, y = b(
249
+ const { autoFocus: a, inputAttributes: t } = this.props, s = this.value || r, n = this.mobileMode && this.show ? this.state.currentValue : s, d = (this.props.startDateInputSettings || {}).id || this._startInputId, x = (this.props.endDateInputSettings || {}).id || this._endInputId, k = b(
242
250
  "k-daterangepicker",
243
251
  {
244
252
  "k-disabled": this.props.disabled
245
253
  },
246
254
  this.props.className
247
- ), x = this.localizationService.toLanguageString(I, l[I]), k = this.localizationService.toLanguageString(C, l[C]), M = this.localizationService.toLanguageString(S, l[S]), v = {
255
+ ), M = this.localizationService.toLanguageString(S, l[S]), O = this.localizationService.toLanguageString(E, l[E]), R = this.localizationService.toLanguageString(y, l[y]), g = {
248
256
  disableSelection: this.mobileMode && !0,
249
- label: x,
257
+ label: M,
250
258
  format: this.props.format,
251
259
  min: this.min,
252
260
  max: this.max,
@@ -260,9 +268,9 @@ const o = class o extends i.Component {
260
268
  value: n.start,
261
269
  onChange: this.handleStartChange,
262
270
  inputAttributes: this.props.inputAttributes
263
- }, g = {
271
+ }, v = {
264
272
  disableSelection: this.mobileMode && !0,
265
- label: k,
273
+ label: O,
266
274
  format: this.props.format,
267
275
  min: this.min,
268
276
  max: this.max,
@@ -276,30 +284,30 @@ const o = class o extends i.Component {
276
284
  value: n.end,
277
285
  onChange: this.handleEndChange,
278
286
  inputAttributes: this.props.inputAttributes
279
- }, O = /* @__PURE__ */ i.createElement(
280
- G,
287
+ }, T = /* @__PURE__ */ i.createElement(
288
+ X,
281
289
  {
282
290
  type: "button",
283
291
  className: "k-select",
284
292
  fillMode: "flat",
285
- title: m(this).toLanguageString(u, l[u]),
293
+ title: m(this).toLanguageString(p, l[p]),
286
294
  onMouseDown: this.handleReverseMouseDown,
287
295
  onClick: this.handleReverseClick,
288
- "aria-controls": d + " " + E,
296
+ "aria-controls": d + " " + x,
289
297
  "aria-label": m(this).toLanguageString(
290
- u,
291
- l[u]
298
+ p,
299
+ l[p]
292
300
  )
293
301
  },
294
- /* @__PURE__ */ i.createElement(A, { style: { transform: "rotate(90deg)" }, name: "arrows-swap", icon: W })
302
+ /* @__PURE__ */ i.createElement(P, { style: { transform: "rotate(90deg)" }, name: "arrows-swap", icon: U })
295
303
  );
296
304
  return /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
297
305
  "span",
298
306
  {
299
- ref: (R) => {
300
- this._element = R;
307
+ ref: (A) => {
308
+ this._element = A;
301
309
  },
302
- className: y,
310
+ className: k,
303
311
  style: this.props.style,
304
312
  id: this.props.id,
305
313
  "aria-labelledby": this.props.ariaLabelledBy,
@@ -311,33 +319,33 @@ const o = class o extends i.Component {
311
319
  onBlur: this.mobileMode ? void 0 : this.handleBlur,
312
320
  dir: this.props.dir
313
321
  },
314
- this.props.startDateInput ? /* @__PURE__ */ i.createElement(this.props.startDateInput, { ...v }) : /* @__PURE__ */ i.createElement(
322
+ this.props.startDateInput ? /* @__PURE__ */ i.createElement(this.props.startDateInput, { ...g }) : /* @__PURE__ */ i.createElement(
315
323
  f,
316
324
  {
317
- ...v,
325
+ ...g,
318
326
  autoFocus: a,
319
327
  ref: this._startDateInput,
320
328
  ariaRole: "combobox",
321
329
  ariaControls: this._popupId
322
330
  }
323
331
  ),
324
- (this.props.allowReverse || this.props.calendarSettings && this.props.calendarSettings.allowReverse) && this.props.swapButton ? O : M,
325
- this.props.endDateInput ? /* @__PURE__ */ i.createElement(this.props.endDateInput, { ...g }) : /* @__PURE__ */ i.createElement(
332
+ (this.props.allowReverse || this.props.calendarSettings && this.props.calendarSettings.allowReverse) && this.props.swapButton ? T : R,
333
+ this.props.endDateInput ? /* @__PURE__ */ i.createElement(this.props.endDateInput, { ...v }) : /* @__PURE__ */ i.createElement(
326
334
  f,
327
335
  {
328
- ...g,
336
+ ...v,
329
337
  ref: this._endDateInput,
330
338
  ariaRole: "combobox",
331
339
  ariaControls: this._popupId
332
340
  }
333
341
  ),
334
342
  !this.mobileMode && this.renderPopup()
335
- ), this.mobileMode && this.renderAdaptivePopup(), this.showLicenseWatermark && /* @__PURE__ */ i.createElement(F, null));
343
+ ), this.mobileMode && this.renderAdaptivePopup(), this.showLicenseWatermark && /* @__PURE__ */ i.createElement(z, null));
336
344
  }
337
345
  focusDateInputElement() {
338
346
  if (!document || !this.startDateInput || !this.startDateInput.element || !this.endDateInput || !this.endDateInput.element)
339
347
  return;
340
- const a = P(document);
348
+ const a = B(document);
341
349
  (this.value.start === null || this.value.end !== null) && a !== this.endDateInput.element ? this.startDateInput.element.focus({ preventScroll: !0 }) : a !== this.startDateInput.element && this.endDateInput.element.focus({ preventScroll: !0 });
342
350
  }
343
351
  nextTick(a) {
@@ -415,22 +423,22 @@ o.displayName = "DateRangePicker", o.propTypes = {
415
423
  defaultValue: r,
416
424
  disabled: !1,
417
425
  format: "d",
418
- max: q,
419
- min: j,
426
+ max: G,
427
+ min: H,
420
428
  swapButton: !1,
421
429
  autoFocus: !1
422
430
  };
423
- let p = o;
424
- const Y = B(), Z = z(
425
- N(
426
- Y,
427
- L(p)
431
+ let u = o;
432
+ const J = L(), Q = N(
433
+ V(
434
+ J,
435
+ W(u)
428
436
  )
429
437
  );
430
- Z.displayName = "KendoReactDateRangePicker";
431
- V(p);
438
+ Q.displayName = "KendoReactDateRangePicker";
439
+ K(u);
432
440
  export {
433
- Z as DateRangePicker,
434
- Y as DateRangePickerPropsContext,
435
- p as DateRangePickerWithoutContext
441
+ Q as DateRangePicker,
442
+ J as DateRangePickerPropsContext,
443
+ u as DateRangePickerWithoutContext
436
444
  };