@progress/kendo-react-inputs 7.2.4-develop.3 → 7.3.0-develop.1
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/checkbox/Checkbox.js +8 -0
- package/checkbox/Checkbox.mjs +214 -0
- package/colors/ColorContrastLabels.js +8 -0
- package/colors/ColorContrastLabels.mjs +24 -0
- package/colors/ColorContrastSvg.js +8 -0
- package/colors/ColorContrastSvg.mjs +52 -0
- package/colors/ColorGradient.js +8 -0
- package/colors/ColorGradient.mjs +293 -0
- package/colors/ColorInput.js +8 -0
- package/colors/ColorInput.mjs +122 -0
- package/colors/ColorPalette.js +8 -0
- package/colors/ColorPalette.mjs +191 -0
- package/colors/ColorPicker.js +8 -0
- package/colors/ColorPicker.mjs +253 -0
- package/colors/FlatColorPicker.js +8 -0
- package/colors/FlatColorPicker.mjs +216 -0
- package/colors/HexInput.js +8 -0
- package/colors/HexInput.mjs +39 -0
- package/colors/Picker.js +8 -0
- package/colors/Picker.mjs +42 -0
- package/colors/models/palette-presets.js +8 -0
- package/colors/models/palette-presets.mjs +61 -0
- package/colors/utils/color-cache.js +8 -0
- package/colors/utils/color-cache.mjs +51 -0
- package/colors/utils/color-palette.service.js +8 -0
- package/colors/utils/color-palette.service.mjs +50 -0
- package/colors/utils/color-parser.js +8 -0
- package/colors/utils/color-parser.mjs +61 -0
- package/colors/utils/misc.js +8 -0
- package/colors/utils/misc.mjs +13 -0
- package/colors/utils/svg-calc.js +8 -0
- package/colors/utils/svg-calc.mjs +36 -0
- package/dist/cdn/js/kendo-react-inputs.js +8 -21
- package/index.d.mts +4275 -5
- package/index.d.ts +4275 -75
- package/index.js +8 -21
- package/index.mjs +97 -5042
- package/input/Input.js +8 -0
- package/input/Input.mjs +185 -0
- package/input/InputClearValue.js +8 -0
- package/input/InputClearValue.mjs +24 -0
- package/input/InputPrefix.js +8 -0
- package/input/InputPrefix.mjs +24 -0
- package/input/InputSeparator.js +8 -0
- package/input/InputSeparator.mjs +24 -0
- package/input/InputSuffix.js +8 -0
- package/input/InputSuffix.mjs +24 -0
- package/input/InputValidationIcon.js +8 -0
- package/input/InputValidationIcon.mjs +15 -0
- package/maskedtextbox/MaskedTextBox.js +8 -0
- package/maskedtextbox/MaskedTextBox.mjs +322 -0
- package/maskedtextbox/masking.service.js +8 -0
- package/maskedtextbox/masking.service.mjs +121 -0
- package/maskedtextbox/parsing/combinators.js +8 -0
- package/maskedtextbox/parsing/combinators.mjs +20 -0
- package/maskedtextbox/parsing/parsers.js +8 -0
- package/maskedtextbox/parsing/parsers.mjs +80 -0
- package/maskedtextbox/parsing/result.js +8 -0
- package/maskedtextbox/parsing/result.mjs +35 -0
- package/maskedtextbox/parsing/stream.js +8 -0
- package/maskedtextbox/parsing/stream.mjs +41 -0
- package/maskedtextbox/utils.js +8 -0
- package/maskedtextbox/utils.mjs +43 -0
- package/messages/index.js +8 -0
- package/messages/index.mjs +77 -0
- package/numerictextbox/NumericTextBox.js +8 -0
- package/numerictextbox/NumericTextBox.mjs +415 -0
- package/numerictextbox/utils/index.js +8 -0
- package/numerictextbox/utils/index.mjs +218 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +8 -0
- package/radiobutton/RadioButton.mjs +138 -0
- package/radiobutton/RadioGroup.js +8 -0
- package/radiobutton/RadioGroup.mjs +135 -0
- package/range-slider/RangeSlider.js +20 -0
- package/range-slider/RangeSlider.mjs +337 -0
- package/range-slider/range-raducer.js +8 -0
- package/range-slider/range-raducer.mjs +90 -0
- package/rating/Rating.js +12 -0
- package/rating/Rating.mjs +323 -0
- package/rating/RatingItem.js +8 -0
- package/rating/RatingItem.mjs +144 -0
- package/rating/rating-reducer.js +8 -0
- package/rating/rating-reducer.mjs +34 -0
- package/rating/utils/index.js +8 -0
- package/rating/utils/index.mjs +28 -0
- package/signature/Signature.js +8 -0
- package/signature/Signature.mjs +335 -0
- package/signature/utils/index.js +8 -0
- package/signature/utils/index.mjs +17 -0
- package/slider/Slider.js +8 -0
- package/slider/Slider.mjs +223 -0
- package/slider/SliderLabel.js +8 -0
- package/slider/SliderLabel.mjs +39 -0
- package/switch/Switch.js +8 -0
- package/switch/Switch.mjs +228 -0
- package/textarea/TextArea.js +8 -0
- package/textarea/TextArea.mjs +196 -0
- package/textbox/Textbox.js +8 -0
- package/textbox/Textbox.mjs +125 -0
- package/checkbox/Checkbox.d.ts +0 -36
- package/checkbox/interfaces/CheckboxBlurEvent.d.ts +0 -11
- package/checkbox/interfaces/CheckboxChangeEvent.d.ts +0 -15
- package/checkbox/interfaces/CheckboxFocusEvent.d.ts +0 -11
- package/checkbox/interfaces/CheckboxProps.d.ts +0 -126
- package/colors/ColorContrastLabels.d.ts +0 -19
- package/colors/ColorContrastSvg.d.ts +0 -22
- package/colors/ColorGradient.d.ts +0 -191
- package/colors/ColorInput.d.ts +0 -34
- package/colors/ColorPalette.d.ts +0 -127
- package/colors/ColorPicker.d.ts +0 -34
- package/colors/FlatColorPicker.d.ts +0 -139
- package/colors/HexInput.d.ts +0 -33
- package/colors/Picker.d.ts +0 -10
- package/colors/interfaces/ColorGradientChangeEvent.d.ts +0 -15
- package/colors/interfaces/ColorGradientProps.d.ts +0 -101
- package/colors/interfaces/ColorPaletteChangeEvent.d.ts +0 -19
- package/colors/interfaces/ColorPaletteProps.d.ts +0 -87
- package/colors/interfaces/ColorPickerActiveColorClick.d.ts +0 -21
- package/colors/interfaces/ColorPickerBlurEvent.d.ts +0 -17
- package/colors/interfaces/ColorPickerChangeEvent.d.ts +0 -21
- package/colors/interfaces/ColorPickerFocusEvent.d.ts +0 -17
- package/colors/interfaces/ColorPickerGradientSettings.d.ts +0 -22
- package/colors/interfaces/ColorPickerPaletteSettings.d.ts +0 -36
- package/colors/interfaces/ColorPickerPopupSettings.d.ts +0 -18
- package/colors/interfaces/ColorPickerProps.d.ts +0 -165
- package/colors/interfaces/ColorPickerView.d.ts +0 -14
- package/colors/interfaces/PickerPopupSettings.d.ts +0 -22
- package/colors/interfaces/PickerProps.d.ts +0 -46
- package/colors/models/hsva.d.ts +0 -13
- package/colors/models/output-format.d.ts +0 -8
- package/colors/models/palette-presets.d.ts +0 -57
- package/colors/models/rgb.d.ts +0 -12
- package/colors/models/rgba.d.ts +0 -13
- package/colors/models/table-cell.d.ts +0 -11
- package/colors/models/tile-size.d.ts +0 -15
- package/colors/utils/color-cache.d.ts +0 -34
- package/colors/utils/color-palette.service.d.ts +0 -16
- package/colors/utils/color-parser.d.ts +0 -69
- package/colors/utils/misc.d.ts +0 -19
- package/colors/utils/svg-calc.d.ts +0 -66
- package/input/Input.d.ts +0 -171
- package/input/InputClearValue.d.ts +0 -19
- package/input/InputPrefix.d.ts +0 -29
- package/input/InputSeparator.d.ts +0 -29
- package/input/InputSuffix.d.ts +0 -29
- package/input/InputValidationIcon.d.ts +0 -18
- package/input/interfaces/InputChangeEvent.d.ts +0 -15
- package/interfaces/Direction.d.ts +0 -5
- package/interfaces/ToggleBaseProps.d.ts +0 -12
- package/maskedtextbox/MaskedTextBox.d.ts +0 -238
- package/maskedtextbox/MaskedTextBoxProps.d.ts +0 -200
- package/maskedtextbox/masking.service.d.ts +0 -45
- package/maskedtextbox/parsing/combinators.d.ts +0 -13
- package/maskedtextbox/parsing/parsers.d.ts +0 -51
- package/maskedtextbox/parsing/result.d.ts +0 -27
- package/maskedtextbox/parsing/stream.d.ts +0 -26
- package/maskedtextbox/utils.d.ts +0 -20
- package/messages/index.d.ts +0 -169
- package/numerictextbox/NumericTextBox.d.ts +0 -18
- package/numerictextbox/interfaces/NumericTextBoxBlurEvent.d.ts +0 -11
- package/numerictextbox/interfaces/NumericTextBoxChangeEvent.d.ts +0 -15
- package/numerictextbox/interfaces/NumericTextBoxFocusEvent.d.ts +0 -11
- package/numerictextbox/interfaces/NumericTextBoxHandle.d.ts +0 -43
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +0 -188
- package/numerictextbox/interfaces/NumericTextBoxState.d.ts +0 -19
- package/numerictextbox/utils/index.d.ts +0 -123
- package/package-metadata.d.ts +0 -9
- package/radiobutton/RadioButton.d.ts +0 -27
- package/radiobutton/RadioGroup.d.ts +0 -27
- package/radiobutton/interfaces/RadioButtonBlurEvent.d.ts +0 -11
- package/radiobutton/interfaces/RadioButtonChangeEvent.d.ts +0 -15
- package/radiobutton/interfaces/RadioButtonFocusEvent.d.ts +0 -11
- package/radiobutton/interfaces/RadioButtonProps.d.ts +0 -101
- package/radiobutton/interfaces/RadioGroupChangeEvent.d.ts +0 -15
- package/radiobutton/interfaces/RadioGroupFocusEvent.d.ts +0 -11
- package/radiobutton/interfaces/RadioGroupProps.d.ts +0 -90
- package/range-slider/RangeSlider.d.ts +0 -142
- package/range-slider/range-raducer.d.ts +0 -40
- package/rating/Rating.d.ts +0 -170
- package/rating/RatingItem.d.ts +0 -108
- package/rating/models/index.d.ts +0 -88
- package/rating/rating-reducer.d.ts +0 -36
- package/rating/utils/index.d.ts +0 -28
- package/signature/Signature.d.ts +0 -18
- package/signature/interfaces/SignatureBlurEvent.d.ts +0 -11
- package/signature/interfaces/SignatureChangeEvent.d.ts +0 -15
- package/signature/interfaces/SignatureCloseEvent.d.ts +0 -11
- package/signature/interfaces/SignatureFocusEvent.d.ts +0 -11
- package/signature/interfaces/SignatureHandle.d.ts +0 -46
- package/signature/interfaces/SignatureOpenEvent.d.ts +0 -11
- package/signature/interfaces/SignatureProps.d.ts +0 -198
- package/signature/interfaces/index.d.ts +0 -11
- package/signature/utils/index.d.ts +0 -8
- package/slider/Slider.d.ts +0 -197
- package/slider/SliderLabel.d.ts +0 -38
- package/switch/Switch.d.ts +0 -294
- package/textarea/TextArea.d.ts +0 -40
- package/textarea/interfaces/TextAreaBlurEvent.d.ts +0 -11
- package/textarea/interfaces/TextAreaChangeEvent.d.ts +0 -15
- package/textarea/interfaces/TextAreaFocusEvent.d.ts +0 -11
- package/textarea/interfaces/TextAreaProps.d.ts +0 -140
- package/textbox/Textbox.d.ts +0 -80
package/input/Input.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),a=require("prop-types"),n=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-labels"),k=require("../package-metadata.js");function O(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>l[t]})}}return e.default=l,Object.freeze(e)}const u=O(M),s=class s extends u.Component{constructor(e){super(e),this._input=null,this.focus=()=>{this._input&&this._input.focus()},this.isInvalid=t=>{let i=!1;for(let r in t)t.hasOwnProperty(r)&&(i=i||!!t[r]);return i},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&(this.validity.valid||!this.validityStyles?this._input.classList.remove("k-invalid"):this._input.classList.add("k-invalid"),this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||""))},this.handleChange=t=>{this.setState({value:t.target.value}),this.valueDuringOnChange=t.target.value,this.props.onChange&&this.props.onChange.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:t.target.value,target:this}),this.valueDuringOnChange=void 0},this.handleAutoFill=t=>{if(t.animationName==="autoFillStart"){let i=t.target.parentNode;i&&i.classList.contains("k-empty")&&i.classList.remove("k-empty")}},n.validatePackage(k.packageMetadata),this.state={value:this.props.defaultValue||s.defaultProps.defaultValue}}get _inputId(){return this.props.id}get element(){return this._input}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get name(){return this.props.name}get validity(){const e={badInput:this._input?this._input.validity.badInput:!1,patternMismatch:this._input?this._input.validity.patternMismatch:!1,rangeOverflow:this._input?this._input.validity.rangeOverflow:!1,rangeUnderflow:this._input?this._input.validity.rangeUnderflow:!1,stepMismatch:this._input?this._input.validity.stepMismatch:!1,tooLong:this._input?this._input.validity.tooLong:!1,typeMismatch:this._input?this._input.validity.typeMismatch:!1,valueMissing:this._input?this._input.validity.valueMissing:!1};return{...e,customError:this.props.validationMessage!==void 0,valid:this.props.valid!==void 0?this.props.valid:this._input?!this.isInvalid(e):!0}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:s.defaultProps.validityStyles}componentDidMount(){this.forceUpdate()}componentDidUpdate(){this.setValidity()}render(){const{className:e,label:t,labelClassName:i,id:r,validationMessage:P,defaultValue:I,valid:L,visited:D,touched:N,modified:V,ariaLabelledBy:f,ariaDescribedBy:m,validityStyles:w,style:p,ariaLabel:b,...d}=this.props,h=r||this._inputId,v=!this.validityStyles||this.validity.valid,_=n.classNames(e,"k-input k-input-md k-rounded-md k-input-solid"),c=u.createElement("input",{"aria-labelledby":f,"aria-describedby":m,"aria-disabled":this.props.disabled||void 0,"aria-invalid":!v||void 0,"aria-label":b||void 0,...d,style:t?void 0:p,value:this.value,id:h,className:_,onChange:this.handleChange,onAnimationStart:this.handleAutoFill,ref:C=>{this._input=C}});return t?u.createElement(S.FloatingLabel,{label:t,labelClassName:i,editorId:h,editorValue:String(this.value),editorValid:v,editorDisabled:d.disabled,editorPlaceholder:d.placeholder,children:c,style:p,dir:d.dir}):c}};s.displayName="Input",s.propTypes={label:a.string,labelClassName:a.string,validationMessage:a.string,required:a.bool,validate:a.bool,id:a.string,ariaLabelledBy:a.string,ariaDescribedBy:a.string,ariaLabel:a.string},s.defaultProps={defaultValue:"",required:!1,validityStyles:!0};let o=s;const g=n.createPropsContext(),y=n.withIdHOC(n.withPropsContext(g,o));y.displayName="KendoReactInput";exports.Input=y;exports.InputPropsContext=g;exports.InputWithoutContext=o;
|
package/input/Input.mjs
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as r from "react";
|
|
10
|
+
import a from "prop-types";
|
|
11
|
+
import { validatePackage as f, classNames as b, createPropsContext as _, withIdHOC as C, withPropsContext as M } from "@progress/kendo-react-common";
|
|
12
|
+
import { FloatingLabel as S } from "@progress/kendo-react-labels";
|
|
13
|
+
import { packageMetadata as L } from "../package-metadata.mjs";
|
|
14
|
+
const e = class e extends r.Component {
|
|
15
|
+
constructor(s) {
|
|
16
|
+
super(s), this._input = null, this.focus = () => {
|
|
17
|
+
this._input && this._input.focus();
|
|
18
|
+
}, this.isInvalid = (i) => {
|
|
19
|
+
let t = !1;
|
|
20
|
+
for (let l in i)
|
|
21
|
+
i.hasOwnProperty(l) && (t = t || !!i[l]);
|
|
22
|
+
return t;
|
|
23
|
+
}, this.setValidity = () => {
|
|
24
|
+
this._input && this._input.setCustomValidity && (this.validity.valid || !this.validityStyles ? this._input.classList.remove("k-invalid") : this._input.classList.add("k-invalid"), this._input.setCustomValidity(
|
|
25
|
+
this.validity.valid ? "" : this.props.validationMessage || ""
|
|
26
|
+
));
|
|
27
|
+
}, this.handleChange = (i) => {
|
|
28
|
+
this.setState({
|
|
29
|
+
value: i.target.value
|
|
30
|
+
}), this.valueDuringOnChange = i.target.value, this.props.onChange && this.props.onChange.call(void 0, {
|
|
31
|
+
syntheticEvent: i,
|
|
32
|
+
nativeEvent: i.nativeEvent,
|
|
33
|
+
value: i.target.value,
|
|
34
|
+
target: this
|
|
35
|
+
}), this.valueDuringOnChange = void 0;
|
|
36
|
+
}, this.handleAutoFill = (i) => {
|
|
37
|
+
if (i.animationName === "autoFillStart") {
|
|
38
|
+
let t = i.target.parentNode;
|
|
39
|
+
t && t.classList.contains("k-empty") && t.classList.remove("k-empty");
|
|
40
|
+
}
|
|
41
|
+
}, f(L), this.state = {
|
|
42
|
+
value: this.props.defaultValue || e.defaultProps.defaultValue
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
get _inputId() {
|
|
46
|
+
return this.props.id;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the native input element of the Input component.
|
|
50
|
+
*/
|
|
51
|
+
get element() {
|
|
52
|
+
return this._input;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Gets the value of the Input.
|
|
56
|
+
*/
|
|
57
|
+
get value() {
|
|
58
|
+
return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets the `name` property of the Input.
|
|
62
|
+
*/
|
|
63
|
+
get name() {
|
|
64
|
+
return this.props.name;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Represents the validity state into which the Input is set.
|
|
68
|
+
*/
|
|
69
|
+
get validity() {
|
|
70
|
+
const s = {
|
|
71
|
+
badInput: this._input ? this._input.validity.badInput : !1,
|
|
72
|
+
patternMismatch: this._input ? this._input.validity.patternMismatch : !1,
|
|
73
|
+
rangeOverflow: this._input ? this._input.validity.rangeOverflow : !1,
|
|
74
|
+
rangeUnderflow: this._input ? this._input.validity.rangeUnderflow : !1,
|
|
75
|
+
stepMismatch: this._input ? this._input.validity.stepMismatch : !1,
|
|
76
|
+
tooLong: this._input ? this._input.validity.tooLong : !1,
|
|
77
|
+
typeMismatch: this._input ? this._input.validity.typeMismatch : !1,
|
|
78
|
+
valueMissing: this._input ? this._input.validity.valueMissing : !1
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
...s,
|
|
82
|
+
customError: this.props.validationMessage !== void 0,
|
|
83
|
+
valid: this.props.valid !== void 0 ? this.props.valid : this._input ? !this.isInvalid(s) : !0
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @hidden
|
|
88
|
+
*/
|
|
89
|
+
get validityStyles() {
|
|
90
|
+
return this.props.validityStyles !== void 0 ? this.props.validityStyles : e.defaultProps.validityStyles;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @hidden
|
|
94
|
+
*/
|
|
95
|
+
componentDidMount() {
|
|
96
|
+
this.forceUpdate();
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @hidden
|
|
100
|
+
*/
|
|
101
|
+
componentDidUpdate() {
|
|
102
|
+
this.setValidity();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @hidden
|
|
106
|
+
*/
|
|
107
|
+
render() {
|
|
108
|
+
const {
|
|
109
|
+
className: s,
|
|
110
|
+
label: i,
|
|
111
|
+
labelClassName: t,
|
|
112
|
+
id: l,
|
|
113
|
+
validationMessage: N,
|
|
114
|
+
defaultValue: P,
|
|
115
|
+
valid: D,
|
|
116
|
+
// Removed to support direct use in Form Field component
|
|
117
|
+
visited: I,
|
|
118
|
+
touched: O,
|
|
119
|
+
modified: w,
|
|
120
|
+
ariaLabelledBy: v,
|
|
121
|
+
ariaDescribedBy: c,
|
|
122
|
+
validityStyles: E,
|
|
123
|
+
style: o,
|
|
124
|
+
ariaLabel: y,
|
|
125
|
+
...n
|
|
126
|
+
} = this.props, p = l || this._inputId, u = !this.validityStyles || this.validity.valid, g = b(s, "k-input k-input-md k-rounded-md k-input-solid"), h = /* @__PURE__ */ r.createElement(
|
|
127
|
+
"input",
|
|
128
|
+
{
|
|
129
|
+
"aria-labelledby": v,
|
|
130
|
+
"aria-describedby": c,
|
|
131
|
+
"aria-disabled": this.props.disabled || void 0,
|
|
132
|
+
"aria-invalid": !u || void 0,
|
|
133
|
+
"aria-label": y || void 0,
|
|
134
|
+
...n,
|
|
135
|
+
style: i ? void 0 : o,
|
|
136
|
+
value: this.value,
|
|
137
|
+
id: p,
|
|
138
|
+
className: g,
|
|
139
|
+
onChange: this.handleChange,
|
|
140
|
+
onAnimationStart: this.handleAutoFill,
|
|
141
|
+
ref: (m) => {
|
|
142
|
+
this._input = m;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
return i ? /* @__PURE__ */ r.createElement(
|
|
147
|
+
S,
|
|
148
|
+
{
|
|
149
|
+
label: i,
|
|
150
|
+
labelClassName: t,
|
|
151
|
+
editorId: p,
|
|
152
|
+
editorValue: String(this.value),
|
|
153
|
+
editorValid: u,
|
|
154
|
+
editorDisabled: n.disabled,
|
|
155
|
+
editorPlaceholder: n.placeholder,
|
|
156
|
+
children: h,
|
|
157
|
+
style: o,
|
|
158
|
+
dir: n.dir
|
|
159
|
+
}
|
|
160
|
+
) : h;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
e.displayName = "Input", e.propTypes = {
|
|
164
|
+
label: a.string,
|
|
165
|
+
labelClassName: a.string,
|
|
166
|
+
validationMessage: a.string,
|
|
167
|
+
required: a.bool,
|
|
168
|
+
validate: a.bool,
|
|
169
|
+
id: a.string,
|
|
170
|
+
ariaLabelledBy: a.string,
|
|
171
|
+
ariaDescribedBy: a.string,
|
|
172
|
+
ariaLabel: a.string
|
|
173
|
+
}, e.defaultProps = {
|
|
174
|
+
defaultValue: "",
|
|
175
|
+
required: !1,
|
|
176
|
+
validityStyles: !0
|
|
177
|
+
};
|
|
178
|
+
let d = e;
|
|
179
|
+
const V = _(), k = C(M(V, d));
|
|
180
|
+
k.displayName = "KendoReactInput";
|
|
181
|
+
export {
|
|
182
|
+
k as Input,
|
|
183
|
+
V as InputPropsContext,
|
|
184
|
+
d as InputWithoutContext
|
|
185
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),u=require("@progress/kendo-react-common");function s(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const a=s(c),l=a.forwardRef((e,n)=>{const t=a.useRef(null),r=a.useRef(null);return a.useImperativeHandle(t,()=>({element:r.current})),a.useImperativeHandle(n,()=>t.current),a.createElement("span",{...e,className:u.classNames("k-clear-value",e.className)})});l.displayName="KendoReactInputClearValue";exports.InputClearValue=l;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { classNames as n } from "@progress/kendo-react-common";
|
|
11
|
+
const s = e.forwardRef((a, l) => {
|
|
12
|
+
const t = e.useRef(null), r = e.useRef(null);
|
|
13
|
+
return e.useImperativeHandle(
|
|
14
|
+
t,
|
|
15
|
+
() => ({ element: r.current })
|
|
16
|
+
), e.useImperativeHandle(
|
|
17
|
+
l,
|
|
18
|
+
() => t.current
|
|
19
|
+
), /* @__PURE__ */ e.createElement("span", { ...a, className: n("k-clear-value", a.className) });
|
|
20
|
+
});
|
|
21
|
+
s.displayName = "KendoReactInputClearValue";
|
|
22
|
+
export {
|
|
23
|
+
s as InputClearValue
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@progress/kendo-react-common"),l=require("react");function s(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=s(l),c=r.forwardRef(({orientation:e="horizontal",...t},n)=>{const a=r.useRef(null),u=r.useRef(null);return r.useImperativeHandle(a,()=>({element:u.current})),r.useImperativeHandle(n,()=>a.current),r.createElement("span",{...t,className:o.classNames("k-input-prefix",t.className,`k-input-prefix-${e}`)})});c.displayName="KendoReactInputPrefix";exports.InputPrefix=c;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { classNames as l } from "@progress/kendo-react-common";
|
|
10
|
+
import * as e from "react";
|
|
11
|
+
const u = e.forwardRef(({ orientation: r = "horizontal", ...t }, a) => {
|
|
12
|
+
const n = e.useRef(null), s = e.useRef(null);
|
|
13
|
+
return e.useImperativeHandle(
|
|
14
|
+
n,
|
|
15
|
+
() => ({ element: s.current })
|
|
16
|
+
), e.useImperativeHandle(
|
|
17
|
+
a,
|
|
18
|
+
() => n.current
|
|
19
|
+
), /* @__PURE__ */ e.createElement("span", { ...t, className: l("k-input-prefix", t.className, `k-input-prefix-${r}`) });
|
|
20
|
+
});
|
|
21
|
+
u.displayName = "KendoReactInputPrefix";
|
|
22
|
+
export {
|
|
23
|
+
u as InputPrefix
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),s=require("@progress/kendo-react-common");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const a=l(u),c=a.forwardRef(({orientation:e="vertical",...t},r)=>{const n=a.useRef(null),o=a.useRef(null);return a.useImperativeHandle(n,()=>({element:o.current})),a.useImperativeHandle(r,()=>n.current),a.createElement("span",{...t,className:s.classNames("k-input-separator",t.className,`k-input-separator-${e}`)})});c.displayName="KendoReactInputSeparator";exports.InputSeparator=c;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { classNames as l } from "@progress/kendo-react-common";
|
|
11
|
+
const u = e.forwardRef(({ orientation: r = "vertical", ...t }, n) => {
|
|
12
|
+
const a = e.useRef(null), s = e.useRef(null);
|
|
13
|
+
return e.useImperativeHandle(
|
|
14
|
+
a,
|
|
15
|
+
() => ({ element: s.current })
|
|
16
|
+
), e.useImperativeHandle(
|
|
17
|
+
n,
|
|
18
|
+
() => a.current
|
|
19
|
+
), /* @__PURE__ */ e.createElement("span", { ...t, className: l("k-input-separator", t.className, `k-input-separator-${r}`) });
|
|
20
|
+
});
|
|
21
|
+
u.displayName = "KendoReactInputSeparator";
|
|
22
|
+
export {
|
|
23
|
+
u as InputSeparator
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),o=require("@progress/kendo-react-common");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=l(s),a=r.forwardRef(({orientation:e="horizontal",...t},n)=>{const u=r.useRef(null),c=r.useRef(null);return r.useImperativeHandle(u,()=>({element:c.current})),r.useImperativeHandle(n,()=>u.current),r.createElement("span",{...t,className:o.classNames("k-input-suffix",t.className,`k-input-suffix-${e}`)})});a.displayName="KendoReactInputSuffix";exports.InputSuffix=a;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { classNames as r } from "@progress/kendo-react-common";
|
|
11
|
+
const l = e.forwardRef(({ orientation: a = "horizontal", ...t }, s) => {
|
|
12
|
+
const n = e.useRef(null), u = e.useRef(null);
|
|
13
|
+
return e.useImperativeHandle(
|
|
14
|
+
n,
|
|
15
|
+
() => ({ element: u.current })
|
|
16
|
+
), e.useImperativeHandle(
|
|
17
|
+
s,
|
|
18
|
+
() => n.current
|
|
19
|
+
), /* @__PURE__ */ e.createElement("span", { ...t, className: r("k-input-suffix", t.className, `k-input-suffix-${a}`) });
|
|
20
|
+
});
|
|
21
|
+
l.displayName = "KendoReactInputSuffix";
|
|
22
|
+
export {
|
|
23
|
+
l as InputSuffix
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@progress/kendo-react-common"),i=require("react");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=l(i),r=c.forwardRef((e,t)=>c.createElement(o.IconWrap,{ref:t,...e,className:o.classNames("k-input-validation-icon",e.className)}));r.displayName="KendoReactInputValidationIcon";exports.InputValidationIcon=r;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { IconWrap as n, classNames as o } from "@progress/kendo-react-common";
|
|
10
|
+
import * as e from "react";
|
|
11
|
+
const c = e.forwardRef((a, t) => /* @__PURE__ */ e.createElement(n, { ref: t, ...a, className: o("k-input-validation-icon", a.className) }));
|
|
12
|
+
c.displayName = "KendoReactInputValidationIcon";
|
|
13
|
+
export {
|
|
14
|
+
c as InputValidationIcon
|
|
15
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),e=require("prop-types"),x=require("./masking.service.js"),c=require("./utils.js"),o=require("@progress/kendo-react-common"),_=require("@progress/kendo-react-labels"),C=require("../package-metadata.js");function S(u){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const t in u)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:()=>u[t]})}}return s.default=u,Object.freeze(s)}const p=S(P),l=class l extends p.Component{constructor(s){super(s),this.state={},this._inputId=`k-${this.props.id}`,this._service=new x.MaskingService,this._isPasted=!1,this._selection=[null,null],this._input=null,this.focus=()=>{this._input&&this._input.focus()},this.pasteHandler=t=>{const{selectionStart:i,selectionEnd:r}=t.target;r!==i&&(this._isPasted=!0,this._selection=[i||0,r||0])},this.onChangeHandler=t=>{const i=t.currentTarget,r=i.value,n=this._selection[0]||0,a=this._selection[1]||0;if(!this.props.mask){this._isPasted=!1,this._selection=[null,null],this.triggerOnChange(r,t);return}const h=this.value;let d;if(this._isPasted){this._isPasted=!1;const v=h.length-a,g=r.length-v;d=this._service.maskInRange(r.slice(n,g),h,n,a)}else d=this._service.maskInput(r,h,i.selectionStart||0);this._selection=[d.selection,d.selection],this.triggerOnChange(d.value,t)},this.focusHandler=t=>{this.state.focused||(this.setState({focused:!0}),this.props.onFocus&&this.props.onFocus.call(void 0,{target:this,syntheticEvent:t,nativeEvent:t.nativeEvent}))},this.blurHandler=t=>{this.state.focused&&(this.setState({focused:!1}),this.props.onBlur&&this.props.onBlur.call(void 0,{target:this,syntheticEvent:t,nativeEvent:t.nativeEvent}))},this.setValidity=()=>{this.element&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"")},o.validatePackage(C.packageMetadata)}get element(){return this._input}get value(){return this._valueDuringOnChange!==void 0?this._valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get rawValue(){return this._service.rawValue(this.value)}get validity(){const s=this.value,t=this._service.validationValue(s),i=this.props.validationMessage!==void 0,r=this.props.valid!==void 0?this.props.valid:(!this.required||!!t)&&(!this.props.maskValidation||!this.props.prompt||s.indexOf(this.props.prompt)===-1);return{customError:i,valid:r,valueMissing:!t}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:l.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:l.defaultProps.required}get name(){return this.props.name}componentDidUpdate(s,t){if(this.element&&this.state.focused&&t.focused){let[i,r]=this._selection;const n=s.selection,a=this.props.selection;(!n&&a||n&&a&&(n.start!==a.start||n.end!==a.end))&&(i=a.start,r=a.end),i!==null&&r!==null&&this.element.setSelectionRange(i,r)}c.maskingChanged(s,this.props)&&this.updateService(),this.setValidity()}componentDidMount(){this.updateService(),this.setValidity()}render(){const{size:s=l.defaultProps.size,fillMode:t=l.defaultProps.fillMode,rounded:i=l.defaultProps.rounded}=this.props,r=this.props.id||this._inputId,n=!this.validityStyles||this.validity.valid,a=this.props.style||{},{prefix:h=l.defaultProps.prefix,suffix:d=l.defaultProps.suffix}=this.props,[v]=o.useCustomComponent(h),[g]=o.useCustomComponent(d),m=p.createElement("span",{dir:this.props.dir,className:o.classNames("k-maskedtextbox k-input",{[`k-input-${o.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-input-${t}`]:t,[`k-rounded-${o.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-invalid":!n,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),style:this.props.label?a:{width:this.props.width,...a}},p.createElement(v,null),p.createElement("input",{type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,className:"k-input-inner",value:this.value,id:r,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-placeholder":this.props.mask,name:this.props.name,tabIndex:o.getTabIndex(this.props.tabIndex,this.props.disabled,!0),accessKey:this.props.accessKey,title:this.props.title,disabled:this.props.disabled||void 0,readOnly:this.props.readonly||void 0,placeholder:this.props.placeholder,ref:k=>this._input=k,onChange:this.onChangeHandler,onPaste:this.pasteHandler,onFocus:this.focusHandler,onBlur:this.blurHandler,onDragStart:c.returnFalse,onDrop:c.returnFalse}),p.createElement(g,null));return this.props.label?p.createElement(_.FloatingLabel,{label:this.props.label,editorId:r,editorValue:this.value,editorValid:n,editorDisabled:this.props.disabled,editorPlaceholder:this.props.placeholder,children:m,style:{width:this.props.width},dir:this.props.dir}):m}triggerOnChange(s,t){if(this.setState({value:s}),this.props.onChange){this._valueDuringOnChange=s;const i={syntheticEvent:t,nativeEvent:t.nativeEvent,selectionStart:this._selection[0],selectionEnd:this._selection[1],target:this,value:this.value};this.props.onChange.call(void 0,i),this._valueDuringOnChange=void 0}}updateService(s){const t=Object.assign({includeLiterals:this.props.includeLiterals,mask:this.props.mask,prompt:this.props.prompt,promptPlaceholder:this.props.promptPlaceholder,rules:this.rules},s);this._service.update(t)}get rules(){return Object.assign({},c.defaultRules,this.props.rules)}};l.displayName="MaskedTextBox",l.propTypes={value:e.string,defaultValue:e.string,placeholder:e.string,title:e.string,dir:e.string,id:e.string,style:e.object,className:e.string,prefix:e.any,suffix:e.any,ariaLabelledBy:e.string,ariaDescribedBy:e.string,width:e.oneOfType([e.string,e.number]),tabIndex:e.number,accessKey:e.string,disabled:e.bool,readonly:e.bool,prompt:e.string,promptPlaceholder:e.string,includeLiterals:e.bool,maskValidation:e.bool,mask:e.string,rules:function(s,t,i){const r=s.rules;return r!==void 0&&!Object.entries(r).some(a=>typeof a!="string"||!(r[a]instanceof RegExp))?new Error("Invalid prop `"+t+"` supplied to `"+i+"`. Validation failed."):null},selection:e.shape({start:e.number.isRequired,end:e.number.isRequired}),name:e.string,label:e.string,validationMessage:e.string,required:e.bool,valid:e.bool,validityStyles:e.bool,onChange:e.func,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"])},l.defaultProps={prompt:"_",promptPlaceholder:" ",includeLiterals:!1,maskValidation:!0,rules:c.defaultRules,required:!1,validityStyles:!0,prefix:s=>null,suffix:s=>null,size:"medium",rounded:"medium",fillMode:"solid"};let f=l;const y=o.createPropsContext(),b=o.withIdHOC(o.withPropsContext(y,f));b.displayName="KendoReactMaskedTextBox";exports.MaskedTextBox=b;exports.MaskedTextBoxPropsContext=y;exports.MaskedTextBoxWithoutContext=f;
|