@progress/kendo-react-inputs 5.4.0-dev.202205271059 → 5.4.0-dev.202206061009
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/checkbox/Checkbox.d.ts +1 -1
- package/dist/es/checkbox/Checkbox.js +2 -2
- package/dist/es/colors/ColorContrastLabels.js +3 -3
- package/dist/es/colors/ColorGradient.d.ts +1 -1
- package/dist/es/colors/ColorGradient.js +7 -3
- package/dist/es/colors/ColorPalette.d.ts +4 -1
- package/dist/es/colors/ColorPalette.js +10 -3
- package/dist/es/colors/ColorPicker.d.ts +1 -1
- package/dist/es/colors/ColorPicker.js +4 -4
- package/dist/es/colors/FlatColorPicker.d.ts +1 -1
- package/dist/es/colors/FlatColorPicker.js +25 -24
- package/dist/es/colors/HexInput.d.ts +1 -1
- package/dist/es/colors/utils/color-parser.js +2 -2
- package/dist/es/colors/utils/svg-calc.js +4 -4
- package/dist/es/common/SliderTooltip.js +3 -3
- package/dist/es/common/SwitchController.js +5 -1
- package/dist/es/common/SwitchModel.d.ts +1 -1
- package/dist/es/input/Input.js +1 -0
- package/dist/es/maskedtextbox/MaskedTextBox.d.ts +7 -7
- package/dist/es/maskedtextbox/MaskedTextBox.js +7 -6
- package/dist/es/maskedtextbox/parsing/result.js +1 -1
- package/dist/es/numerictextbox/NumericTextBox.d.ts +1 -1
- package/dist/es/numerictextbox/NumericTextBox.js +3 -3
- package/dist/es/numerictextbox/utils/index.js +4 -4
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.d.ts +1 -1
- package/dist/es/radiobutton/RadioButton.js +1 -1
- package/dist/es/radiobutton/RadioGroup.d.ts +1 -1
- package/dist/es/range-slider/RangeSlider.d.ts +1 -1
- package/dist/es/range-slider/RangeSlider.js +7 -7
- package/dist/es/rating/Rating.d.ts +1 -1
- package/dist/es/rating/Rating.js +15 -12
- package/dist/es/rating/RatingItem.d.ts +1 -1
- package/dist/es/rating/models/index.d.ts +4 -0
- package/dist/es/slider/Slider.d.ts +2 -2
- package/dist/es/slider/Slider.js +2 -0
- package/dist/es/slider/SliderLabel.js +2 -2
- package/dist/es/switch/Switch.d.ts +6 -6
- package/dist/es/switch/Switch.js +7 -4
- package/dist/es/textarea/TextArea.d.ts +1 -1
- package/dist/es/textarea/TextArea.js +4 -4
- package/dist/es/utils.js +9 -5
- package/dist/npm/checkbox/Checkbox.d.ts +1 -1
- package/dist/npm/checkbox/Checkbox.js +14 -14
- package/dist/npm/colors/ColorContrastLabels.js +6 -6
- package/dist/npm/colors/ColorContrastSvg.js +6 -6
- package/dist/npm/colors/ColorGradient.d.ts +1 -1
- package/dist/npm/colors/ColorGradient.js +37 -33
- package/dist/npm/colors/ColorInput.js +3 -3
- package/dist/npm/colors/ColorPalette.d.ts +4 -1
- package/dist/npm/colors/ColorPalette.js +19 -12
- package/dist/npm/colors/ColorPicker.d.ts +1 -1
- package/dist/npm/colors/ColorPicker.js +13 -13
- package/dist/npm/colors/FlatColorPicker.d.ts +1 -1
- package/dist/npm/colors/FlatColorPicker.js +27 -26
- package/dist/npm/colors/HexInput.d.ts +1 -1
- package/dist/npm/colors/HexInput.js +3 -3
- package/dist/npm/colors/Picker.js +1 -1
- package/dist/npm/colors/utils/color-palette.service.js +6 -6
- package/dist/npm/colors/utils/color-parser.js +26 -26
- package/dist/npm/colors/utils/misc.js +1 -1
- package/dist/npm/colors/utils/svg-calc.js +4 -4
- package/dist/npm/common/SliderTooltip.js +4 -4
- package/dist/npm/common/SwitchController.js +5 -1
- package/dist/npm/common/SwitchModel.d.ts +1 -1
- package/dist/npm/input/Input.js +6 -5
- package/dist/npm/main.js +5 -1
- package/dist/npm/maskedtextbox/MaskedTextBox.d.ts +7 -7
- package/dist/npm/maskedtextbox/MaskedTextBox.js +13 -12
- package/dist/npm/maskedtextbox/masking.service.js +19 -19
- package/dist/npm/maskedtextbox/parsing/result.js +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.d.ts +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.js +31 -31
- package/dist/npm/numerictextbox/utils/index.js +60 -60
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.d.ts +1 -1
- package/dist/npm/radiobutton/RadioButton.js +10 -10
- package/dist/npm/radiobutton/RadioGroup.d.ts +1 -1
- package/dist/npm/radiobutton/RadioGroup.js +10 -10
- package/dist/npm/range-slider/RangeSlider.d.ts +1 -1
- package/dist/npm/range-slider/RangeSlider.js +17 -17
- package/dist/npm/rating/Rating.d.ts +1 -1
- package/dist/npm/rating/Rating.js +36 -33
- package/dist/npm/rating/RatingItem.d.ts +1 -1
- package/dist/npm/rating/RatingItem.js +2 -2
- package/dist/npm/rating/models/index.d.ts +4 -0
- package/dist/npm/rating/rating-reducer.js +4 -4
- package/dist/npm/rating/utils/index.js +5 -5
- package/dist/npm/slider/Slider.d.ts +2 -2
- package/dist/npm/slider/Slider.js +9 -7
- package/dist/npm/slider/SliderLabel.js +3 -3
- package/dist/npm/switch/Switch.d.ts +6 -6
- package/dist/npm/switch/Switch.js +17 -14
- package/dist/npm/textarea/TextArea.d.ts +1 -1
- package/dist/npm/textarea/TextArea.js +13 -13
- package/dist/npm/utils.js +9 -5
- package/dist/systemjs/kendo-react-inputs.js +1 -1
- package/package.json +15 -15
|
@@ -36,7 +36,7 @@ export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedT
|
|
|
36
36
|
includeLiterals: PropTypes.Requireable<boolean>;
|
|
37
37
|
maskValidation: PropTypes.Requireable<boolean>;
|
|
38
38
|
mask: PropTypes.Requireable<string>;
|
|
39
|
-
rules: (props: MaskedTextBoxProps, propName: string, componentName: string) => Error;
|
|
39
|
+
rules: (props: MaskedTextBoxProps, propName: string, componentName: string) => Error | null;
|
|
40
40
|
selection: PropTypes.Requireable<PropTypes.InferProps<{
|
|
41
41
|
start: PropTypes.Validator<number>;
|
|
42
42
|
end: PropTypes.Validator<number>;
|
|
@@ -48,9 +48,9 @@ export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedT
|
|
|
48
48
|
valid: PropTypes.Requireable<boolean>;
|
|
49
49
|
validityStyles: PropTypes.Requireable<boolean>;
|
|
50
50
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
51
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
52
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
|
|
53
|
-
fillMode: PropTypes.Requireable<"flat" | "
|
|
51
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
52
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
|
|
53
|
+
fillMode: PropTypes.Requireable<"flat" | "outline" | "solid" | null | undefined>;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
56
|
* @hidden
|
|
@@ -65,9 +65,9 @@ export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedT
|
|
|
65
65
|
};
|
|
66
66
|
required: boolean;
|
|
67
67
|
validityStyles: boolean;
|
|
68
|
-
size: "small" | "medium" | "large";
|
|
69
|
-
rounded: "small" | "medium" | "full" | "large";
|
|
70
|
-
fillMode: "flat" | "
|
|
68
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
69
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
70
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
71
71
|
};
|
|
72
72
|
/**
|
|
73
73
|
* @hidden
|
|
@@ -44,7 +44,7 @@ var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
44
44
|
* @hidden
|
|
45
45
|
*/
|
|
46
46
|
_this.state = {};
|
|
47
|
-
_this._inputId = "k-"
|
|
47
|
+
_this._inputId = "k-".concat((0, kendo_react_common_1.guid)());
|
|
48
48
|
_this._service = new masking_service_1.MaskingService();
|
|
49
49
|
_this._isPasted = false;
|
|
50
50
|
_this._selection = [null, null];
|
|
@@ -121,7 +121,7 @@ var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
121
121
|
: _this.props.validationMessage || '');
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
124
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
125
125
|
return _this;
|
|
126
126
|
}
|
|
127
127
|
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "element", {
|
|
@@ -266,7 +266,7 @@ var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
266
266
|
this.element.setSelectionRange(start, end);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
if (utils_1.maskingChanged(prevProps, this.props)) {
|
|
269
|
+
if ((0, utils_1.maskingChanged)(prevProps, this.props)) {
|
|
270
270
|
this.updateService();
|
|
271
271
|
}
|
|
272
272
|
this.setValidity();
|
|
@@ -288,16 +288,16 @@ var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
288
288
|
var inputId = this.props.id || this._inputId;
|
|
289
289
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
290
290
|
var style = this.props.style || {};
|
|
291
|
-
var component = (React.createElement("span", { dir: this.props.dir, className: kendo_react_common_1.classNames('k-maskedtextbox k-input', (_a = {},
|
|
292
|
-
_a["k-input-"
|
|
293
|
-
_a["k-input-"
|
|
294
|
-
_a["k-rounded-"
|
|
291
|
+
var component = (React.createElement("span", { dir: this.props.dir, className: (0, kendo_react_common_1.classNames)('k-maskedtextbox k-input', (_a = {},
|
|
292
|
+
_a["k-input-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
293
|
+
_a["k-input-".concat(fillMode)] = fillMode,
|
|
294
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
295
295
|
_a['k-invalid'] = !isValid,
|
|
296
296
|
_a['k-required'] = this.required,
|
|
297
297
|
_a['k-disabled'] = this.props.disabled,
|
|
298
298
|
_a), this.props.className), style: !this.props.label
|
|
299
299
|
? __assign({ width: this.props.width }, style) : style },
|
|
300
|
-
React.createElement("input", { type: "text", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: false, className: "k-input-inner", value: this.value, id: inputId, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, name: this.props.name, tabIndex: kendo_react_common_1.getTabIndex(this.props.tabIndex, this.props.disabled, true), accessKey: this.props.accessKey, title: this.props.title, disabled: this.props.disabled || undefined, readOnly: this.props.readonly || undefined, placeholder: this.props.placeholder, ref: function (input) { return _this._input = input; }, onChange: this.onChangeHandler, onPaste: this.pasteHandler, onFocus: this.focusHandler, onBlur: this.blurHandler, onDragStart: utils_1.returnFalse, onDrop: utils_1.returnFalse })));
|
|
300
|
+
React.createElement("input", { type: "text", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: false, className: "k-input-inner", value: this.value, id: inputId, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, name: this.props.name, tabIndex: (0, kendo_react_common_1.getTabIndex)(this.props.tabIndex, this.props.disabled, true), accessKey: this.props.accessKey, title: this.props.title, disabled: this.props.disabled || undefined, readOnly: this.props.readonly || undefined, placeholder: this.props.placeholder, ref: function (input) { return _this._input = input; }, onChange: this.onChangeHandler, onPaste: this.pasteHandler, onFocus: this.focusHandler, onBlur: this.blurHandler, onDragStart: utils_1.returnFalse, onDrop: utils_1.returnFalse })));
|
|
301
301
|
return this.props.label
|
|
302
302
|
? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: this.props.label, editorId: inputId, editorValue: this.value, editorValid: isValid, editorDisabled: this.props.disabled, editorPlaceholder: this.props.placeholder, children: component, style: { width: this.props.width }, dir: this.props.dir }))
|
|
303
303
|
: component;
|
|
@@ -308,14 +308,15 @@ var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
308
308
|
});
|
|
309
309
|
if (this.props.onChange) {
|
|
310
310
|
this._valueDuringOnChange = maskedValue;
|
|
311
|
-
|
|
311
|
+
var ev = {
|
|
312
312
|
syntheticEvent: event,
|
|
313
313
|
nativeEvent: event.nativeEvent,
|
|
314
314
|
selectionStart: this._selection[0],
|
|
315
315
|
selectionEnd: this._selection[1],
|
|
316
316
|
target: this,
|
|
317
317
|
value: this.value
|
|
318
|
-
}
|
|
318
|
+
};
|
|
319
|
+
this.props.onChange.call(undefined, ev);
|
|
319
320
|
this._valueDuringOnChange = undefined;
|
|
320
321
|
}
|
|
321
322
|
};
|
|
@@ -415,7 +416,7 @@ exports.MaskedTextBoxWithoutContext = MaskedTextBoxWithoutContext;
|
|
|
415
416
|
*
|
|
416
417
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
417
418
|
*/
|
|
418
|
-
exports.MaskedTextBoxPropsContext = kendo_react_common_1.createPropsContext();
|
|
419
|
+
exports.MaskedTextBoxPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
419
420
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
420
421
|
/**
|
|
421
422
|
* Represents the props of the [KendoReact MaskedTextBox component]({% slug overview_maskedtextbox %}).
|
|
@@ -423,5 +424,5 @@ exports.MaskedTextBoxPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
423
424
|
* Accepts properties of type [MaskedTextBoxProps]({% slug api_inputs_maskedtextboxprops %}).
|
|
424
425
|
* Obtaining the `ref` returns an object of type [MaskedTextBoxHandle]({% slug api_inputs_maskedtextboxhandle %}).
|
|
425
426
|
*/
|
|
426
|
-
exports.MaskedTextBox = kendo_react_common_1.withPropsContext(exports.MaskedTextBoxPropsContext, MaskedTextBoxWithoutContext);
|
|
427
|
+
exports.MaskedTextBox = (0, kendo_react_common_1.withPropsContext)(exports.MaskedTextBoxPropsContext, MaskedTextBoxWithoutContext);
|
|
427
428
|
exports.MaskedTextBox.displayName = 'KendoReactMaskedTextBox';
|
|
@@ -30,7 +30,7 @@ var MaskingService = /** @class */ (function () {
|
|
|
30
30
|
MaskingService.prototype.validationValue = function (maskedValue) {
|
|
31
31
|
if (maskedValue === void 0) { maskedValue = ''; }
|
|
32
32
|
var value = maskedValue;
|
|
33
|
-
combinators_1.sequence(this.validationTokens)
|
|
33
|
+
(0, combinators_1.sequence)(this.validationTokens)
|
|
34
34
|
.run(maskedValue)
|
|
35
35
|
.fold(function (unmasked) {
|
|
36
36
|
value = unmasked.join('');
|
|
@@ -43,7 +43,7 @@ var MaskingService = /** @class */ (function () {
|
|
|
43
43
|
if (!this.rawTokens.length) {
|
|
44
44
|
return value;
|
|
45
45
|
}
|
|
46
|
-
combinators_1.sequence(this.rawTokens)
|
|
46
|
+
(0, combinators_1.sequence)(this.rawTokens)
|
|
47
47
|
.run(maskedValue)
|
|
48
48
|
.fold(function (unmasked) {
|
|
49
49
|
value = unmasked.join('');
|
|
@@ -59,7 +59,7 @@ var MaskingService = /** @class */ (function () {
|
|
|
59
59
|
if (!this.maskTokens.length) {
|
|
60
60
|
return value;
|
|
61
61
|
}
|
|
62
|
-
combinators_1.sequence(this.maskTokens)
|
|
62
|
+
(0, combinators_1.sequence)(this.maskTokens)
|
|
63
63
|
.run(rawValue)
|
|
64
64
|
.fold(function (masked) {
|
|
65
65
|
value = masked.join('');
|
|
@@ -77,7 +77,7 @@ var MaskingService = /** @class */ (function () {
|
|
|
77
77
|
var selection = end;
|
|
78
78
|
var beforeChange = oldValue.split('').slice(0, start);
|
|
79
79
|
var afterChange = oldValue.split('').slice(end);
|
|
80
|
-
combinators_1.sequence(this.maskTokens.slice(start, end))
|
|
80
|
+
(0, combinators_1.sequence)(this.maskTokens.slice(start, end))
|
|
81
81
|
.run(pasted)
|
|
82
82
|
.fold(function (masked) {
|
|
83
83
|
value = beforeChange
|
|
@@ -97,7 +97,7 @@ var MaskingService = /** @class */ (function () {
|
|
|
97
97
|
var unchanged = input.split('').slice(splitPoint);
|
|
98
98
|
var changed = input.split('').slice(0, splitPoint).join('');
|
|
99
99
|
var take = this.maskTokens.length - (input.length - splitPoint);
|
|
100
|
-
combinators_1.sequence(this.maskTokens.slice(0, take))
|
|
100
|
+
(0, combinators_1.sequence)(this.maskTokens.slice(0, take))
|
|
101
101
|
.run(changed, control)
|
|
102
102
|
.fold(function (masked) {
|
|
103
103
|
selection = _this.adjustPosition(masked, selection);
|
|
@@ -121,12 +121,12 @@ var MaskingService = /** @class */ (function () {
|
|
|
121
121
|
var value = '';
|
|
122
122
|
var selection = splitPoint;
|
|
123
123
|
var changed = input.slice(0, splitPoint);
|
|
124
|
-
combinators_1.sequence(this.unmaskTokens)
|
|
124
|
+
(0, combinators_1.sequence)(this.unmaskTokens)
|
|
125
125
|
.run(changed, control)
|
|
126
126
|
.chain(function (unmasked) {
|
|
127
127
|
selection = unmasked.join('').length;
|
|
128
128
|
var unchanged = control.slice(selection);
|
|
129
|
-
return combinators_1.sequence(_this.maskTokens)
|
|
129
|
+
return (0, combinators_1.sequence)(_this.maskTokens)
|
|
130
130
|
.run(unmasked.join('') + unchanged, control);
|
|
131
131
|
})
|
|
132
132
|
.fold(function (masked) {
|
|
@@ -141,8 +141,8 @@ var MaskingService = /** @class */ (function () {
|
|
|
141
141
|
get: function () {
|
|
142
142
|
var _a = this, prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder;
|
|
143
143
|
return {
|
|
144
|
-
literal: function (rule) { return parsers_1.literal(rule); },
|
|
145
|
-
mask: function (rule) { return parsers_1.mask({ prompt: prompt, promptPlaceholder: promptPlaceholder })(rule); }
|
|
144
|
+
literal: function (rule) { return (0, parsers_1.literal)(rule); },
|
|
145
|
+
mask: function (rule) { return (0, parsers_1.mask)({ prompt: prompt, promptPlaceholder: promptPlaceholder })(rule); }
|
|
146
146
|
};
|
|
147
147
|
},
|
|
148
148
|
enumerable: false,
|
|
@@ -152,8 +152,8 @@ var MaskingService = /** @class */ (function () {
|
|
|
152
152
|
get: function () {
|
|
153
153
|
var _this = this;
|
|
154
154
|
return {
|
|
155
|
-
literal: function (rule) { return parsers_1.unliteral(rule); },
|
|
156
|
-
mask: function (rule) { return parsers_1.unmask(_this.prompt)(rule); }
|
|
155
|
+
literal: function (rule) { return (0, parsers_1.unliteral)(rule); },
|
|
156
|
+
mask: function (rule) { return (0, parsers_1.unmask)(_this.prompt)(rule); }
|
|
157
157
|
};
|
|
158
158
|
},
|
|
159
159
|
enumerable: false,
|
|
@@ -163,8 +163,8 @@ var MaskingService = /** @class */ (function () {
|
|
|
163
163
|
get: function () {
|
|
164
164
|
var _a = this, prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder, includeLiterals = _a.includeLiterals;
|
|
165
165
|
return {
|
|
166
|
-
literal: function (_) { return parsers_1.rawLiteral(includeLiterals); },
|
|
167
|
-
mask: function (_) { return parsers_1.rawMask({ prompt: prompt, promptPlaceholder: promptPlaceholder }); }
|
|
166
|
+
literal: function (_) { return (0, parsers_1.rawLiteral)(includeLiterals); },
|
|
167
|
+
mask: function (_) { return (0, parsers_1.rawMask)({ prompt: prompt, promptPlaceholder: promptPlaceholder }); }
|
|
168
168
|
};
|
|
169
169
|
},
|
|
170
170
|
enumerable: false,
|
|
@@ -174,8 +174,8 @@ var MaskingService = /** @class */ (function () {
|
|
|
174
174
|
get: function () {
|
|
175
175
|
var prompt = this.prompt;
|
|
176
176
|
return {
|
|
177
|
-
literal: function (_) { return parsers_1.rawLiteral(false); },
|
|
178
|
-
mask: function (_) { return parsers_1.rawMask({ prompt: prompt, promptPlaceholder: '' }); }
|
|
177
|
+
literal: function (_) { return (0, parsers_1.rawLiteral)(false); },
|
|
178
|
+
mask: function (_) { return (0, parsers_1.rawMask)({ prompt: prompt, promptPlaceholder: '' }); }
|
|
179
179
|
};
|
|
180
180
|
},
|
|
181
181
|
enumerable: false,
|
|
@@ -183,22 +183,22 @@ var MaskingService = /** @class */ (function () {
|
|
|
183
183
|
});
|
|
184
184
|
MaskingService.prototype.tokenize = function () {
|
|
185
185
|
var _this = this;
|
|
186
|
-
combinators_1.greedy(parsers_1.token(this.rules, this.maskTokenCreator))
|
|
186
|
+
(0, combinators_1.greedy)((0, parsers_1.token)(this.rules, this.maskTokenCreator))
|
|
187
187
|
.run(this.mask)
|
|
188
188
|
.fold(function (tokens, _) {
|
|
189
189
|
_this.maskTokens = tokens;
|
|
190
190
|
});
|
|
191
|
-
combinators_1.greedy(parsers_1.token(this.rules, this.unmaskTokenCreator))
|
|
191
|
+
(0, combinators_1.greedy)((0, parsers_1.token)(this.rules, this.unmaskTokenCreator))
|
|
192
192
|
.run(this.mask)
|
|
193
193
|
.fold(function (tokens, _) {
|
|
194
194
|
_this.unmaskTokens = tokens;
|
|
195
195
|
});
|
|
196
|
-
combinators_1.greedy(parsers_1.token(this.rules, this.rawTokenCreator))
|
|
196
|
+
(0, combinators_1.greedy)((0, parsers_1.token)(this.rules, this.rawTokenCreator))
|
|
197
197
|
.run(this.mask)
|
|
198
198
|
.fold(function (tokens, _) {
|
|
199
199
|
_this.rawTokens = tokens;
|
|
200
200
|
});
|
|
201
|
-
combinators_1.greedy(parsers_1.token(this.rules, this.validationTokenCreator))
|
|
201
|
+
(0, combinators_1.greedy)((0, parsers_1.token)(this.rules, this.validationTokenCreator))
|
|
202
202
|
.run(this.mask)
|
|
203
203
|
.fold(function (tokens, _) {
|
|
204
204
|
_this.validationTokens = tokens;
|
|
@@ -35,7 +35,7 @@ var Result = /** @class */ (function () {
|
|
|
35
35
|
return this.map(function (vs, _) { return r.chain(function (v, __) { return vs.concat([v]); }); });
|
|
36
36
|
};
|
|
37
37
|
Result.prototype.toString = function () {
|
|
38
|
-
return "Result({ value: '"
|
|
38
|
+
return "Result({ value: '".concat(this.value, "', rest: ").concat(this.rest, " })");
|
|
39
39
|
};
|
|
40
40
|
return Result;
|
|
41
41
|
}());
|
|
@@ -11,4 +11,4 @@ export declare const NumericTextBoxPropsContext: React.Context<(p: NumericTextBo
|
|
|
11
11
|
/**
|
|
12
12
|
* Represents the [KendoReact NumericTextBox component]({% slug overview_numerictextbox %}).
|
|
13
13
|
*/
|
|
14
|
-
export declare const NumericTextBox: React.ForwardRefExoticComponent<NumericTextBoxProps & React.RefAttributes<NumericTextBoxHandle>>;
|
|
14
|
+
export declare const NumericTextBox: React.ForwardRefExoticComponent<NumericTextBoxProps & React.RefAttributes<NumericTextBoxHandle | null>>;
|
|
@@ -29,28 +29,28 @@ var VALIDATION_MESSAGE = 'Please enter a valid value!';
|
|
|
29
29
|
*
|
|
30
30
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
31
31
|
*/
|
|
32
|
-
exports.NumericTextBoxPropsContext = kendo_react_common_1.createPropsContext();
|
|
32
|
+
exports.NumericTextBoxPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
33
33
|
/**
|
|
34
34
|
* Represents the [KendoReact NumericTextBox component]({% slug overview_numerictextbox %}).
|
|
35
35
|
*/
|
|
36
36
|
exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
37
37
|
var _a;
|
|
38
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
39
|
-
var props = kendo_react_common_1.usePropsContext(exports.NumericTextBoxPropsContext, directProps);
|
|
40
|
-
var calculatedId = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
|
|
38
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
39
|
+
var props = (0, kendo_react_common_1.usePropsContext)(exports.NumericTextBoxPropsContext, directProps);
|
|
40
|
+
var calculatedId = React.useMemo(function () { return (0, kendo_react_common_1.guid)(); }, []);
|
|
41
41
|
var inputId = props.id || calculatedId;
|
|
42
|
-
var intlService = kendo_react_intl_1.useInternationalization();
|
|
43
|
-
var localizationService = kendo_react_intl_1.useLocalization();
|
|
42
|
+
var intlService = (0, kendo_react_intl_1.useInternationalization)();
|
|
43
|
+
var localizationService = (0, kendo_react_intl_1.useLocalization)();
|
|
44
44
|
var elementRef = React.useRef(null);
|
|
45
45
|
var valueDuringChangeRef = React.useRef();
|
|
46
46
|
var _b = React.useState(false), forceUpdate = _b[0], setForceUpdate = _b[1];
|
|
47
|
-
var stateRef = React.useRef(utils_1.getInitialState());
|
|
47
|
+
var stateRef = React.useRef((0, utils_1.getInitialState)());
|
|
48
48
|
var isPasteRef = React.useRef(false);
|
|
49
49
|
var prevLooseValueRef = React.useRef();
|
|
50
50
|
var stateValueRef = React.useRef(props.defaultValue);
|
|
51
|
-
var looseValue = utils_1.formatValue(stateRef.current.focused && !props.disabled ?
|
|
51
|
+
var looseValue = (0, utils_1.formatValue)(stateRef.current.focused && !props.disabled ?
|
|
52
52
|
stateRef.current.currentLooseValue :
|
|
53
|
-
utils_1.getStateOrPropsValue(props.value, stateValueRef.current), props.format, intlService);
|
|
53
|
+
(0, utils_1.getStateOrPropsValue)(props.value, stateValueRef.current), props.format, intlService);
|
|
54
54
|
prevLooseValueRef.current = looseValue;
|
|
55
55
|
React.useEffect(function () {
|
|
56
56
|
if (elementRef.current && elementRef.current.setCustomValidity) {
|
|
@@ -69,7 +69,7 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
69
69
|
return valueDuringChangeRef.current;
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
|
-
return utils_1.getStateOrPropsValue(props.value, stateValueRef.current);
|
|
72
|
+
return (0, utils_1.getStateOrPropsValue)(props.value, stateValueRef.current);
|
|
73
73
|
}
|
|
74
74
|
}, [props.value]);
|
|
75
75
|
var nameGetter = React.useCallback(function () {
|
|
@@ -113,7 +113,7 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
113
113
|
React.useImperativeHandle(target, getImperativeHandle);
|
|
114
114
|
var getCurrentState = React.useCallback(function () {
|
|
115
115
|
return {
|
|
116
|
-
eventValue: utils_1.getStateOrPropsValue(props.value, stateValueRef.current),
|
|
116
|
+
eventValue: (0, utils_1.getStateOrPropsValue)(props.value, stateValueRef.current),
|
|
117
117
|
prevLooseValue: prevLooseValueRef.current,
|
|
118
118
|
currentLooseValue: elementRef.current.value,
|
|
119
119
|
selectionStart: elementRef.current.selectionStart,
|
|
@@ -131,8 +131,8 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
131
131
|
}
|
|
132
132
|
valueDuringChangeRef.current = newState.eventValue;
|
|
133
133
|
stateValueRef.current = newState.eventValue;
|
|
134
|
-
var formattedValue = utils_1.formatValue(utils_1.rangeValue(newState.eventValue, props.min, props.max), props.format, intlService);
|
|
135
|
-
var rangedValue = utils_1.rangeValue(intlService.parseNumber(formattedValue, props.format), props.min, props.max);
|
|
134
|
+
var formattedValue = (0, utils_1.formatValue)((0, utils_1.rangeValue)(newState.eventValue, props.min, props.max), props.format, intlService);
|
|
135
|
+
var rangedValue = (0, utils_1.rangeValue)(intlService.parseNumber(formattedValue, props.format), props.min, props.max);
|
|
136
136
|
if (rangedValue !== newState.eventValue) {
|
|
137
137
|
newState.valueIsOutOfRange = true;
|
|
138
138
|
newState.eventValue = rangedValue;
|
|
@@ -140,7 +140,7 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
140
140
|
}
|
|
141
141
|
var shouldFireEvent = props.value !== newState.eventValue;
|
|
142
142
|
if (shouldFireEvent) {
|
|
143
|
-
kendo_react_common_1.dispatchEvent(props.onChange, event, getImperativeHandle(), { value: newState.eventValue });
|
|
143
|
+
(0, kendo_react_common_1.dispatchEvent)(props.onChange, event, getImperativeHandle(), { value: newState.eventValue });
|
|
144
144
|
}
|
|
145
145
|
valueDuringChangeRef.current = undefined;
|
|
146
146
|
stateRef.current = newState;
|
|
@@ -149,7 +149,7 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
149
149
|
var onChangeHandler = React.useCallback(function (event) {
|
|
150
150
|
var stateCandidate = getCurrentState();
|
|
151
151
|
isPasteRef.current = false;
|
|
152
|
-
triggerChange(event, utils_1.sanitizeNumber(stateCandidate, props.format, intlService));
|
|
152
|
+
triggerChange(event, (0, utils_1.sanitizeNumber)(stateCandidate, props.format, intlService));
|
|
153
153
|
}, [props.format, props.onChange, intlService, triggerChange, getCurrentState]);
|
|
154
154
|
var onKeyDown = React.useCallback(function (event) {
|
|
155
155
|
var newState = getCurrentState();
|
|
@@ -163,21 +163,21 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
163
163
|
switch (event.keyCode) {
|
|
164
164
|
case 38:
|
|
165
165
|
// Arrow up
|
|
166
|
-
utils_1.increaseValue(currentValue, newState, props.step, props.min, props.max, props.format, intlService);
|
|
166
|
+
(0, utils_1.increaseValue)(currentValue, newState, props.step, props.min, props.max, props.format, intlService);
|
|
167
167
|
break;
|
|
168
168
|
case 40:
|
|
169
169
|
// Arrow down
|
|
170
|
-
utils_1.decreaseValue(currentValue, newState, props.step, props.min, props.max, props.format, intlService);
|
|
170
|
+
(0, utils_1.decreaseValue)(currentValue, newState, props.step, props.min, props.max, props.format, intlService);
|
|
171
171
|
break;
|
|
172
172
|
case 13:
|
|
173
173
|
// Enter - range values
|
|
174
174
|
if (props.rangeOnEnter === false) {
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
var formattedValue = utils_1.formatValue(utils_1.rangeValue(currentValue, props.min, props.max), props.format, intlService);
|
|
178
|
-
var rangedValue = utils_1.rangeValue(intlService.parseNumber(formattedValue, props.format), props.min, props.max);
|
|
177
|
+
var formattedValue = (0, utils_1.formatValue)((0, utils_1.rangeValue)(currentValue, props.min, props.max), props.format, intlService);
|
|
178
|
+
var rangedValue = (0, utils_1.rangeValue)(intlService.parseNumber(formattedValue, props.format), props.min, props.max);
|
|
179
179
|
newState.eventValue = rangedValue;
|
|
180
|
-
newState.currentLooseValue = utils_1.formatValue(rangedValue, props.format, intlService);
|
|
180
|
+
newState.currentLooseValue = (0, utils_1.formatValue)(rangedValue, props.format, intlService);
|
|
181
181
|
newState.selectionStart = newState.selectionEnd = newState.currentLooseValue.length;
|
|
182
182
|
break;
|
|
183
183
|
case 110:
|
|
@@ -189,7 +189,7 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
189
189
|
symbols.decimal +
|
|
190
190
|
newState.currentLooseValue.slice(newState.selectionEnd);
|
|
191
191
|
newState.selectionStart = newState.selectionEnd = newState.selectionStart + 1;
|
|
192
|
-
newState = utils_1.sanitizeNumber(newState, props.format, intlService);
|
|
192
|
+
newState = (0, utils_1.sanitizeNumber)(newState, props.format, intlService);
|
|
193
193
|
}
|
|
194
194
|
break;
|
|
195
195
|
default:
|
|
@@ -207,7 +207,7 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
var newState = getCurrentState();
|
|
210
|
-
utils_1.increaseValue(intlService.parseNumber(String(newState.currentLooseValue), props.format), newState, props.step, props.min, props.max, props.format, intlService);
|
|
210
|
+
(0, utils_1.increaseValue)(intlService.parseNumber(String(newState.currentLooseValue), props.format), newState, props.step, props.min, props.max, props.format, intlService);
|
|
211
211
|
triggerChange(event, newState);
|
|
212
212
|
}, [props.format, props.min, props.max, props.step, props.onChange, props.readOnly, props.disabled, triggerChange, getCurrentState]);
|
|
213
213
|
var onDecrease = React.useCallback(function (event) {
|
|
@@ -216,7 +216,7 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
218
|
var newState = getCurrentState();
|
|
219
|
-
utils_1.decreaseValue(intlService.parseNumber(String(newState.currentLooseValue), props.format), newState, props.step, props.min, props.max, props.format, intlService);
|
|
219
|
+
(0, utils_1.decreaseValue)(intlService.parseNumber(String(newState.currentLooseValue), props.format), newState, props.step, props.min, props.max, props.format, intlService);
|
|
220
220
|
triggerChange(event, newState);
|
|
221
221
|
}, [props.format, props.min, props.max, props.step, props.onChange, props.readOnly, props.disabled, triggerChange, getCurrentState]);
|
|
222
222
|
var onWheelHandler = React.useCallback(function (event) {
|
|
@@ -237,12 +237,12 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
237
237
|
var onFocus = React.useCallback(function (event) {
|
|
238
238
|
stateRef.current.currentLooseValue = prevLooseValueRef.current;
|
|
239
239
|
stateRef.current.focused = true;
|
|
240
|
-
kendo_react_common_1.dispatchEvent(props.onFocus, event, getImperativeHandle(), {});
|
|
240
|
+
(0, kendo_react_common_1.dispatchEvent)(props.onFocus, event, getImperativeHandle(), {});
|
|
241
241
|
setForceUpdate(function (x) { return !x; });
|
|
242
242
|
}, [props.onFocus, setForceUpdate, getImperativeHandle]);
|
|
243
243
|
var onBlur = React.useCallback(function (event) {
|
|
244
|
-
stateRef.current = utils_1.getInitialState();
|
|
245
|
-
kendo_react_common_1.dispatchEvent(props.onBlur, event, getImperativeHandle(), {});
|
|
244
|
+
stateRef.current = (0, utils_1.getInitialState)();
|
|
245
|
+
(0, kendo_react_common_1.dispatchEvent)(props.onBlur, event, getImperativeHandle(), {});
|
|
246
246
|
setForceUpdate(function (x) { return !x; });
|
|
247
247
|
}, [props.onBlur, setForceUpdate, getImperativeHandle]);
|
|
248
248
|
var onMouseDown = React.useCallback(function (e) {
|
|
@@ -263,15 +263,15 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
263
263
|
}, [forceUpdate]);
|
|
264
264
|
var isValid = !validityStylesGetter() || validityGetter().valid;
|
|
265
265
|
var numerictextbox = (React.createElement("span", { dir: props.dir, style: !props.label
|
|
266
|
-
? __assign({ width: props.width }, props.style) : props.style, className: kendo_react_common_1.classNames('k-input', 'k-numerictextbox', (_a = {},
|
|
267
|
-
_a["k-input-"
|
|
268
|
-
_a["k-input-"
|
|
269
|
-
_a["k-rounded-"
|
|
266
|
+
? __assign({ width: props.width }, props.style) : props.style, className: (0, kendo_react_common_1.classNames)('k-input', 'k-numerictextbox', (_a = {},
|
|
267
|
+
_a["k-input-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[props.size] || props.size)] = props.size,
|
|
268
|
+
_a["k-input-".concat(props.fillMode)] = props.fillMode,
|
|
269
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[props.rounded] || props.rounded)] = props.rounded,
|
|
270
270
|
_a['k-invalid'] = !isValid,
|
|
271
271
|
_a['k-required'] = props.required,
|
|
272
272
|
_a['k-disabled'] = props.disabled,
|
|
273
273
|
_a), props.className), "aria-disabled": props.disabled ? 'true' : undefined },
|
|
274
|
-
React.createElement("input", { value: looseValue === null ? '' : looseValue, tabIndex: kendo_react_common_1.getTabIndex(props.tabIndex, props.disabled), accessKey: props.accessKey, disabled: props.disabled, title: props.title, "aria-valuemin": props.min, "aria-valuemax": props.max, "aria-label": props.ariaLabel, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, placeholder: props.placeholder, spellCheck: false, autoComplete: 'off', autoCorrect: 'off', type: props.inputType || 'tel', className: 'k-input-inner', id: inputId, name: props.name, readOnly: props.readOnly, style: props.inputStyle, onChange: onChangeHandler, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onPaste: onPasteHandler, onWheel: onWheelHandler, ref: elementRef }),
|
|
274
|
+
React.createElement("input", { value: looseValue === null ? '' : looseValue, tabIndex: (0, kendo_react_common_1.getTabIndex)(props.tabIndex, props.disabled), accessKey: props.accessKey, disabled: props.disabled, title: props.title, "aria-valuemin": props.min, "aria-valuemax": props.max, "aria-label": props.ariaLabel, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, placeholder: props.placeholder, spellCheck: false, autoComplete: 'off', autoCorrect: 'off', type: props.inputType || 'tel', className: 'k-input-inner', id: inputId, name: props.name, readOnly: props.readOnly, style: props.inputStyle, onChange: onChangeHandler, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onPaste: onPasteHandler, onWheel: onWheelHandler, ref: elementRef }),
|
|
275
275
|
props.children,
|
|
276
276
|
props.spinners &&
|
|
277
277
|
(React.createElement("span", { className: "k-input-spinner k-spin-button", onMouseDown: onMouseDown },
|