@progress/kendo-react-inputs 5.10.0-dev.202301091032 → 5.10.0-dev.202301111405

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.
@@ -16,6 +16,7 @@ var React = require("react");
16
16
  var PropTypes = require("prop-types");
17
17
  var kendo_react_intl_1 = require("@progress/kendo-react-intl");
18
18
  var kendo_react_common_1 = require("@progress/kendo-react-common");
19
+ var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
19
20
  var kendo_react_labels_1 = require("@progress/kendo-react-labels");
20
21
  var kendo_react_common_2 = require("@progress/kendo-react-common");
21
22
  var package_metadata_1 = require("../package-metadata");
@@ -281,8 +282,8 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
281
282
  props.children,
282
283
  props.spinners &&
283
284
  (React.createElement("span", { className: "k-input-spinner k-spin-button", onMouseDown: onMouseDown },
284
- React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", icon: 'caret-alt-up', rounded: null, className: "k-spinner-increase", "aria-label": localizationService.toLanguageString(messages_1.numericIncreaseValue, messages_1.messages[messages_1.numericIncreaseValue]), title: localizationService.toLanguageString(messages_1.numericIncreaseValue, messages_1.messages[messages_1.numericIncreaseValue]), onClick: onIncrease }),
285
- React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", icon: 'caret-alt-down', rounded: null, className: "k-spinner-decrease", "aria-label": localizationService.toLanguageString(messages_1.numericDecreaseValue, messages_1.messages[messages_1.numericDecreaseValue]), title: localizationService.toLanguageString(messages_1.numericDecreaseValue, messages_1.messages[messages_1.numericDecreaseValue]), onClick: onDecrease })))));
285
+ React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", icon: 'caret-alt-up', svgIcon: kendo_svg_icons_1.caretAltUpIcon, rounded: null, className: "k-spinner-increase", "aria-label": localizationService.toLanguageString(messages_1.numericIncreaseValue, messages_1.messages[messages_1.numericIncreaseValue]), title: localizationService.toLanguageString(messages_1.numericIncreaseValue, messages_1.messages[messages_1.numericIncreaseValue]), onClick: onIncrease }),
286
+ React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", icon: 'caret-alt-down', svgIcon: kendo_svg_icons_1.caretAltDownIcon, rounded: null, className: "k-spinner-decrease", "aria-label": localizationService.toLanguageString(messages_1.numericDecreaseValue, messages_1.messages[messages_1.numericDecreaseValue]), title: localizationService.toLanguageString(messages_1.numericDecreaseValue, messages_1.messages[messages_1.numericDecreaseValue]), onClick: onDecrease })))));
286
287
  return props.label
287
288
  ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: props.label, editorId: inputId, editorValue: looseValue === null ? '' : looseValue, editorValid: isValid, editorDisabled: props.disabled, editorPlaceholder: props.placeholder, children: numerictextbox, style: { width: props.width }, dir: props.dir }))
288
289
  : numerictextbox;
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-inputs',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1673259165,
11
+ publishDate: 1673444752,
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
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FormComponentProps } from '@progress/kendo-react-common';
2
+ import { FormComponentProps, SVGIcon } from '@progress/kendo-react-common';
3
3
  import { RatingItemProps } from './RatingItem';
4
4
  import { RatingKeyboardEvent, RatingItemMouseEvent, RatingItemFocusEvent } from './models';
5
5
  /**
@@ -70,6 +70,14 @@ export interface RatingProps extends FormComponentProps {
70
70
  * Sets custom Rating icon, by default - star. [See example]({% slug disabled_rating %})
71
71
  */
72
72
  icon?: string;
73
+ /**
74
+ * Sets custom Rating SVG icon.
75
+ */
76
+ svgIcon?: SVGIcon;
77
+ /**
78
+ * Sets custom Rating SVG icon.
79
+ */
80
+ svgIconOutline?: SVGIcon;
73
81
  /**
74
82
  * Determines the selection mode. By default set to `continues`. [See example]({% slug icon_rating %})
75
83
  */
@@ -15,6 +15,7 @@ exports.Rating = exports.RatingPropsContext = void 0;
15
15
  var React = require("react");
16
16
  var PropTypes = require("prop-types");
17
17
  var kendo_react_common_1 = require("@progress/kendo-react-common");
18
+ var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
18
19
  var RatingItem_1 = require("./RatingItem");
19
20
  var rating_reducer_1 = require("./rating-reducer");
