@progress/kendo-react-inputs 6.1.0-dev.202310310855 → 6.1.0-dev.202311021038

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.
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-inputs',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1698739657,
8
+ publishDate: 1698919709,
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
  };
@@ -123,6 +123,10 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
123
123
  * Sets the value of the Switch. It can either be of the primitive (string, number, boolean) or of the complex (array) type.
124
124
  */
125
125
  value?: string | number | string[] | boolean | null;
126
+ /**
127
+ * The accessible label of the component.
128
+ */
129
+ ariaLabel?: string;
126
130
  }
127
131
  /**
128
132
  * @hidden
@@ -139,9 +143,6 @@ export declare class SwitchWithoutContext extends React.Component<SwitchProps, S
139
143
  */
140
144
  get value(): boolean;
141
145
  get element(): HTMLSpanElement | null;
142
- /**
143
- * @hidden
144
- */
145
146
  get actionElement(): HTMLSpanElement | null;
146
147
  /**
147
148
  * Gets the `name` property of the Switch.
@@ -257,6 +258,10 @@ export declare const SwitchPropsContext: React.Context<(p: SwitchProps) => Switc
257
258
  * Represent the `ref` of the Switch component.
258
259
  */
259
260
  export interface SwitchHandle extends Pick<SwitchWithoutContext, keyof SwitchWithoutContext> {
261
+ /**
262
+ * @hidden
263
+ */
264
+ actionElement: HTMLSpanElement | null;
260
265
  /**
261
266
  * Returns the HTML element of the Switch component.
262
267
  */
@@ -76,15 +76,15 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
76
76
  * @hidden
77
77
  */
78
78
  _this.focus = function () {
79
- if (_this._element) {
80
- _this._element.focus();
79
+ if (_this.actionElement) {
80
+ _this.actionElement.focus();
81
81
  }
82
82
  };
83
83
  _this.dummyInput = function (value) {
84
84
  /* Dummy component to support forms */
85
85
  return (React.createElement("input", { type: "checkbox", checked: _this.props.checked, ref: function (el) {
86
86
  _this._input = el;
87
- }, tabIndex: -1, "aria-hidden": true, value: value, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' }, onChange: noop }));
87
+ }, tabIndex: -1, "aria-hidden": true, value: value, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' }, onChange: noop, name: _this.name || undefined }));
88
88
  };
89
89
  _this.handleClick = function (event) {
90
90
  if (_this.eventTimeStamp === event.timeStamp) {
@@ -153,9 +153,6 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
153
153
  configurable: true
154
154
  });
155
155
  Object.defineProperty(SwitchWithoutContext.prototype, "actionElement", {
156
- /**
157
- * @hidden
158
- */
159
156
  get: function () {
160
157
  return this._wrapper;
161
158
  },
@@ -238,8 +235,8 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
238
235
  var _a, _b, _c;
239
236
  var _this = this;
240
237
  var focused = this.state.focused;
241
- var _d = this.props, dir = _d.dir, disabled = _d.disabled, trackRounded = _d.trackRounded, thumbRounded = _d.thumbRounded, size = _d.size, id = _d.id, offLabel = _d.offLabel, onLabel = _d.onLabel, tabIndex = _d.tabIndex;
242
- this.dir = dir || (this._wrapper && getComputedStyle(this._wrapper).direction) || undefined;
238
+ var _d = this.props, dir = _d.dir, disabled = _d.disabled, trackRounded = _d.trackRounded, thumbRounded = _d.thumbRounded, size = _d.size, offLabel = _d.offLabel, onLabel = _d.onLabel, tabIndex = _d.tabIndex;
239
+ this.dir = dir || (this.element && getComputedStyle(this.element).direction) || undefined;
243
240
  var isValid = !this.validityStyles || this.validity.valid;
244
241
  var switchClassName = classNames('k-switch', (_a = {},
245
242
  _a["k-switch-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
@@ -254,23 +251,20 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
254
251
  'aria-checked': this.value,
255
252
  'aria-disabled': disabled || undefined,
256
253
  'aria-labelledby': this.props.ariaLabelledBy,
257
- 'aria-describedby': this.props.ariaDescribedBy
254
+ 'aria-describedby': this.props.ariaDescribedBy,
255
+ 'aria-label': this.props.ariaLabel
258
256
  };
259
257
  return (React.createElement("span", __assign({ ref: function (span) {
260
258
  _this._wrapper = span;
261
- }, role: 'switch' }, ariaAttributes, { className: switchClassName, dir: this.dir, onKeyDown: this.handleKeyDown, onClick: this.handleClick, onBlur: this.handleWrapperBlur, onFocus: this.handleWrapperFocus }),
262
- React.createElement("span", { className: classNames('k-switch-track', (_b = {},
263
- _b["k-rounded-".concat(kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
264
- _b)), id: id || this._id, ref: function (span) {
259
+ }, role: 'switch' }, ariaAttributes, { className: switchClassName, dir: this.dir, onKeyDown: this.handleKeyDown, onClick: this.handleClick, onBlur: this.handleWrapperBlur, onFocus: this.handleWrapperFocus, tabIndex: getTabIndex(tabIndex, disabled, undefined), accessKey: this.props.accessKey, id: this.props.id || this._id }),
260
+ React.createElement("span", { className: classNames('k-switch-track', (_b = {}, _b["k-rounded-".concat(kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded, _b)), ref: function (span) {
265
261
  _this._element = span;
266
- }, tabIndex: getTabIndex(tabIndex, disabled, undefined), accessKey: this.props.accessKey },
262
+ } },
267
263
  this.dummyInput(this.value),
268
264
  React.createElement("span", { className: 'k-switch-label-on' }, onLabel),
269
265
  React.createElement("span", { className: 'k-switch-label-off' }, offLabel)),
270
266
  React.createElement("span", { className: 'k-switch-thumb-wrap' },
271
- React.createElement("span", { className: classNames('k-switch-thumb', (_c = {},
272
- _c["k-rounded-".concat(thumbRounded)] = thumbRounded,
273
- _c)) }))));
267
+ React.createElement("span", { className: classNames('k-switch-thumb', (_c = {}, _c["k-rounded-".concat(thumbRounded)] = thumbRounded, _c)) }))));
274
268
  };
275
269
  SwitchWithoutContext.displayName = 'Switch';
276
270
  /**
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-inputs',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1698739657,
11
+ publishDate: 1698919709,
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
  };
@@ -123,6 +123,10 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
123
123
  * Sets the value of the Switch. It can either be of the primitive (string, number, boolean) or of the complex (array) type.
124
124
  */
125
125
  value?: string | number | string[] | boolean | null;
126
+ /**
127
+ * The accessible label of the component.
128
+ */
129
+ ariaLabel?: string;
126
130
  }
127
131
  /**
128
132
  * @hidden
@@ -139,9 +143,6 @@ export declare class SwitchWithoutContext extends React.Component<SwitchProps, S
139
143
  */
140
144
  get value(): boolean;
141
145
  get element(): HTMLSpanElement | null;
142
- /**
143
- * @hidden
144
- */
145
146
  get actionElement(): HTMLSpanElement | null;
146
147
  /**
147
148
  * Gets the `name` property of the Switch.
@@ -257,6 +258,10 @@ export declare const SwitchPropsContext: React.Context<(p: SwitchProps) => Switc
257
258
  * Represent the `ref` of the Switch component.
258
259
  */
259
260
  export interface SwitchHandle extends Pick<SwitchWithoutContext, keyof SwitchWithoutContext> {
261
+ /**
262
+ * @hidden
263
+ */
264
+ actionElement: HTMLSpanElement | null;
260
265
  /**
261
266
  * Returns the HTML element of the Switch component.
262
267
  */
@@ -79,15 +79,15 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
79
79
  * @hidden
80
80
  */
81
81
  _this.focus = function () {
82
- if (_this._element) {
83
- _this._element.focus();
82
+ if (_this.actionElement) {
83
+ _this.actionElement.focus();
84
84
  }
85
85
  };
86
86
  _this.dummyInput = function (value) {
87
87
  /* Dummy component to support forms */
88
88
  return (React.createElement("input", { type: "checkbox", checked: _this.props.checked, ref: function (el) {
89
89
  _this._input = el;
90
- }, tabIndex: -1, "aria-hidden": true, value: value, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' }, onChange: kendo_react_common_1.noop }));
90
+ }, tabIndex: -1, "aria-hidden": true, value: value, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' }, onChange: kendo_react_common_1.noop, name: _this.name || undefined }));
91
91
  };
92
92
  _this.handleClick = function (event) {
93
93
  if (_this.eventTimeStamp === event.timeStamp) {
@@ -156,9 +156,6 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
156
156
  configurable: true
157
157
  });
158
158
  Object.defineProperty(SwitchWithoutContext.prototype, "actionElement", {
159
- /**
160
- * @hidden
161
- */
162
159
  get: function () {
163
160
  return this._wrapper;
164
161
  },
@@ -241,8 +238,8 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
241
238
  var _a, _b, _c;
242
239
  var _this = this;
243
240
  var focused = this.state.focused;
244
- var _d = this.props, dir = _d.dir, disabled = _d.disabled, trackRounded = _d.trackRounded, thumbRounded = _d.thumbRounded, size = _d.size, id = _d.id, offLabel = _d.offLabel, onLabel = _d.onLabel, tabIndex = _d.tabIndex;
245
- this.dir = dir || (this._wrapper && getComputedStyle(this._wrapper).direction) || undefined;
241
+ var _d = this.props, dir = _d.dir, disabled = _d.disabled, trackRounded = _d.trackRounded, thumbRounded = _d.thumbRounded, size = _d.size, offLabel = _d.offLabel, onLabel = _d.onLabel, tabIndex = _d.tabIndex;
242
+ this.dir = dir || (this.element && getComputedStyle(this.element).direction) || undefined;
246
243
  var isValid = !this.validityStyles || this.validity.valid;
247
244
  var switchClassName = (0, kendo_react_common_1.classNames)('k-switch', (_a = {},
248
245
  _a["k-switch-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
@@ -257,23 +254,20 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
257
254
  'aria-checked': this.value,
258
255
  'aria-disabled': disabled || undefined,
259
256
  'aria-labelledby': this.props.ariaLabelledBy,
260
- 'aria-describedby': this.props.ariaDescribedBy
257
+ 'aria-describedby': this.props.ariaDescribedBy,
258
+ 'aria-label': this.props.ariaLabel
261
259
  };
262
260
  return (React.createElement("span", __assign({ ref: function (span) {
263
261
  _this._wrapper = span;
264
- }, role: 'switch' }, ariaAttributes, { className: switchClassName, dir: this.dir, onKeyDown: this.handleKeyDown, onClick: this.handleClick, onBlur: this.handleWrapperBlur, onFocus: this.handleWrapperFocus }),
265
- React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-switch-track', (_b = {},
266
- _b["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
267
- _b)), id: id || this._id, ref: function (span) {
262
+ }, role: 'switch' }, ariaAttributes, { className: switchClassName, dir: this.dir, onKeyDown: this.handleKeyDown, onClick: this.handleClick, onBlur: this.handleWrapperBlur, onFocus: this.handleWrapperFocus, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled, undefined), accessKey: this.props.accessKey, id: this.props.id || this._id }),
263
+ React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-switch-track', (_b = {}, _b["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded, _b)), ref: function (span) {
268
264
  _this._element = span;
269
- }, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled, undefined), accessKey: this.props.accessKey },
265
+ } },
270
266
  this.dummyInput(this.value),
271
267
  React.createElement("span", { className: 'k-switch-label-on' }, onLabel),
272
268
  React.createElement("span", { className: 'k-switch-label-off' }, offLabel)),
273
269
  React.createElement("span", { className: 'k-switch-thumb-wrap' },
274
- React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-switch-thumb', (_c = {},
275
- _c["k-rounded-".concat(thumbRounded)] = thumbRounded,
276
- _c)) }))));
270
+ React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-switch-thumb', (_c = {}, _c["k-rounded-".concat(thumbRounded)] = thumbRounded, _c)) }))));
277
271
  };
278
272
  SwitchWithoutContext.displayName = 'Switch';
279
273
  /**