@progress/kendo-react-dateinputs 5.14.0-dev.202305191608 → 5.14.0-dev.202305231015

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.
@@ -108,6 +108,7 @@ export declare class MultiViewCalendarWithoutContext extends React.Component<Mul
108
108
  private calendarViewList;
109
109
  private isActive;
110
110
  private calculateFocusFromValue;
111
+ private isRtl;
111
112
  /**
112
113
  * Gets the wrapping element of the MultiViewCalendar component.
113
114
  */
@@ -39,6 +39,12 @@ import { BusViewService, NavigationService } from '../services';
39
39
  import { dateInRange, isInRange, viewInRange, getToday, nullable } from '../../utils';
40
40
  import { HorizontalViewList } from './HorizontalViewList';
41
41
  import { TodayCommand } from './TodayCommand';
42
+ /**
43
+ * @hidden
44
+ */
45
+ function isRtl(element) {
46
+ return Boolean(element && getComputedStyle(element).direction === 'rtl');
47
+ }
42
48
  var extractDateFromValue = function (min, max, value) {
43
49
  if (min === void 0) { min = MultiViewCalendarWithoutContext.defaultProps.min; }
44
50
  if (max === void 0) { max = MultiViewCalendarWithoutContext.defaultProps.max; }
@@ -88,6 +94,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
88
94
  _this.calendarViewList = null;
89
95
  _this.isActive = false;
90
96
  _this.calculateFocusFromValue = true;
97
+ _this.isRtl = false;
91
98
  /**
92
99
  * @hidden
93
100
  */
@@ -409,6 +416,11 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
409
416
  */
410
417
  MultiViewCalendarWithoutContext.prototype.componentDidMount = function () {
411
418
  this.calculateFocusFromValue = true;
419
+ var rtl = isRtl(this._element);
420
+ this.isRtl = rtl;
421
+ if (this.isRtl) {
422
+ this.forceUpdate();
423
+ }
412
424
  };
413
425
  /**
414
426
  * @hidden
@@ -463,9 +475,9 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
463
475
  var activeDate = cloneDate(this.dates && this.dates[0] ? this.dates[0] : getToday());
464
476
  return (React.createElement("div", { ref: function (el) { _this._element = el; }, className: wrapperClassName, id: this.props.id || this.wrapperID, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, tabIndex: !this.props.disabled ? this.props.tabIndex : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, onClick: this.handleClick, onKeyDown: this.handleKeyDown, "aria-disabled": this.props.disabled },
465
477
  React.createElement(Header, { key: ".kendo.calendar.header.".concat(activeDate.getTime()), activeView: activeView, currentDate: activeDate, min: this.min, max: this.max, rangeLength: this.props.views, bus: this.bus, service: this.service, headerTitle: this.props.headerTitle, commands: (React.createElement(React.Fragment, null,
466
- React.createElement(Button, __assign({ type: "button", className: "k-calendar-nav-prev", icon: "chevron-left", svgIcon: chevronLeftIcon, fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
478
+ React.createElement(Button, __assign({ type: "button", className: "k-calendar-nav-prev", icon: this.isRtl ? 'chevron-right' : 'chevron-left', svgIcon: this.isRtl ? chevronRightIcon : chevronLeftIcon, fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
467
479
  React.createElement(TodayCommand, { min: this.min, max: this.max, onClick: this.handleTodayClick, disabled: !this.todayIsInRange }),
468
- React.createElement(Button, __assign({ type: "button", className: "k-calendar-nav-next", icon: "chevron-right", svgIcon: chevronRightIcon, fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
480
+ React.createElement(Button, __assign({ type: "button", className: "k-calendar-nav-next", icon: this.isRtl ? 'chevron-left' : 'chevron-right', svgIcon: this.isRtl ? chevronLeftIcon : chevronRightIcon, fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
469
481
  React.createElement(HorizontalViewList, { ref: function (el) { _this.calendarViewList = el; }, dates: this.dates, activeView: activeView, focusedDate: this.focusedDate, min: this.min, max: this.max, bus: this.bus, service: this.service, selectionRange: visualizedRange, value: this.selectedMultiple || this.selectedDate, cellUID: this.cellUID, views: this.props.views, onChange: this.handleDateChange, showWeekNumbers: this.props.weekNumber, onCellEnter: this.handleCellEnter, cell: this.props.cell, weekCell: this.props.weekCell, headerTitle: this.props.headerTitle })));
470
482
  };
471
483
  /**
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-dateinputs',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1684510606,
8
+ publishDate: 1684834780,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
@@ -108,6 +108,7 @@ export declare class MultiViewCalendarWithoutContext extends React.Component<Mul
108
108
  private calendarViewList;
109
109
  private isActive;
110
110
  private calculateFocusFromValue;
111
+ private isRtl;
111
112
  /**
112
113
  * Gets the wrapping element of the MultiViewCalendar component.
113
114
  */
@@ -42,6 +42,12 @@ var services_1 = require("../services");
42
42
  var utils_2 = require("../../utils");
43
43
  var HorizontalViewList_1 = require("./HorizontalViewList");
44
44
  var TodayCommand_1 = require("./TodayCommand");
45
+ /**
46
+ * @hidden
47
+ */
48
+ function isRtl(element) {
49
+ return Boolean(element && getComputedStyle(element).direction === 'rtl');
50
+ }
45
51
  var extractDateFromValue = function (min, max, value) {
46
52
  if (min === void 0) { min = MultiViewCalendarWithoutContext.defaultProps.min; }
47
53
  if (max === void 0) { max = MultiViewCalendarWithoutContext.defaultProps.max; }
@@ -91,6 +97,7 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
91
97
  _this.calendarViewList = null;
92
98
  _this.isActive = false;
93
99
  _this.calculateFocusFromValue = true;
100
+ _this.isRtl = false;
94
101
  /**
95
102
  * @hidden
96
103
  */
@@ -412,6 +419,11 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
412
419
  */
413
420
  MultiViewCalendarWithoutContext.prototype.componentDidMount = function () {
414
421
  this.calculateFocusFromValue = true;
422
+ var rtl = isRtl(this._element);
423
+ this.isRtl = rtl;
424
+ if (this.isRtl) {
425
+ this.forceUpdate();
426
+ }
415
427
  };
416
428
  /**
417
429
  * @hidden
@@ -466,9 +478,9 @@ var MultiViewCalendarWithoutContext = /** @class */ (function (_super) {
466
478
  var activeDate = (0, kendo_date_math_1.cloneDate)(this.dates && this.dates[0] ? this.dates[0] : (0, utils_2.getToday)());
467
479
  return (React.createElement("div", { ref: function (el) { _this._element = el; }, className: wrapperClassName, id: this.props.id || this.wrapperID, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, tabIndex: !this.props.disabled ? this.props.tabIndex : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, onClick: this.handleClick, onKeyDown: this.handleKeyDown, "aria-disabled": this.props.disabled },
468
480
  React.createElement(Header_1.Header, { key: ".kendo.calendar.header.".concat(activeDate.getTime()), activeView: activeView, currentDate: activeDate, min: this.min, max: this.max, rangeLength: this.props.views, bus: this.bus, service: this.service, headerTitle: this.props.headerTitle, commands: (React.createElement(React.Fragment, null,
469
- React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-calendar-nav-prev", icon: "chevron-left", svgIcon: kendo_svg_icons_1.chevronLeftIcon, fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
481
+ React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-calendar-nav-prev", icon: this.isRtl ? 'chevron-right' : 'chevron-left', svgIcon: this.isRtl ? kendo_svg_icons_1.chevronRightIcon : kendo_svg_icons_1.chevronLeftIcon, fillMode: "flat", title: prevViewTitle, disabled: isPrevDisabled, onClick: this.handlePrevButtonClick }, prevBtnAria)),
470
482
  React.createElement(TodayCommand_1.TodayCommand, { min: this.min, max: this.max, onClick: this.handleTodayClick, disabled: !this.todayIsInRange }),
471
- React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-calendar-nav-next", icon: "chevron-right", svgIcon: kendo_svg_icons_1.chevronRightIcon, fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
483
+ React.createElement(kendo_react_buttons_1.Button, __assign({ type: "button", className: "k-calendar-nav-next", icon: this.isRtl ? 'chevron-left' : 'chevron-right', svgIcon: this.isRtl ? kendo_svg_icons_1.chevronLeftIcon : kendo_svg_icons_1.chevronRightIcon, fillMode: "flat", title: nextViewTittle, disabled: isNextDisabled, onClick: this.handleNextButtonClick }, nextBtnAria)))) }),
472
484
  React.createElement(HorizontalViewList_1.HorizontalViewList, { ref: function (el) { _this.calendarViewList = el; }, dates: this.dates, activeView: activeView, focusedDate: this.focusedDate, min: this.min, max: this.max, bus: this.bus, service: this.service, selectionRange: visualizedRange, value: this.selectedMultiple || this.selectedDate, cellUID: this.cellUID, views: this.props.views, onChange: this.handleDateChange, showWeekNumbers: this.props.weekNumber, onCellEnter: this.handleCellEnter, cell: this.props.cell, weekCell: this.props.weekCell, headerTitle: this.props.headerTitle })));
473
485
  };
474
486
  /**
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-dateinputs',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1684510606,
11
+ publishDate: 1684834780,
12
12
  version: '',
13
13
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
14
14
  };