20
21
  var utils_1 = require("./utils");
@@ -48,7 +49,7 @@ exports.RatingPropsContext = (0, kendo_react_common_1.createPropsContext)();
48
49
  * Obtaining the `ref` returns an object of type [RatingHandle]({% slug api_inputs_ratinghandle %}).
49
50
  */
50
51
  exports.Rating = React.forwardRef(function (directProps, ref) {
51
- var _a, _b, _c, _d;
52
+ var _a;
52
53
  var props = (0, kendo_react_common_1.usePropsContext)(exports.RatingPropsContext, directProps);
53
54
  var localization = (0, kendo_react_intl_1.useLocalization)();
54
55
  var target = React.useRef(null);
@@ -75,19 +76,19 @@ exports.Rating = React.forwardRef(function (directProps, ref) {
75
76
  var readonly = React.useMemo(function () { return props.readonly || defaultProps.readonly; }, [props.readonly]);
76
77
  var disabled = React.useMemo(function () { return props.disabled || defaultProps.disabled; }, [props.disabled]);
77
78
  var Item = React.useMemo(function () { return props.item || defaultProps.item; }, [props.item]);
78
- var _e = useRating(props.defaultValue || defaultProps.defaultValue, {
79
+ var _b = useRating(props.defaultValue || defaultProps.defaultValue, {
79
80
  state: props.value,
80
81
  min: min,
81
82
  max: max,
82
83
  step: precision === 'half' ? step / 2 : step
83
- }, handleChange), stateValue = _e[0], dispatchStateValue = _e[1];
84
- var _f = useRating(null, {
84
+ }, handleChange), stateValue = _b[0], dispatchStateValue = _b[1];
85
+ var _c = useRating(null, {
85
86
  state: props.value,
86
87
  min: min,
87
88
  max: max,
88
89
  step: precision === 'half' ? step / 2 : step,
89
90
  precision: precision
90
- }), stateHover = _f[0], dispatchStateHover = _f[1];
91
+ }), stateHover = _c[0], dispatchStateHover = _c[1];
91
92
  var value = React.useMemo(function () { return props.value || stateValue; }, [props.value, stateValue]);
92
93
  var hoveredValue = React.useMemo(function () { return stateHover; }, [stateHover]);
93
94
  var selection = React.useMemo(function () { return props.selection || defaultProps.selection; }, [props.selection]);
@@ -205,27 +206,19 @@ exports.Rating = React.forwardRef(function (directProps, ref) {
205
206
  var selectedValue = (0, utils_1.isSelected)(itemValue, value, step, selection);
206
207
  var selected = (0, utils_1.isSelected)(itemValue, hoveredValue !== null ? hoveredValue : value, step, selection);
207
208
  var hovered = (0, utils_1.isSelected)(itemValue, hoveredValue, step, selection);
208
- items.push(React.createElement(Item, { key: itemValue, value: itemValue, dir: dir, title: String(half ? (0, utils_1.toRound)(itemValue - (step / 2), base) : itemValue), icon: props.icon, half: half, selected: selectedValue || selected, hovered: hovered, onClick: handleItemClick, onMouseMove: handleItemMouseMove, onMouseLeave: handleMouseLeave },
209
+ items.push(React.createElement(Item, { key: itemValue, value: itemValue, dir: dir, title: String(half ? (0, utils_1.toRound)(itemValue - (step / 2), base) : itemValue), icon: props.icon, svgIcon: props.svgIcon, half: half, selected: selectedValue || selected, hovered: hovered, onClick: handleItemClick, onMouseMove: handleItemMouseMove, onMouseLeave: handleMouseLeave },
209
210
  half && (React.createElement("span", { className: 'k-rating-precision-complement', style: (_a = { width: '12px' }, _a[dir === 'rtl' ? 'right' : 'left'] = '50%', _a) },
210
- React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-icon', (_b = {
211
- 'k-i-star-outline': !props.icon
212
- },
213
- _b["".concat(props.icon, "-outline")] = props.icon,
214
- _b)) }))),
211
+ !(props.icon || props.svgIconOutline) && React.createElement(kendo_react_common_1.IconWrap, { name: 'star-outline', icon: kendo_svg_icons_1.starOutlineIcon }),
212
+ (props.icon || props.svgIconOutline) && React.createElement(kendo_react_common_1.IconWrap, { name: (0, kendo_react_common_1.toIconName)("".concat(props.icon, "-outline")), icon: props.svgIconOutline }))),
215
213
  half && (React.createElement("span", { className: 'k-rating-precision-part', style: { width: '12px' } },
216
- React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-icon', (_c = {
217
- 'k-i-star': !props.icon
218
- },
219
- _c["".concat(props.icon)] = props.icon,
220
- _c)) }))),
214
+ !(props.icon || props.svgIcon) && React.createElement(kendo_react_common_1.IconWrap, { name: 'star', icon: kendo_svg_icons_1.starIcon }),
215
+ (props.icon || props.svgIcon) && React.createElement(kendo_react_common_1.IconWrap, { name: props.icon ? (0, kendo_react_common_1.toIconName)(props.icon) : undefined, icon: props.svgIcon }))),
221
216
  half && (React.createElement("span", { style: { width: '24px', height: '24px', display: 'block' } })),
