@progress/kendo-react-dropdowns 5.17.0-dev.202308261921 → 5.17.0-dev.202308290932

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.
@@ -200,7 +200,7 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
200
200
  };
201
201
  if (keyCode === Keys.enter || keyCode === Keys.esc) {
202
202
  preventDefault();
203
- if (skipDisabledItems === false && focusedItem.disabled) {
203
+ if (skipDisabledItems === false && focusedItem && focusedItem.disabled) {
204
204
  if (opened) {
205
205
  _this.togglePopup(state);
206
206
  }
@@ -481,7 +481,7 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
481
481
  var focusedItem = data[focusedIndex];
482
482
  this._suggested = '';
483
483
  if (opened && eventKey === Keys.enter) {
484
- if (!focusedItem.disabled) {
484
+ if (focusedItem && !focusedItem.disabled) {
485
485
  var newValue = getItemValue(data[this.focusedIndex(value)], textField);
486
486
  this.triggerOnChange(newValue, state);
487
487
  }
@@ -161,6 +161,7 @@ export declare class ComboBoxWithoutContext extends React.Component<ComboBoxProp
161
161
  onNavigate(state: InternalState, keyCode: number, skipItems?: number): void;
162
162
  private onPopupOpened;
163
163
  private componentRef;
164
+ private getCurrentValueDisabledStatus;
164
165
  private toggleBtnClick;
165
166
  private applyValueOnEnter;
166
167
  private applyValueOnRejectSuggestions;
@@ -97,7 +97,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
97
97
  _this.toggleBtnClick = function (event) {
98
98
  var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, skipDisabledItems = _a.skipDisabledItems, textField = _a.textField;
99
99
  var focusedIndex = _this.getFocusedIndex();
100
- var isCurrentValueDisabled = textField && data[focusedIndex].disabled;
100
+ var isCurrentValueDisabled = _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);
101
101
  var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
102
102
  var state = _this.base.initState();
103
103
  state.syntheticEvent = event;
@@ -164,10 +164,10 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
164
164
  _this.handleBlur = function (event) {
165
165
  if (_this.state.focused && !_this._skipBlur) {
166
166
  var state = _this.base.initState();
167
- var _a = _this.props, textField = _a.textField, data = _a.data;
167
+ var _a = _this.props, textField = _a.textField, _b = _a.data, data = _b === void 0 ? [] : _b;
168
168
  var focusedIndex = _this.getFocusedIndex();
169
169
  var isCustomValue = focusedIndex === -1;
170
- var isCurrentValueDisabled = textField && !isCustomValue && data && data[focusedIndex].disabled;
170
+ var isCurrentValueDisabled = !isCustomValue && _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);
171
171
  state.data.focused = false;
172
172
  state.events.push({ type: 'onBlur' });
173
173
  state.syntheticEvent = event;
@@ -264,7 +264,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
264
264
  };
265
265
  var focusedIndex = _this.getFocusedIndex();
266
266
  var isCustomValue = focusedIndex === -1;
267
- var isCurrentValueDisabled = textField && !isCustomValue && data[focusedIndex].disabled;
267
+ var isCurrentValueDisabled = !isCustomValue && _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);
268
268
  if (opened) {
269
269
  if (event.altKey && keyCode === Keys.up) {
270
270
  togglePopup();
@@ -607,6 +607,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
607
607
  }
608
608
  };
609
609
  ;
610
+ ComboBoxWithoutContext.prototype.getCurrentValueDisabledStatus = function (textField, data, focusedIndex) {
611
+ return textField && data && data[focusedIndex] && data[focusedIndex].disabled;
612
+ };
610
613
  ComboBoxWithoutContext.prototype.applyValueOnEnter = function (value, state) {
611
614
  var _a;
612
615
  var _b = this.props, _c = _b.data, data = _c === void 0 ? [] : _c, textField = _b.textField, allowCustom = _b.allowCustom;
@@ -198,6 +198,7 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
198
198
  private applyState;
199
199
  private calculateMedia;
200
200
  private resetValueIfDisabledItem;
201
+ private haveFocusedItemAndDataNotEmpty;
201
202
  }
202
203
  /**
203
204
  * Represents the PropsContext of the `DropDownList` component.
@@ -263,7 +263,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
263
263
  }
264
264
  else if (opened && keyCode === Keys.enter) {
265
265
  var focusedIndex = _this.getFocusedIndex();
266
- if (focusedIndex !== undefined && focusedIndex !== -1 && data[focusedIndex].disabled) {
266
+ if (_this.haveFocusedItemAndDataNotEmpty(data, focusedIndex)) {
267
267
  _this.triggerOnChange(null, state);
268
268
  _this.applyState(state);
269
269
  }
@@ -818,14 +818,17 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
818
818
  };
819
819
  ;
820
820
  DropDownListWithoutContext.prototype.resetValueIfDisabledItem = function () {
821
- var data = this.props.data;
821
+ var _a = this.props.data, data = _a === void 0 ? [] : _a;
822
822
  var state = this.base.initState();
823
823
  var focusedIndex = this.getFocusedIndex();
824
- if (focusedIndex !== undefined && focusedIndex !== -1 && data && data[focusedIndex].disabled) {
824
+ if (this.haveFocusedItemAndDataNotEmpty(data, focusedIndex)) {
825
825
  this.triggerOnChange(null, state);
826
826
  this.applyState(state);
827
827
  }
828
828
  };
829
+ DropDownListWithoutContext.prototype.haveFocusedItemAndDataNotEmpty = function (data, focusedIndex) {
830
+ return focusedIndex !== undefined && focusedIndex !== -1 && data && data.length > 0 && data[focusedIndex].disabled;
831
+ };
829
832
  DropDownListWithoutContext.displayName = 'DropDownList';
830
833
  /**
831
834
  * @hidden
@@ -297,7 +297,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
297
297
  if (_this.props.allowCustom && text && focusedItem === null) {
298
298
  _this.customItemSelect(event);
299
299
  }
300
- else if (focusedItem.disabled) {
300
+ else if (focusedItem && focusedItem.disabled) {
301
301
  togglePopup();
302
302
  }
303
303
  else {
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-dropdowns',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1693075619,
8
+ publishDate: 1693299703,
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
  };
@@ -203,7 +203,7 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
203
203
  };
204
204
  if (keyCode === kendo_react_common_1.Keys.enter || keyCode === kendo_react_common_1.Keys.esc) {
205
205
  preventDefault();
206
- if (skipDisabledItems === false && focusedItem.disabled) {
206
+ if (skipDisabledItems === false && focusedItem && focusedItem.disabled) {
207
207
  if (opened) {
208
208
  _this.togglePopup(state);
209
209
  }
@@ -484,7 +484,7 @@ var AutoCompleteWithoutContext = /** @class */ (function (_super) {
484
484
  var focusedItem = data[focusedIndex];
485
485
  this._suggested = '';
486
486
  if (opened && eventKey === kendo_react_common_1.Keys.enter) {
487
- if (!focusedItem.disabled) {
487
+ if (focusedItem && !focusedItem.disabled) {
488
488
  var newValue = (0, utils_1.getItemValue)(data[this.focusedIndex(value)], textField);
489
489
  this.triggerOnChange(newValue, state);
490
490
  }
@@ -161,6 +161,7 @@ export declare class ComboBoxWithoutContext extends React.Component<ComboBoxProp
161
161
  onNavigate(state: InternalState, keyCode: number, skipItems?: number): void;
162
162
  private onPopupOpened;
163
163
  private componentRef;
164
+ private getCurrentValueDisabledStatus;
164
165
  private toggleBtnClick;
165
166
  private applyValueOnEnter;
166
167
  private applyValueOnRejectSuggestions;
@@ -100,7 +100,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
100
100
  _this.toggleBtnClick = function (event) {
101
101
  var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, skipDisabledItems = _a.skipDisabledItems, textField = _a.textField;
102
102
  var focusedIndex = _this.getFocusedIndex();
103
- var isCurrentValueDisabled = textField && data[focusedIndex].disabled;
103
+ var isCurrentValueDisabled = _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);
104
104
  var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
105
105
  var state = _this.base.initState();
106
106
  state.syntheticEvent = event;
@@ -167,10 +167,10 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
167
167
  _this.handleBlur = function (event) {
168
168
  if (_this.state.focused && !_this._skipBlur) {
169
169
  var state = _this.base.initState();
170
- var _a = _this.props, textField = _a.textField, data = _a.data;
170
+ var _a = _this.props, textField = _a.textField, _b = _a.data, data = _b === void 0 ? [] : _b;
171
171
  var focusedIndex = _this.getFocusedIndex();
172
172
  var isCustomValue = focusedIndex === -1;
173
- var isCurrentValueDisabled = textField && !isCustomValue && data && data[focusedIndex].disabled;
173
+ var isCurrentValueDisabled = !isCustomValue && _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);
174
174
  state.data.focused = false;
175
175
  state.events.push({ type: 'onBlur' });
176
176
  state.syntheticEvent = event;
@@ -267,7 +267,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
267
267
  };
268
268
  var focusedIndex = _this.getFocusedIndex();
269
269
  var isCustomValue = focusedIndex === -1;
270
- var isCurrentValueDisabled = textField && !isCustomValue && data[focusedIndex].disabled;
270
+ var isCurrentValueDisabled = !isCustomValue && _this.getCurrentValueDisabledStatus(textField, data, focusedIndex);
271
271
  if (opened) {
272
272
  if (event.altKey && keyCode === kendo_react_common_1.Keys.up) {
273
273
  togglePopup();
@@ -610,6 +610,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
610
610
  }
611
611
  };
612
612
  ;
613
+ ComboBoxWithoutContext.prototype.getCurrentValueDisabledStatus = function (textField, data, focusedIndex) {
614
+ return textField && data && data[focusedIndex] && data[focusedIndex].disabled;
615
+ };
613
616
  ComboBoxWithoutContext.prototype.applyValueOnEnter = function (value, state) {
614
617
  var _a;
615
618
  var _b = this.props, _c = _b.data, data = _c === void 0 ? [] : _c, textField = _b.textField, allowCustom = _b.allowCustom;
@@ -198,6 +198,7 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
198
198
  private applyState;
199
199
  private calculateMedia;
200
200
  private resetValueIfDisabledItem;
201
+ private haveFocusedItemAndDataNotEmpty;
201
202
  }
202
203
  /**
203
204
  * Represents the PropsContext of the `DropDownList` component.
@@ -266,7 +266,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
266
266
  }
267
267
  else if (opened && keyCode === kendo_react_common_1.Keys.enter) {
268
268
  var focusedIndex = _this.getFocusedIndex();
269
- if (focusedIndex !== undefined && focusedIndex !== -1 && data[focusedIndex].disabled) {
269
+ if (_this.haveFocusedItemAndDataNotEmpty(data, focusedIndex)) {
270
270
  _this.triggerOnChange(null, state);
271
271
  _this.applyState(state);
272
272
  }
@@ -821,14 +821,17 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
821
821
  };
822
822
  ;
823
823
  DropDownListWithoutContext.prototype.resetValueIfDisabledItem = function () {
824
- var data = this.props.data;
824
+ var _a = this.props.data, data = _a === void 0 ? [] : _a;
825
825
  var state = this.base.initState();
826
826
  var focusedIndex = this.getFocusedIndex();
827
- if (focusedIndex !== undefined && focusedIndex !== -1 && data && data[focusedIndex].disabled) {
827
+ if (this.haveFocusedItemAndDataNotEmpty(data, focusedIndex)) {
828
828
  this.triggerOnChange(null, state);
829
829
  this.applyState(state);
830
830
  }
831
831
  };
832
+ DropDownListWithoutContext.prototype.haveFocusedItemAndDataNotEmpty = function (data, focusedIndex) {
833
+ return focusedIndex !== undefined && focusedIndex !== -1 && data && data.length > 0 && data[focusedIndex].disabled;
834
+ };
832
835
  DropDownListWithoutContext.displayName = 'DropDownList';
833
836
  /**
834
837
  * @hidden
@@ -300,7 +300,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
300
300
  if (_this.props.allowCustom && text && focusedItem === null) {
301
301
  _this.customItemSelect(event);
302
302
  }
303
- else if (focusedItem.disabled) {
303
+ else if (focusedItem && focusedItem.disabled) {
304
304
  togglePopup();
305
305
  }
306
306
  else {
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-dropdowns',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1693075619,
11
+ publishDate: 1693299703,
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
  };