@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.
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/dist/es/colors/ColorContrastLabels.js +7 -5
- package/dist/es/colors/ColorInput.js +2 -1
- package/dist/es/colors/ColorPicker.js +13 -11
- package/dist/es/colors/FlatColorPicker.js +4 -6
- package/dist/es/colors/interfaces/ColorPickerProps.d.ts +5 -0
- package/dist/es/input/InputValidationIcon.d.ts +4 -4
- package/dist/es/input/InputValidationIcon.js +2 -2
- package/dist/es/numerictextbox/NumericTextBox.js +3 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rating/Rating.d.ts +9 -1
- package/dist/es/rating/Rating.js +19 -24
- package/dist/es/signature/Signature.js +4 -3
- package/dist/es/slider/Slider.js +3 -2
- package/dist/npm/colors/ColorContrastLabels.js +7 -5
- package/dist/npm/colors/ColorInput.js +2 -1
- package/dist/npm/colors/ColorPicker.js +12 -10
- package/dist/npm/colors/FlatColorPicker.js +4 -6
- package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +5 -0
- package/dist/npm/input/InputValidationIcon.d.ts +4 -4
- package/dist/npm/input/InputValidationIcon.js +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.js +3 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rating/Rating.d.ts +9 -1
- package/dist/npm/rating/Rating.js +18 -23
- package/dist/npm/signature/Signature.js +4 -3
- package/dist/npm/slider/Slider.js +3 -2
- package/dist/systemjs/kendo-react-inputs.js +1 -1
- package/package.json +18 -16
|
@@ -17,6 +17,8 @@ import * as React from 'react';
|
|
|
17
17
|
import { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
18
18
|
import { messages, colorGradientContrastRatio, colorGradientAALevel, colorGradientAAALevel, colorGradientPass, colorGradientFail } from '../messages';
|
|
19
19
|
import { getContrastFromTwoRGBAs } from './utils/color-parser';
|
|
20
|
+
import { IconWrap } from '@progress/kendo-react-common';
|
|
21
|
+
import { checkIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
20
22
|
/**
|
|
21
23
|
* @hidden
|
|
22
24
|
*/
|
|
@@ -41,18 +43,18 @@ var ColorContrastLabels = /** @class */ (function (_super) {
|
|
|
41
43
|
var success = (React.createElement("span", { className: "k-contrast-validation k-text-success" },
|
|
42
44
|
passMessage,
|
|
43
45
|
" ",
|
|
44
|
-
React.createElement(
|
|
46
|
+
React.createElement(IconWrap, { name: "check", icon: checkIcon })));
|
|
45
47
|
var error = (React.createElement("span", { className: "k-contrast-validation k-text-error" },
|
|
46
48
|
failMessage,
|
|
47
49
|
" ",
|
|
48
|
-
React.createElement(
|
|
50
|
+
React.createElement(IconWrap, { name: "x", icon: xIcon })));
|
|
49
51
|
return (React.createElement("div", { className: "k-vbox k-colorgradient-color-contrast" },
|
|
50
52
|
React.createElement("div", { className: "k-contrast-ratio" },
|
|
51
53
|
React.createElement("span", { className: "k-contrast-ratio-text" }, contrastText),
|
|
52
54
|
contrast >= 4.5 ? (React.createElement("span", { className: "k-contrast-validation k-text-success" },
|
|
53
|
-
React.createElement(
|
|
54
|
-
contrast >= 7 && React.createElement(
|
|
55
|
-
React.createElement(
|
|
55
|
+
React.createElement(IconWrap, { name: "check", icon: checkIcon }),
|
|
56
|
+
contrast >= 7 && React.createElement(IconWrap, { name: "check", icon: checkIcon }))) : (React.createElement("span", { className: "k-contrast-validation k-text-error" },
|
|
57
|
+
React.createElement(IconWrap, { name: "x", icon: xIcon })))),
|
|
56
58
|
React.createElement("div", null,
|
|
57
59
|
React.createElement("span", null, aaText),
|
|
58
60
|
contrast >= 4.5 ? success : error),
|
|
@@ -29,6 +29,7 @@ import { NumericTextBox } from '../main';
|
|
|
29
29
|
import HexInput from './HexInput';
|
|
30
30
|
import { Button } from '@progress/kendo-react-buttons';
|
|
31
31
|
import { Label } from '@progress/kendo-react-labels';
|
|
32
|
+
import { caretAltExpandIcon } from '@progress/kendo-svg-icons';
|
|
32
33
|
import { registerForIntl, registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
33
34
|
import { messages, colorGradientR, colorGradientHex, colorGradientA, colorGradientB, colorGradientG, colorGradientToggleInputsButton } from '../messages';
|
|
34
35
|
/**
|
|
@@ -69,7 +70,7 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
69
70
|
var toggleButtonMessage = localizationService.toLanguageString(colorGradientToggleInputsButton, messages[colorGradientToggleInputsButton]);
|
|
70
71
|
return (React.createElement("div", { className: "k-colorgradient-inputs k-hstack" },
|
|
71
72
|
React.createElement("div", { className: "k-vstack" },
|
|
72
|
-
React.createElement(Button, { "aria-label": toggleButtonMessage, fillMode: 'flat', icon: 'caret-alt-expand', className: "k-colorgradient-toggle-mode k-icon-button", onClick: this.onToggleModeChange.bind(this) })),
|
|
73
|
+
React.createElement(Button, { "aria-label": toggleButtonMessage, fillMode: 'flat', icon: 'caret-alt-expand', svgIcon: caretAltExpandIcon, className: "k-colorgradient-toggle-mode k-icon-button", onClick: this.onToggleModeChange.bind(this) })),
|
|
73
74
|
this.state.inputMode === 'hex' &&
|
|
74
75
|
React.createElement("div", { className: "k-vstack k-flex-1" },
|
|
75
76
|
React.createElement("span", { className: "k-hex-value k-textbox k-input" },
|
|
@@ -11,13 +11,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import * as PropTypes from 'prop-types';
|
|
14
|
-
import { classNames, Keys, useDir, getTabIndex, createPropsContext, usePropsContext, kendoThemeMaps } from '@progress/kendo-react-common';
|
|
14
|
+
import { classNames, Keys, useDir, getTabIndex, createPropsContext, usePropsContext, kendoThemeMaps, svgIconPropType, IconWrap } from '@progress/kendo-react-common';
|
|
15
15
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
16
16
|
import { packageMetadata } from '../package-metadata';
|
|
17
17
|
import { Picker } from './Picker';
|
|
18
18
|
import { ColorGradient } from './ColorGradient';
|
|
19
19
|
import { ColorPalette, DEFAULT_PRESET, DEFAULT_TILE_SIZE } from './ColorPalette';
|
|
20
20
|
import { Button } from '@progress/kendo-react-buttons';
|
|
21
|
+
import { caretAltDownIcon } from '@progress/kendo-svg-icons';
|
|
21
22
|
import { messages, colorPickerDropdownButtonAriaLabel } from '../messages';
|
|
22
23
|
import { useLocalization } from '@progress/kendo-react-intl';
|
|
23
24
|
/**
|
|
@@ -60,11 +61,11 @@ export var ColorPickerPropsContext = createPropsContext();
|
|
|
60
61
|
* ```
|
|
61
62
|
*/
|
|
62
63
|
export var ColorPicker = React.forwardRef(function (directProps, target) {
|
|
63
|
-
var _a
|
|
64
|
+
var _a;
|
|
64
65
|
validatePackage(packageMetadata);
|
|
65
66
|
var props = usePropsContext(ColorPickerPropsContext, directProps);
|
|
66
67
|
var localization = useLocalization();
|
|
67
|
-
var
|
|
68
|
+
var _b = props.size, size = _b === void 0 ? defaultProps.size : _b, _c = props.rounded, rounded = _c === void 0 ? defaultProps.rounded : _c, _d = props.fillMode, fillMode = _d === void 0 ? defaultProps.fillMode : _d, popupSettings = props.popupSettings, gradientSettings = props.gradientSettings, paletteSettings = props.paletteSettings, valid = props.valid, disabled = props.disabled, tabIndex = props.tabIndex, view = props.view, icon = props.icon, svgIcon = props.svgIcon, iconClassName = props.iconClassName, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onActiveColorClick = props.onActiveColorClick;
|
|
68
69
|
var focusableElementRef = React.useRef(null);
|
|
69
70
|
var gradientRef = React.useRef(null);
|
|
70
71
|
var paletteRef = React.useRef(null);
|
|
@@ -81,9 +82,9 @@ export var ColorPicker = React.forwardRef(function (directProps, target) {
|
|
|
81
82
|
actionElement: buttonRef.current,
|
|
82
83
|
focus: focusElement
|
|
83
84
|
}); });
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
85
|
+
var _e = React.useState(false), focused = _e[0], setFocused = _e[1];
|
|
86
|
+
var _f = React.useState(props.defaultValue), stateValue = _f[0], setStateValue = _f[1];
|
|
87
|
+
var _g = React.useState(false), stateOpen = _g[0], setStateOpen = _g[1];
|
|
87
88
|
var isValueControlled = isControlled(props.value);
|
|
88
89
|
var isOpenControlled = isControlled(props.open);
|
|
89
90
|
var value = isValueControlled ? props.value : stateValue;
|
|
@@ -207,12 +208,11 @@ export var ColorPicker = React.forwardRef(function (directProps, target) {
|
|
|
207
208
|
React.createElement(Picker, { dir: dir, open: open, onOpen: onOpenHandler, popupAnchor: focusableElementRef.current || undefined, popupSettings: __assign({}, popupSettings), input: (React.createElement("span", { onClick: onActiveColorClickHandler, className: 'k-input-inner' },
|
|
208
209
|
React.createElement("span", { className: classNames('k-value-icon', 'k-color-preview', {
|
|
209
210
|
'k-no-color': !value,
|
|
210
|
-
'k-icon-color-preview': (icon || iconClassName)
|
|
211
|
+
'k-icon-color-preview': (icon || svgIcon || iconClassName)
|
|
211
212
|
}) },
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
React.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: value } })))), button: (React.createElement(Button, { tabIndex: -1, type: "button", onClick: onClickHandler, className: "k-input-button", rounded: null, icon: 'caret-alt-down', "aria-label": localization.toLanguageString(colorPickerDropdownButtonAriaLabel, messages[colorPickerDropdownButtonAriaLabel]) })), content: (React.createElement(React.Fragment, null,
|
|
213
|
+
iconClassName && React.createElement("span", { className: classNames('k-color-preview-icon', iconClassName) }),
|
|
214
|
+
!iconClassName && (icon || svgIcon) && React.createElement(IconWrap, { name: icon, icon: svgIcon }),
|
|
215
|
+
React.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: value } })))), button: (React.createElement(Button, { tabIndex: -1, type: "button", onClick: onClickHandler, className: "k-input-button", rounded: null, icon: 'caret-alt-down', svgIcon: caretAltDownIcon, "aria-label": localization.toLanguageString(colorPickerDropdownButtonAriaLabel, messages[colorPickerDropdownButtonAriaLabel]) })), content: (React.createElement(React.Fragment, null,
|
|
216
216
|
(view === 'combo' || view === 'gradient') && (React.createElement(ColorGradient, __assign({}, gradientSettings, { tabIndex: 0, ref: gradientRef, value: value, onChange: onChangeHandler }))),
|
|
217
217
|
(view === 'combo' || view === 'palette') && (React.createElement(ColorPalette, __assign({}, paletteSettings, { ref: paletteRef, value: value, onChange: onPaletteChangeHandler }))))) })));
|
|
218
218
|
});
|
|
@@ -223,6 +223,8 @@ ColorPicker.propTypes = {
|
|
|
223
223
|
view: PropTypes.oneOf(['gradient', 'palette', 'combo']),
|
|
224
224
|
dir: PropTypes.string,
|
|
225
225
|
id: PropTypes.string,
|
|
226
|
+
icon: PropTypes.string,
|
|
227
|
+
svgIcon: svgIconPropType,
|
|
226
228
|
ariaLabelledBy: PropTypes.string,
|
|
227
229
|
ariaDescribedBy: PropTypes.string,
|
|
228
230
|
size: PropTypes.oneOf([null, 'small', 'medium', 'large']),
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import { classNames, validatePackage, getTabIndex } from '@progress/kendo-react-common';
|
|
4
4
|
import { ButtonGroup, Button } from '@progress/kendo-react-buttons';
|
|
5
|
+
import { paletteIcon, dropletSlashIcon, dropletSliderIcon } from '@progress/kendo-svg-icons';
|
|
5
6
|
import { ColorPalette, ColorGradient } from '../main';
|
|
6
7
|
import { packageMetadata } from '../package-metadata';
|
|
7
8
|
import { messages, flatColorPickerApplyBtn, flatColorPickerCancelBtn } from '../messages';
|
|
@@ -65,15 +66,12 @@ export var FlatColorPicker = React.forwardRef(function (props, ref) {
|
|
|
65
66
|
React.createElement("div", { className: "k-coloreditor-header k-hstack" },
|
|
66
67
|
React.createElement("div", { className: "k-coloreditor-header-actions k-hstack" },
|
|
67
68
|
React.createElement(ButtonGroup, null,
|
|
68
|
-
React.createElement(Button, { type: "button", togglable: true, fillMode: 'flat', selected: colorGradientView, onClick: function () { return handleViewChange('ColorGradient'); } },
|
|
69
|
-
|
|
70
|
-
React.createElement(Button, { type: "button", togglable: true, fillMode: 'flat', selected: !colorGradientView, onClick: function () { return handleViewChange('ColorPalette'); } },
|
|
71
|
-
React.createElement("span", { className: "k-icon k-i-palette" })))),
|
|
69
|
+
React.createElement(Button, { type: "button", togglable: true, fillMode: 'flat', selected: colorGradientView, onClick: function () { return handleViewChange('ColorGradient'); }, icon: "droplet-slider", svgIcon: dropletSliderIcon }),
|
|
70
|
+
React.createElement(Button, { type: "button", togglable: true, fillMode: 'flat', selected: !colorGradientView, onClick: function () { return handleViewChange('ColorPalette'); }, icon: "palette", svgIcon: paletteIcon }))),
|
|
72
71
|
React.createElement("div", { className: "k-spacer" }),
|
|
73
72
|
React.createElement("div", { className: "k-coloreditor-header-actions k-hstack" },
|
|
74
73
|
(props.showClearButton && defaultProps.showClearButton) &&
|
|
75
|
-
React.createElement(Button, { type: "button", fillMode: 'flat', onClick: handleResetColor },
|
|
76
|
-
React.createElement("span", { className: "k-icon k-i-droplet-slash" })),
|
|
74
|
+
React.createElement(Button, { type: "button", fillMode: 'flat', onClick: handleResetColor, icon: "droplet-slash", svgIcon: dropletSlashIcon }),
|
|
77
75
|
(props.showPreview && defaultProps.showPreview) &&
|
|
78
76
|
React.createElement("div", { className: "k-coloreditor-preview k-vstack" },
|
|
79
77
|
React.createElement("span", { className: "k-coloreditor-preview-color k-color-preview", style: { background: colorValue } }),
|
|
@@ -6,6 +6,7 @@ import { ColorPickerPopupSettings } from './ColorPickerPopupSettings';
|
|
|
6
6
|
import { ColorPickerPaletteSettings } from './ColorPickerPaletteSettings';
|
|
7
7
|
import { ColorPickerGradientSettings } from './ColorPickerGradientSettings';
|
|
8
8
|
import { ColorPickerView } from './ColorPickerView';
|
|
9
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
9
10
|
/**
|
|
10
11
|
* Represents the props of the [KendoReact ColorPicker component]({% slug overview_colorpicker %}).
|
|
11
12
|
*/
|
|
@@ -56,6 +57,10 @@ export interface ColorPickerProps {
|
|
|
56
57
|
* ([see example]({% slug customizecolorpicker_colorpicker %}#toc-displaying-kendo-ui-icons)).
|
|
57
58
|
*/
|
|
58
59
|
icon?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Defines the SVG icon.
|
|
62
|
+
*/
|
|
63
|
+
svgIcon?: SVGIcon;
|
|
59
64
|
/**
|
|
60
65
|
* The class name which displays an icon in the ColorPicker button
|
|
61
66
|
* ([see example]({% slug customizecolorpicker_colorpicker %}#toc-displaying-custom-icons)).
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IconHandle, IconProps } from '@progress/kendo-react-common';
|
|
1
|
+
import { IconHandle, SvgIconHandle, IconProps, SvgIconProps } from '@progress/kendo-react-common';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Represent the `ref` of the `InputValidationIcon` component.
|
|
5
5
|
*/
|
|
6
|
-
export declare type InputValidationIconHandle = IconHandle;
|
|
6
|
+
export declare type InputValidationIconHandle = IconHandle & SvgIconHandle;
|
|
7
7
|
/**
|
|
8
8
|
* Represents the `props` of the `InputValidationIcon` component.
|
|
9
9
|
*/
|
|
10
|
-
export declare type InputValidationIconProps = IconProps;
|
|
10
|
+
export declare type InputValidationIconProps = IconProps & SvgIconProps;
|
|
11
11
|
/**
|
|
12
12
|
* Represents the KendoReact InputValidationIcon component.
|
|
13
13
|
*/
|
|
14
|
-
export declare const InputValidationIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<
|
|
14
|
+
export declare const InputValidationIcon: React.ForwardRefExoticComponent<IconProps & SvgIconProps & React.RefAttributes<InputValidationIconHandle>>;
|
|
@@ -9,12 +9,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { classNames,
|
|
12
|
+
import { classNames, IconWrap } from '@progress/kendo-react-common';
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
/**
|
|
15
15
|
* Represents the KendoReact InputValidationIcon component.
|
|
16
16
|
*/
|
|
17
17
|
export var InputValidationIcon = React.forwardRef(function (props, ref) {
|
|
18
|
-
return React.createElement(
|
|
18
|
+
return React.createElement(IconWrap, __assign({ ref: ref }, props, { className: classNames('k-input-validation-icon', props.className) }));
|
|
19
19
|
});
|
|
20
20
|
InputValidationIcon.displayName = 'KendoReactInputValidationIcon';
|
|
@@ -13,6 +13,7 @@ import * as React from 'react';
|
|
|
13
13
|
import * as PropTypes from 'prop-types';
|
|
14
14
|
import { useInternationalization, useLocalization } from '@progress/kendo-react-intl';
|
|
15
15
|
import { classNames, guid, getTabIndex, dispatchEvent, createPropsContext, usePropsContext, kendoThemeMaps, useCustomComponent } from '@progress/kendo-react-common';
|
|
16
|
+
import { caretAltUpIcon, caretAltDownIcon } from '@progress/kendo-svg-icons';
|
|
16
17
|
import { FloatingLabel } from '@progress/kendo-react-labels';
|
|
17
18
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
18
19
|
import { packageMetadata } from '../package-metadata';
|
|
@@ -278,8 +279,8 @@ export var NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
278
279
|
props.children,
|
|
279
280
|
props.spinners &&
|
|
280
281
|
(React.createElement("span", { className: "k-input-spinner k-spin-button", onMouseDown: onMouseDown },
|
|
281
|
-
React.createElement(Button, { tabIndex: -1, type: "button", icon: 'caret-alt-up', rounded: null, className: "k-spinner-increase", "aria-label": localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]), title: localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]), onClick: onIncrease }),
|
|
282
|
-
React.createElement(Button, { tabIndex: -1, type: "button", icon: 'caret-alt-down', rounded: null, className: "k-spinner-decrease", "aria-label": localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]), title: localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]), onClick: onDecrease })))));
|
|
282
|
+
React.createElement(Button, { tabIndex: -1, type: "button", icon: 'caret-alt-up', svgIcon: caretAltUpIcon, rounded: null, className: "k-spinner-increase", "aria-label": localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]), title: localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]), onClick: onIncrease }),
|
|
283
|
+
React.createElement(Button, { tabIndex: -1, type: "button", icon: 'caret-alt-down', svgIcon: caretAltDownIcon, rounded: null, className: "k-spinner-decrease", "aria-label": localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]), title: localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]), onClick: onDecrease })))));
|
|
283
284
|
return props.label
|
|
284
285
|
? (React.createElement(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 }))
|
|
285
286
|
: numerictextbox;
|
|
@@ -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:
|
|
8
|
+
publishDate: 1673444752,
|
|
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
|
};
|
|
@@ -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
|
*/
|
package/dist/es/rating/Rating.js
CHANGED
|
@@ -11,7 +11,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import * as PropTypes from 'prop-types';
|
|
14
|
-
import { classNames, useDir, Keys, getTabIndex, createPropsContext, usePropsContext } from '@progress/kendo-react-common';
|
|
14
|
+
import { classNames, useDir, Keys, getTabIndex, createPropsContext, usePropsContext, IconWrap, toIconName, svgIconPropType } from '@progress/kendo-react-common';
|
|
15
|
+
import { starIcon, starOutlineIcon } from '@progress/kendo-svg-icons';
|
|
15
16
|
import { RatingItem } from './RatingItem';
|
|
16
17
|
import { ratingReducer, RATING_ACTION } from './rating-reducer';
|
|
17
18
|
import { isSelected, isHalf, calcIsFirstHalf, isCorrectValue, toRound, getRemainder } from './utils';
|
|
@@ -45,7 +46,7 @@ export var RatingPropsContext = createPropsContext();
|
|
|
45
46
|
* Obtaining the `ref` returns an object of type [RatingHandle]({% slug api_inputs_ratinghandle %}).
|
|
46
47
|
*/
|
|
47
48
|
export var Rating = React.forwardRef(function (directProps, ref) {
|
|
48
|
-
var _a
|
|
49
|
+
var _a;
|
|
49
50
|
var props = usePropsContext(RatingPropsContext, directProps);
|
|
50
51
|
var localization = useLocalization();
|
|
51
52
|
var target = React.useRef(null);
|
|
@@ -72,19 +73,19 @@ export var Rating = React.forwardRef(function (directProps, ref) {
|
|
|
72
73
|
var readonly = React.useMemo(function () { return props.readonly || defaultProps.readonly; }, [props.readonly]);
|
|
73
74
|
var disabled = React.useMemo(function () { return props.disabled || defaultProps.disabled; }, [props.disabled]);
|
|
74
75
|
var Item = React.useMemo(function () { return props.item || defaultProps.item; }, [props.item]);
|
|
75
|
-
var
|
|
76
|
+
var _b = useRating(props.defaultValue || defaultProps.defaultValue, {
|
|
76
77
|
state: props.value,
|
|
77
78
|
min: min,
|
|
78
79
|
max: max,
|
|
79
80
|
step: precision === 'half' ? step / 2 : step
|
|
80
|
-
}, handleChange), stateValue =
|
|
81
|
-
var
|
|
81
|
+
}, handleChange), stateValue = _b[0], dispatchStateValue = _b[1];
|
|
82
|
+
var _c = useRating(null, {
|
|
82
83
|
state: props.value,
|
|
83
84
|
min: min,
|
|
84
85
|
max: max,
|
|
85
86
|
step: precision === 'half' ? step / 2 : step,
|
|
86
87
|
precision: precision
|
|
87
|
-
}), stateHover =
|
|
88
|
+
}), stateHover = _c[0], dispatchStateHover = _c[1];
|
|
88
89
|
var value = React.useMemo(function () { return props.value || stateValue; }, [props.value, stateValue]);
|
|
89
90
|
var hoveredValue = React.useMemo(function () { return stateHover; }, [stateHover]);
|
|
90
91
|
var selection = React.useMemo(function () { return props.selection || defaultProps.selection; }, [props.selection]);
|
|
@@ -202,27 +203,19 @@ export var Rating = React.forwardRef(function (directProps, ref) {
|
|
|
202
203
|
var selectedValue = isSelected(itemValue, value, step, selection);
|
|
203
204
|
var selected = isSelected(itemValue, hoveredValue !== null ? hoveredValue : value, step, selection);
|
|
204
205
|
var hovered = isSelected(itemValue, hoveredValue, step, selection);
|
|
205
|
-
items.push(React.createElement(Item, { key: itemValue, value: itemValue, dir: dir, title: String(half ? toRound(itemValue - (step / 2), base) : itemValue), icon: props.icon, half: half, selected: selectedValue || selected, hovered: hovered, onClick: handleItemClick, onMouseMove: handleItemMouseMove, onMouseLeave: handleMouseLeave },
|
|
206
|
+
items.push(React.createElement(Item, { key: itemValue, value: itemValue, dir: dir, title: String(half ? 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 },
|
|
206
207
|
half && (React.createElement("span", { className: 'k-rating-precision-complement', style: (_a = { width: '12px' }, _a[dir === 'rtl' ? 'right' : 'left'] = '50%', _a) },
|
|
207
|
-
React.createElement(
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
_b["".concat(props.icon, "-outline")] = props.icon,
|
|
211
|
-
_b)) }))),
|
|
208
|
+
!(props.icon || props.svgIconOutline) && React.createElement(IconWrap, { name: 'star-outline', icon: starOutlineIcon }),
|
|
209
|
+
(props.icon || props.svgIconOutline) && React.createElement(IconWrap, { name: toIconName("".concat(props.icon, "-outline")), icon: props.svgIconOutline }))),
|
|
212
210
|
half && (React.createElement("span", { className: 'k-rating-precision-part', style: { width: '12px' } },
|
|
213
|
-
React.createElement(
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
_c["".concat(props.icon)] = props.icon,
|
|
217
|
-
_c)) }))),
|
|
211
|
+
!(props.icon || props.svgIcon) && React.createElement(IconWrap, { name: 'star', icon: starIcon }),
|
|
212
|
+
(props.icon || props.svgIcon) && React.createElement(IconWrap, { name: props.icon ? toIconName(props.icon) : undefined, icon: props.svgIcon }))),
|
|
218
213
|
half && (React.createElement("span", { style: { width: '24px', height: '24px', display: 'block' } })),
|
|
219
|
-
!half &&
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
_d["".concat(props.icon, "-outline")] = props.icon && (!hovered),
|
|
225
|
-
_d)) }))));
|
|
214
|
+
!half &&
|
|
215
|
+
(!(props.icon || props.svgIcon) && (hovered || (selected && !hovered)) && React.createElement(IconWrap, { name: 'star', icon: starIcon })) ||
|
|
216
|
+
(!(props.icon || props.svgIcon) && !hovered && React.createElement(IconWrap, { name: 'star-outline', icon: starOutlineIcon })) ||
|
|
217
|
+
((props.icon || props.svgIcon) && (hovered || (selected && !hovered)) && React.createElement(IconWrap, { name: props.icon, icon: props.svgIcon })) ||
|
|
218
|
+
((props.icon || props.svgIcon) && !hovered && React.createElement(IconWrap, { name: toIconName("".concat(props.icon, "-outline")), icon: props.svgIconOutline }))));
|
|
226
219
|
}
|
|
227
220
|
return (React.createElement("span", { id: props.id, style: props.style, ref: ratingRef, role: "slider", dir: dir, tabIndex: getTabIndex(props.tabIndex, props.disabled, undefined), className: classNames('k-rating k-widget', {
|
|
228
221
|
'k-rtl': dir === 'rtl',
|
|
@@ -265,6 +258,8 @@ var propTypes = {
|
|
|
265
258
|
disabled: PropTypes.bool,
|
|
266
259
|
half: PropTypes.bool,
|
|
267
260
|
icon: PropTypes.string,
|
|
261
|
+
svgIcon: svgIconPropType,
|
|
262
|
+
svgIconOutline: svgIconPropType,
|
|
268
263
|
ariaDescribedBy: PropTypes.string
|
|
269
264
|
};
|
|
270
265
|
var defaultProps = {
|
|
@@ -56,6 +56,7 @@ import * as React from 'react';
|
|
|
56
56
|
import { messages, signatureClear, signatureMaximize, signatureMinimize } from '../messages';
|
|
57
57
|
import { packageMetadata } from '../package-metadata';
|
|
58
58
|
import { hasParent } from './utils';
|
|
59
|
+
import { hyperlinkOpenIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
59
60
|
var DEFAULT_WIDTH = 250;
|
|
60
61
|
var DEFAULT_HEIGHT = 84;
|
|
61
62
|
var DEFAULT_POPUP_SCALE = 3;
|
|
@@ -335,10 +336,10 @@ export var Signature = React.forwardRef(function (directProps, target) {
|
|
|
335
336
|
_a), props.className), onFocus: onFocus, onBlur: onBlur },
|
|
336
337
|
React.createElement("div", { className: 'k-signature-canvas', ref: canvasRef, tabIndex: 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 }),
|
|
337
338
|
React.createElement("div", { className: 'k-signature-actions k-signature-actions-top' },
|
|
338
|
-
showMaximize && (React.createElement(Button, { className: 'k-signature-action k-signature-maximize', ref: maximizeButtonRef, icon: 'hyperlink-open',
|
|
339
|
-
showMinimize && (React.createElement(Button, { className: 'k-signature-action k-signature-minimize k-rotate-180', ref: minimizeButtonRef, icon: 'hyperlink-open',
|
|
339
|
+
showMaximize && (React.createElement(Button, { className: 'k-signature-action k-signature-maximize', ref: maximizeButtonRef, icon: 'hyperlink-open', svgIcon: hyperlinkOpenIcon, fillMode: 'flat', size: props.size, onClick: onMaximizeClick, "aria-label": maximizeTitle, title: maximizeTitle })),
|
|
340
|
+
showMinimize && (React.createElement(Button, { className: 'k-signature-action k-signature-minimize k-rotate-180', ref: minimizeButtonRef, icon: 'hyperlink-open', svgIcon: hyperlinkOpenIcon, fillMode: 'flat', size: props.size, onClick: onMinimizeClick, "aria-label": minimizeTitle, title: minimizeTitle }))),
|
|
340
341
|
!props.hideLine && (React.createElement("div", { className: 'k-signature-line', style: { zIndex: 2, pointerEvents: 'none' } })),
|
|
341
|
-
React.createElement("div", { className: 'k-signature-actions k-signature-actions-bottom' }, showClear && (React.createElement(Button, { className: 'k-signature-action k-signature-clear', icon: '
|
|
342
|
+
React.createElement("div", { className: 'k-signature-actions k-signature-actions-bottom' }, showClear && (React.createElement(Button, { className: 'k-signature-action k-signature-clear', icon: 'x', svgIcon: xIcon, fillMode: 'flat', size: props.size, onClick: onClear, "aria-label": clearTitle, title: clearTitle }))),
|
|
342
343
|
open && (React.createElement(Dialog, { ref: dialogRef },
|
|
343
344
|
React.createElement(Signature, __assign({}, props, popupSize(), { value: popupValue, maximized: true, exportScale: (1 / popupScale) * exportScale, open: false, onChange: onDialogChange, onClose: onDialogClose }))))));
|
|
344
345
|
});
|
package/dist/es/slider/Slider.js
CHANGED
|
@@ -33,6 +33,7 @@ import { SLIDER_LABEL_ATTRIBUTE } from './SliderLabel';
|
|
|
33
33
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
34
34
|
import { packageMetadata } from '../package-metadata';
|
|
35
35
|
import { Button } from '@progress/kendo-react-buttons';
|
|
36
|
+
import { caretAltDownIcon, caretAltLeftIcon, caretAltUpIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';
|
|
36
37
|
/** @hidden */
|
|
37
38
|
var SliderWithoutContext = /** @class */ (function (_super) {
|
|
38
39
|
__extends(SliderWithoutContext, _super);
|
|
@@ -56,9 +57,9 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
56
57
|
return props.children;
|
|
57
58
|
}
|
|
58
59
|
return (React.createElement(React.Fragment, null,
|
|
59
|
-
React.createElement(Button, { className: "k-button-decrease", rounded: 'full', icon: _this.props.vertical ? 'caret-alt-down' : 'caret-alt-left', title: props.decrementTitle, onClick: props.decrement }),
|
|
60
|
+
React.createElement(Button, { className: "k-button-decrease", rounded: 'full', icon: _this.props.vertical ? 'caret-alt-down' : 'caret-alt-left', svgIcon: _this.props.vertical ? caretAltDownIcon : caretAltLeftIcon, title: props.decrementTitle, onClick: props.decrement }),
|
|
60
61
|
props.children,
|
|
61
|
-
React.createElement(Button, { className: "k-button-increase", rounded: 'full', icon: _this.props.vertical ? 'caret-alt-up' : 'caret-alt-right', title: props.incrementTitle, onClick: props.increment })));
|
|
62
|
+
React.createElement(Button, { className: "k-button-increase", rounded: 'full', icon: _this.props.vertical ? 'caret-alt-up' : 'caret-alt-right', svgIcon: _this.props.vertical ? caretAltUpIcon : caretAltRightIcon, title: props.incrementTitle, onClick: props.increment })));
|
|
62
63
|
};
|
|
63
64
|
/**
|
|
64
65
|
* @hidden
|
|
@@ -20,6 +20,8 @@ var React = require("react");
|
|
|
20
20
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
21
21
|
var messages_1 = require("../messages");
|
|
22
22
|
var color_parser_1 = require("./utils/color-parser");
|
|
23
|
+
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
24
|
+
var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
23
25
|
/**
|
|
24
26
|
* @hidden
|
|
25
27
|
*/
|
|
@@ -44,18 +46,18 @@ var ColorContrastLabels = /** @class */ (function (_super) {
|
|
|
44
46
|
var success = (React.createElement("span", { className: "k-contrast-validation k-text-success" },
|
|
45
47
|
passMessage,
|
|
46
48
|
" ",
|
|
47
|
-
React.createElement(
|
|
49
|
+
React.createElement(kendo_react_common_1.IconWrap, { name: "check", icon: kendo_svg_icons_1.checkIcon })));
|
|
48
50
|
var error = (React.createElement("span", { className: "k-contrast-validation k-text-error" },
|
|
49
51
|
failMessage,
|
|
50
52
|
" ",
|
|
51
|
-
React.createElement(
|
|
53
|
+
React.createElement(kendo_react_common_1.IconWrap, { name: "x", icon: kendo_svg_icons_1.xIcon })));
|
|
52
54
|
return (React.createElement("div", { className: "k-vbox k-colorgradient-color-contrast" },
|
|
53
55
|
React.createElement("div", { className: "k-contrast-ratio" },
|
|
54
56
|
React.createElement("span", { className: "k-contrast-ratio-text" }, contrastText),
|
|
55
57
|
contrast >= 4.5 ? (React.createElement("span", { className: "k-contrast-validation k-text-success" },
|
|
56
|
-
React.createElement(
|
|
57
|
-
contrast >= 7 && React.createElement(
|
|
58
|
-
React.createElement(
|
|
58
|
+
React.createElement(kendo_react_common_1.IconWrap, { name: "check", icon: kendo_svg_icons_1.checkIcon }),
|
|
59
|
+
contrast >= 7 && React.createElement(kendo_react_common_1.IconWrap, { name: "check", icon: kendo_svg_icons_1.checkIcon }))) : (React.createElement("span", { className: "k-contrast-validation k-text-error" },
|
|
60
|
+
React.createElement(kendo_react_common_1.IconWrap, { name: "x", icon: kendo_svg_icons_1.xIcon })))),
|
|
59
61
|
React.createElement("div", null,
|
|
60
62
|
React.createElement("span", null, aaText),
|
|
61
63
|
contrast >= 4.5 ? success : error),
|
|
@@ -31,6 +31,7 @@ var main_1 = require("../main");
|
|
|
31
31
|
var HexInput_1 = require("./HexInput");
|
|
32
32
|
var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
33
33
|
var kendo_react_labels_1 = require("@progress/kendo-react-labels");
|
|
34
|
+
var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
34
35
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
35
36
|
var messages_1 = require("../messages");
|
|
36
37
|
/**
|
|
@@ -71,7 +72,7 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
71
72
|
var toggleButtonMessage = localizationService.toLanguageString(messages_1.colorGradientToggleInputsButton, messages_1.messages[messages_1.colorGradientToggleInputsButton]);
|
|
72
73
|
return (React.createElement("div", { className: "k-colorgradient-inputs k-hstack" },
|
|
73
74
|
React.createElement("div", { className: "k-vstack" },
|
|
74
|
-
React.createElement(kendo_react_buttons_1.Button, { "aria-label": toggleButtonMessage, fillMode: 'flat', icon: 'caret-alt-expand', className: "k-colorgradient-toggle-mode k-icon-button", onClick: this.onToggleModeChange.bind(this) })),
|
|
75
|
+
React.createElement(kendo_react_buttons_1.Button, { "aria-label": toggleButtonMessage, fillMode: 'flat', icon: 'caret-alt-expand', svgIcon: kendo_svg_icons_1.caretAltExpandIcon, className: "k-colorgradient-toggle-mode k-icon-button", onClick: this.onToggleModeChange.bind(this) })),
|
|
75
76
|
this.state.inputMode === 'hex' &&
|
|
76
77
|
React.createElement("div", { className: "k-vstack k-flex-1" },
|
|
77
78
|
React.createElement("span", { className: "k-hex-value k-textbox k-input" },
|
|
@@ -21,6 +21,7 @@ var Picker_1 = require("./Picker");
|
|
|
21
21
|
var ColorGradient_1 = require("./ColorGradient");
|
|
22
22
|
var ColorPalette_1 = require("./ColorPalette");
|
|
23
23
|
var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
24
|
+
var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
24
25
|
var messages_1 = require("../messages");
|
|
25
26
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
26
27
|
/**
|
|
@@ -63,11 +64,11 @@ exports.ColorPickerPropsContext = (0, kendo_react_common_1.createPropsContext)()
|
|
|
63
64
|
* ```
|
|
64
65
|
*/
|
|
65
66
|
exports.ColorPicker = React.forwardRef(function (directProps, target) {
|
|
66
|
-
var _a
|
|
67
|
+
var _a;
|
|
67
68
|
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
68
69
|
var props = (0, kendo_react_common_1.usePropsContext)(exports.ColorPickerPropsContext, directProps);
|
|
69
70
|
var localization = (0, kendo_react_intl_1.useLocalization)();
|
|
70
|
-
var
|
|
71
|
+
var _b = props.size, size = _b === void 0 ? defaultProps.size : _b, _c = props.rounded, rounded = _c === void 0 ? defaultProps.rounded : _c, _d = props.fillMode, fillMode = _d === void 0 ? defaultProps.fillMode : _d, popupSettings = props.popupSettings, gradientSettings = props.gradientSettings, paletteSettings = props.paletteSettings, valid = props.valid, disabled = props.disabled, tabIndex = props.tabIndex, view = props.view, icon = props.icon, svgIcon = props.svgIcon, iconClassName = props.iconClassName, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onActiveColorClick = props.onActiveColorClick;
|
|
71
72
|
var focusableElementRef = React.useRef(null);
|
|
72
73
|
var gradientRef = React.useRef(null);
|
|
73
74
|
var paletteRef = React.useRef(null);
|
|
@@ -84,9 +85,9 @@ exports.ColorPicker = React.forwardRef(function (directProps, target) {
|
|
|
84
85
|
actionElement: buttonRef.current,
|
|
85
86
|
focus: focusElement
|
|
86
87
|
}); });
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var
|
|
88
|
+
var _e = React.useState(false), focused = _e[0], setFocused = _e[1];
|
|
89
|
+
var _f = React.useState(props.defaultValue), stateValue = _f[0], setStateValue = _f[1];
|
|
90
|
+
var _g = React.useState(false), stateOpen = _g[0], setStateOpen = _g[1];
|
|
90
91
|
var isValueControlled = isControlled(props.value);
|
|
91
92
|
var isOpenControlled = isControlled(props.open);
|
|
92
93
|
var value = isValueControlled ? props.value : stateValue;
|
|
@@ -210,12 +211,11 @@ exports.ColorPicker = React.forwardRef(function (directProps, target) {
|
|
|
210
211
|
React.createElement(Picker_1.Picker, { dir: dir, open: open, onOpen: onOpenHandler, popupAnchor: focusableElementRef.current || undefined, popupSettings: __assign({}, popupSettings), input: (React.createElement("span", { onClick: onActiveColorClickHandler, className: 'k-input-inner' },
|
|
211
212
|
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-value-icon', 'k-color-preview', {
|
|
212
213
|
'k-no-color': !value,
|
|
213
|
-
'k-icon-color-preview': (icon || iconClassName)
|
|
214
|
+
'k-icon-color-preview': (icon || svgIcon || iconClassName)
|
|
214
215
|
}) },
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
React.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: value } })))), button: (React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", onClick: onClickHandler, className: "k-input-button", rounded: null, icon: 'caret-alt-down', "aria-label": localization.toLanguageString(messages_1.colorPickerDropdownButtonAriaLabel, messages_1.messages[messages_1.colorPickerDropdownButtonAriaLabel]) })), content: (React.createElement(React.Fragment, null,
|
|
216
|
+
iconClassName && React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-color-preview-icon', iconClassName) }),
|
|
217
|
+
!iconClassName && (icon || svgIcon) && React.createElement(kendo_react_common_1.IconWrap, { name: icon, icon: svgIcon }),
|
|
218
|
+
React.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: value } })))), button: (React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", onClick: onClickHandler, className: "k-input-button", rounded: null, icon: 'caret-alt-down', svgIcon: kendo_svg_icons_1.caretAltDownIcon, "aria-label": localization.toLanguageString(messages_1.colorPickerDropdownButtonAriaLabel, messages_1.messages[messages_1.colorPickerDropdownButtonAriaLabel]) })), content: (React.createElement(React.Fragment, null,
|
|
219
219
|
(view === 'combo' || view === 'gradient') && (React.createElement(ColorGradient_1.ColorGradient, __assign({}, gradientSettings, { tabIndex: 0, ref: gradientRef, value: value, onChange: onChangeHandler }))),
|
|
220
220
|
(view === 'combo' || view === 'palette') && (React.createElement(ColorPalette_1.ColorPalette, __assign({}, paletteSettings, { ref: paletteRef, value: value, onChange: onPaletteChangeHandler }))))) })));
|
|
221
221
|
});
|
|
@@ -226,6 +226,8 @@ exports.ColorPicker.propTypes = {
|
|
|
226
226
|
view: PropTypes.oneOf(['gradient', 'palette', 'combo']),
|
|
227
227
|
dir: PropTypes.string,
|
|
228
228
|
id: PropTypes.string,
|
|
229
|
+
icon: PropTypes.string,
|
|
230
|
+
svgIcon: kendo_react_common_1.svgIconPropType,
|
|
229
231
|
ariaLabelledBy: PropTypes.string,
|
|
230
232
|
ariaDescribedBy: PropTypes.string,
|
|
231
233
|
size: PropTypes.oneOf([null, 'small', 'medium', 'large']),
|
|
@@ -5,6 +5,7 @@ var React = require("react");
|
|
|
5
5
|
var PropTypes = require("prop-types");
|
|
6
6
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
7
7
|
var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
8
|
+
var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
8
9
|
var main_1 = require("../main");
|
|
9
10
|
var package_metadata_1 = require("../package-metadata");
|
|
10
11
|
var messages_1 = require("../messages");
|
|
@@ -68,15 +69,12 @@ exports.FlatColorPicker = React.forwardRef(function (props, ref) {
|
|
|
68
69
|
React.createElement("div", { className: "k-coloreditor-header k-hstack" },
|
|
69
70
|
React.createElement("div", { className: "k-coloreditor-header-actions k-hstack" },
|
|
70
71
|
React.createElement(kendo_react_buttons_1.ButtonGroup, null,
|
|
71
|
-
React.createElement(kendo_react_buttons_1.Button, { type: "button", togglable: true, fillMode: 'flat', selected: colorGradientView, onClick: function () { return handleViewChange('ColorGradient'); } },
|
|
72
|
-
|
|
73
|
-
React.createElement(kendo_react_buttons_1.Button, { type: "button", togglable: true, fillMode: 'flat', selected: !colorGradientView, onClick: function () { return handleViewChange('ColorPalette'); } },
|
|
74
|
-
React.createElement("span", { className: "k-icon k-i-palette" })))),
|
|
72
|
+
React.createElement(kendo_react_buttons_1.Button, { type: "button", togglable: true, fillMode: 'flat', selected: colorGradientView, onClick: function () { return handleViewChange('ColorGradient'); }, icon: "droplet-slider", svgIcon: kendo_svg_icons_1.dropletSliderIcon }),
|
|
73
|
+
React.createElement(kendo_react_buttons_1.Button, { type: "button", togglable: true, fillMode: 'flat', selected: !colorGradientView, onClick: function () { return handleViewChange('ColorPalette'); }, icon: "palette", svgIcon: kendo_svg_icons_1.paletteIcon }))),
|
|
75
74
|
React.createElement("div", { className: "k-spacer" }),
|
|
76
75
|
React.createElement("div", { className: "k-coloreditor-header-actions k-hstack" },
|
|
77
76
|
(props.showClearButton && defaultProps.showClearButton) &&
|
|
78
|
-
React.createElement(kendo_react_buttons_1.Button, { type: "button", fillMode: 'flat', onClick: handleResetColor },
|
|
79
|
-
React.createElement("span", { className: "k-icon k-i-droplet-slash" })),
|
|
77
|
+
React.createElement(kendo_react_buttons_1.Button, { type: "button", fillMode: 'flat', onClick: handleResetColor, icon: "droplet-slash", svgIcon: kendo_svg_icons_1.dropletSlashIcon }),
|
|
80
78
|
(props.showPreview && defaultProps.showPreview) &&
|
|
81
79
|
React.createElement("div", { className: "k-coloreditor-preview k-vstack" },
|
|
82
80
|
React.createElement("span", { className: "k-coloreditor-preview-color k-color-preview", style: { background: colorValue } }),
|
|
@@ -6,6 +6,7 @@ import { ColorPickerPopupSettings } from './ColorPickerPopupSettings';
|
|
|
6
6
|
import { ColorPickerPaletteSettings } from './ColorPickerPaletteSettings';
|
|
7
7
|
import { ColorPickerGradientSettings } from './ColorPickerGradientSettings';
|
|
8
8
|
import { ColorPickerView } from './ColorPickerView';
|
|
9
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
9
10
|
/**
|
|
10
11
|
* Represents the props of the [KendoReact ColorPicker component]({% slug overview_colorpicker %}).
|
|
11
12
|
*/
|
|
@@ -56,6 +57,10 @@ export interface ColorPickerProps {
|
|
|
56
57
|
* ([see example]({% slug customizecolorpicker_colorpicker %}#toc-displaying-kendo-ui-icons)).
|
|
57
58
|
*/
|
|
58
59
|
icon?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Defines the SVG icon.
|
|
62
|
+
*/
|
|
63
|
+
svgIcon?: SVGIcon;
|
|
59
64
|
/**
|
|
60
65
|
* The class name which displays an icon in the ColorPicker button
|
|
61
66
|
* ([see example]({% slug customizecolorpicker_colorpicker %}#toc-displaying-custom-icons)).
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IconHandle, IconProps } from '@progress/kendo-react-common';
|
|
1
|
+
import { IconHandle, SvgIconHandle, IconProps, SvgIconProps } from '@progress/kendo-react-common';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Represent the `ref` of the `InputValidationIcon` component.
|
|
5
5
|
*/
|
|
6
|
-
export declare type InputValidationIconHandle = IconHandle;
|
|
6
|
+
export declare type InputValidationIconHandle = IconHandle & SvgIconHandle;
|
|
7
7
|
/**
|
|
8
8
|
* Represents the `props` of the `InputValidationIcon` component.
|
|
9
9
|
*/
|
|
10
|
-
export declare type InputValidationIconProps = IconProps;
|
|
10
|
+
export declare type InputValidationIconProps = IconProps & SvgIconProps;
|
|
11
11
|
/**
|
|
12
12
|
* Represents the KendoReact InputValidationIcon component.
|
|
13
13
|
*/
|
|
14
|
-
export declare const InputValidationIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<
|
|
14
|
+
export declare const InputValidationIcon: React.ForwardRefExoticComponent<IconProps & SvgIconProps & React.RefAttributes<InputValidationIconHandle>>;
|
|
@@ -18,6 +18,6 @@ var React = require("react");
|
|
|
18
18
|
* Represents the KendoReact InputValidationIcon component.
|
|
19
19
|
*/
|
|
20
20
|
exports.InputValidationIcon = React.forwardRef(function (props, ref) {
|
|
21
|
-
return React.createElement(kendo_react_common_1.
|
|
21
|
+
return React.createElement(kendo_react_common_1.IconWrap, __assign({ ref: ref }, props, { className: (0, kendo_react_common_1.classNames)('k-input-validation-icon', props.className) }));
|
|
22
22
|
});
|
|
23
23
|
exports.InputValidationIcon.displayName = 'KendoReactInputValidationIcon';
|