222
- !half && (React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-icon', (_d = {
223
- 'k-i-star': !props.icon && (hovered || (selected && !hovered)),
224
- 'k-i-star-outline': !props.icon && (!hovered)
225
- },
226
- _d["".concat(props.icon)] = props.icon && (hovered || (selected && !hovered)),
227
- _d["".concat(props.icon, "-outline")] = props.icon && (!hovered),
228
- _d)) }))));
217
+ !half &&
218
+ (!(props.icon || props.svgIcon) && (hovered || (selected && !hovered)) && React.createElement(kendo_react_common_1.IconWrap, { name: 'star', icon: kendo_svg_icons_1.starIcon })) ||
219
+ (!(props.icon || props.svgIcon) && !hovered && React.createElement(kendo_react_common_1.IconWrap, { name: 'star-outline', icon: kendo_svg_icons_1.starOutlineIcon })) ||
220
+ ((props.icon || props.svgIcon) && (hovered || (selected && !hovered)) && React.createElement(kendo_react_common_1.IconWrap, { name: props.icon, icon: props.svgIcon })) ||
221
+ ((props.icon || props.svgIcon) && !hovered && React.createElement(kendo_react_common_1.IconWrap, { name: (0, kendo_react_common_1.toIconName)("".concat(props.icon, "-outline")), icon: props.svgIconOutline }))));
229
222
  }
230
223
  return (React.createElement("span", { id: props.id, style: props.style, ref: ratingRef, role: "slider", dir: dir, tabIndex: (0, kendo_react_common_1.getTabIndex)(props.tabIndex, props.disabled, undefined), className: (0, kendo_react_common_1.classNames)('k-rating k-widget', {
231
224
  'k-rtl': dir === 'rtl',
@@ -268,6 +261,8 @@ var propTypes = {
268
261
  disabled: PropTypes.bool,
269
262
  half: PropTypes.bool,
270
263
  icon: PropTypes.string,
264
+ svgIcon: kendo_react_common_1.svgIconPropType,
265
+ svgIconOutline: kendo_react_common_1.svgIconPropType,
271
266
  ariaDescribedBy: PropTypes.string
272
267
  };
273
268
  var defaultProps = {
@@ -59,6 +59,7 @@ var React = require("react");
59
59
  var messages_1 = require("../messages");
60
60
  var package_metadata_1 = require("../package-metadata");
61
61
  var utils_1 = require("./utils");
62
+ var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
62
63
  var DEFAULT_WIDTH = 250;
63
64
  var DEFAULT_HEIGHT = 84;
64
65
  var DEFAULT_POPUP_SCALE = 3;
@@ -338,10 +339,10 @@ exports.Signature = React.forwardRef(function (directProps, target) {
338
339
  _a), props.className), onFocus: onFocus, onBlur: onBlur },
339
340
  React.createElement("div", { className: 'k-signature-canvas', ref: canvasRef, tabIndex: (0, kendo_react_common_1.getTabIndex)(props.tabIndex, props.disabled), role: "img", id: props.id, "aria-label": props.ariaLabel, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, "aria-disabled": props.disabled ? 'true' : undefined }),
340
341
  React.createElement("div", { className: 'k-signature-actions k-signature-actions-top' },
341
- showMaximize && (React.createElement(kendo_react_buttons_1.Button, { className: 'k-signature-action k-signature-maximize', ref: maximizeButtonRef, icon: 'hyperlink-open', shape: null, fillMode: 'flat', size: props.size, onClick: onMaximizeClick, "aria-label": maximizeTitle, title: maximizeTitle })),
342
- showMinimize && (React.createElement(kendo_react_buttons_1.Button, { className: 'k-signature-action k-signature-minimize k-rotate-180', ref: minimizeButtonRef, icon: 'hyperlink-open', shape: null, fillMode: 'flat', size: props.size, onClick: onMinimizeClick, "aria-label": minimizeTitle, title: minimizeTitle }))),
342
+ showMaximize && (React.createElement(kendo_react_buttons_1.Button, { className: 'k-signature-action k-signature-maximize', ref: maximizeButtonRef, icon: 'hyperlink-open', svgIcon: kendo_svg_icons_1.hyperlinkOpenIcon, fillMode: 'flat', size: props.size, onClick: onMaximizeClick, "aria-label": maximizeTitle, title: maximizeTitle })),
343
+ showMinimize && (React.createElement(kendo_react_buttons_1.Button, { className: 'k-signature-action k-signature-minimize k-rotate-180', ref: minimizeButtonRef, icon: 'hyperlink-open', svgIcon: kendo_svg_icons_1.hyperlinkOpenIcon, fillMode: 'flat', size: props.size, onClick: onMinimizeClick, "aria-label": minimizeTitle, title: minimizeTitle }))),
343
344
  !props.hideLine && (React.createElement("div", { className: 'k-signature-line', style: { zIndex: 2, pointerEvents: 'none' } })),
344
- React.createElement("div", { className: 'k-signature-actions k-signature-actions-bottom' }, showClear && (React.createElement(kendo_react_buttons_1.Button, { className: 'k-signature-action k-signature-clear', icon: 'close', shape: null, fillMode: 'flat', size: props.size, onClick: onClear, "aria-label": clearTitle, title: clearTitle }))),
345
+ React.createElement("div", { className: 'k-signature-actions k-signature-actions-bottom' }, showClear && (React.createElement(kendo_react_buttons_1.Button, { className: 'k-signature-action k-signature-clear', icon: 'x', svgIcon: kendo_svg_icons_1.xIcon, fillMode: 'flat', size: props.size, onClick: onClear, "aria-label": clearTitle, title: clearTitle }))),
345
346
  open && (React.createElement(kendo_react_dialogs_1.Dialog, { ref: dialogRef },
346
347
  React.createElement(exports.Signature, __assign({}, props, popupSize(), { value: popupValue, maximized: true, exportScale: (1 / popupScale) * exportScale, open: false, onChange: onDialogChange, onClose: onDialogClose }))))));
347
348
  });
@@ -36,6 +36,7 @@ var SliderLabel_1 = require("./SliderLabel");
36
36
  var kendo_react_common_2 = require("@progress/kendo-react-common");
37
37
  var package_metadata_1 = require("../package-metadata");
38
38
  var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
39
+ var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
39
40
  /** @hidden */
40
41
  var SliderWithoutContext = /** @class */ (function (_super) {
41
42
  __extends(SliderWithoutContext, _super);
@@ -59,9 +60,9 @@ var SliderWithoutContext = /** @class */ (function (_super) {
59
60
  return props.children;
60
61
  }
61
62
  return (React.createElement(React.Fragment, null,
62
- React.createElement(kendo_react_buttons_1.Button, { className: "k-button-decrease", rounded: 'full', icon: _this.props.vertical ? 'caret-alt-down' : 'caret-alt-left', title: props.decrementTitle, onClick: props.decrement }),
63
+ React.createElement(kendo_react_buttons_1.Button, { className: "k-button-decrease", rounded: 'full', icon: _this.props.vertical ? 'caret-alt-down' : 'caret-alt-left', svgIcon: _this.props.vertical ? kendo_svg_icons_1.caretAltDownIcon : kendo_svg_icons_1.caretAltLeftIcon, title: props.decrementTitle, onClick: props.decrement }),
63
64
  props.children,
64
- React.createElement(kendo_react_buttons_1.Button, { className: "k-button-increase", rounded: 'full', icon: _this.props.vertical ? 'caret-alt-up' : 'caret-alt-right', title: props.incrementTitle, onClick: props.increment })));
65
+ React.createElement(kendo_react_buttons_1.Button, { className: "k-button-increase", rounded: 'full', icon: _this.props.vertical ? 'caret-alt-up' : 'caret-alt-right', svgIcon: _this.props.vertical ? kendo_svg_icons_1.caretAltUpIcon : kendo_svg_icons_1.caretAltRightIcon, title: props.incrementTitle, onClick: props.increment })));
65
66
  };
66
67
  /**
67
68
  * @hidden