@progress/kendo-react-inputs 7.2.4-develop.2 → 7.2.4-develop.4
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
|
@@ -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 r={"#":/[\d\s\+\-]/,"&":/[\S]/,0:/[\d]/,9:/[\d\s]/,"?":/[a-zA-Z\s]/,A:/[a-zA-Z0-9]/,C:/./,L:/[a-zA-Z]/,a:/[a-zA-Z0-9\s]/},n=()=>!1,o=(e,a)=>e.includeLiterals!==a.includeLiterals||e.mask!==a.mask||e.prompt!==a.prompt||e.promptPlaceholder!==a.promptPlaceholder||!i(e.rules,a.rules),i=(e,a)=>{if(!!e!=!!a)return!1;if(e===a||!e||!a)return!0;let t=!0;for(const s in e)if(e[s]!==a[s]){t=!1;break}if(t){for(const s in a)if(!e.hasOwnProperty(s)){t=!1;break}}return t};exports.defaultRules=r;exports.maskingChanged=o;exports.returnFalse=n;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
const r = {
|
|
10
|
+
"#": /[\d\s\+\-]/,
|
|
11
|
+
"&": /[\S]/,
|
|
12
|
+
0: /[\d]/,
|
|
13
|
+
9: /[\d\s]/,
|
|
14
|
+
"?": /[a-zA-Z\s]/,
|
|
15
|
+
A: /[a-zA-Z0-9]/,
|
|
16
|
+
C: /./,
|
|
17
|
+
L: /[a-zA-Z]/,
|
|
18
|
+
a: /[a-zA-Z0-9\s]/
|
|
19
|
+
}, n = () => !1, i = (a, e) => a.includeLiterals !== e.includeLiterals || a.mask !== e.mask || a.prompt !== e.prompt || a.promptPlaceholder !== e.promptPlaceholder || !o(a.rules, e.rules), o = (a, e) => {
|
|
20
|
+
if (!!a != !!e)
|
|
21
|
+
return !1;
|
|
22
|
+
if (a === e || !a || !e)
|
|
23
|
+
return !0;
|
|
24
|
+
let t = !0;
|
|
25
|
+
for (const s in a)
|
|
26
|
+
if (a[s] !== e[s]) {
|
|
27
|
+
t = !1;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
if (t) {
|
|
31
|
+
for (const s in e)
|
|
32
|
+
if (!a.hasOwnProperty(s)) {
|
|
33
|
+
t = !1;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
r as defaultRules,
|
|
41
|
+
i as maskingChanged,
|
|
42
|
+
n as returnFalse
|
|
43
|
+
};
|
|
@@ -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 e="numerictextbox.increment",o="numerictextbox.decrement",r="slider.increment",t="slider.decrement",a="slider.dragTitle",l="colorGradient.r",i="colorGradient.g",n="colorGradient.b",c="colorGradient.a",s="colorGradient.hex",d="colorGradient.contrastRatio",u="colorGradient.colorGradientAALevel",G="colorGradient.colorGradientAAALevel",A="colorGradient.colorGradientPass",C="colorGradient.colorGradientFail",g="colorGradient.hueSliderLabel",P="colorGradient.alphaSliderLabel",p="colorGradient.toggleInputsButton",B="flatColorPicker.cancelBtn",b="flatColorPicker.applyBtn",k="flatColorPicker.colorGradientBtn",m="flatColorPicker.colorPaletteBtn",x="flatColorPicker.clearBtn",f="checkbox.validation",h="checkbox.optionalText",L="radioButton.validation",v="switch.validation",V="colorPicker.dropdownButtonAriaLabel",w="rating.ariaLabel",D="signature.clear",T="signature.maximize",y="signature.minimize",I={[e]:"Increase value",[o]:"Decrease value",[r]:"Increase",[t]:"Decrease",[a]:"Drag",[l]:"r",[i]:"g",[n]:"b",[c]:"a",[s]:"hex",[d]:"Contrast ratio",[u]:"AA",[G]:"AAA",[A]:"Pass",[C]:"Fail",[g]:"Hue slider",[P]:"Alpha slider",[p]:"Toggle colorgradient inputs",[B]:"Cancel",[b]:"Apply",[k]:"Color Gradient view",[m]:"Color Palette view",[x]:"Clear color value",[f]:"Please check this box if you want to proceed!",[h]:"(Optional)",[L]:"Please select option if you want to proceed!",[v]:"Please turn on if you want to proceed!",[V]:"Select",[w]:"Rating",[D]:"Clear",[T]:"Maximize",[y]:"Minimize"};exports.checkboxOptionalText=h;exports.checkboxValidation=f;exports.colorGradientA=c;exports.colorGradientAAALevel=G;exports.colorGradientAALevel=u;exports.colorGradientAlphaSliderLabel=P;exports.colorGradientB=n;exports.colorGradientContrastRatio=d;exports.colorGradientFail=C;exports.colorGradientG=i;exports.colorGradientHex=s;exports.colorGradientHueSliderLabel=g;exports.colorGradientPass=A;exports.colorGradientR=l;exports.colorGradientToggleInputsButton=p;exports.colorPickerDropdownButtonAriaLabel=V;exports.flatColorPickerApplyBtn=b;exports.flatColorPickerCancelBtn=B;exports.flatColorPickerClearBtn=x;exports.flatColorPickerColorGradientBtn=k;exports.flatColorPickerColorPaletteBtn=m;exports.messages=I;exports.numericDecreaseValue=o;exports.numericIncreaseValue=e;exports.radioButtonValidation=L;exports.ratingAriaLabel=w;exports.signatureClear=D;exports.signatureMaximize=T;exports.signatureMinimize=y;exports.sliderDecreaseValue=t;exports.sliderDragTitle=a;exports.sliderIncreaseValue=r;exports.switchValidation=v;
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
const e = "numerictextbox.increment", o = "numerictextbox.decrement", t = "slider.increment", r = "slider.decrement", a = "slider.dragTitle", n = "colorGradient.r", l = "colorGradient.g", i = "colorGradient.b", c = "colorGradient.a", s = "colorGradient.hex", d = "colorGradient.contrastRatio", u = "colorGradient.colorGradientAALevel", G = "colorGradient.colorGradientAAALevel", A = "colorGradient.colorGradientPass", g = "colorGradient.colorGradientFail", p = "colorGradient.hueSliderLabel", C = "colorGradient.alphaSliderLabel", P = "colorGradient.toggleInputsButton", x = "flatColorPicker.cancelBtn", b = "flatColorPicker.applyBtn", k = "flatColorPicker.colorGradientBtn", m = "flatColorPicker.colorPaletteBtn", B = "flatColorPicker.clearBtn", h = "checkbox.validation", f = "checkbox.optionalText", v = "radioButton.validation", L = "switch.validation", w = "colorPicker.dropdownButtonAriaLabel", D = "rating.ariaLabel", V = "signature.clear", y = "signature.maximize", z = "signature.minimize", I = {
|
|
10
|
+
[e]: "Increase value",
|
|
11
|
+
[o]: "Decrease value",
|
|
12
|
+
[t]: "Increase",
|
|
13
|
+
[r]: "Decrease",
|
|
14
|
+
[a]: "Drag",
|
|
15
|
+
[n]: "r",
|
|
16
|
+
[l]: "g",
|
|
17
|
+
[i]: "b",
|
|
18
|
+
[c]: "a",
|
|
19
|
+
[s]: "hex",
|
|
20
|
+
[d]: "Contrast ratio",
|
|
21
|
+
[u]: "AA",
|
|
22
|
+
[G]: "AAA",
|
|
23
|
+
[A]: "Pass",
|
|
24
|
+
[g]: "Fail",
|
|
25
|
+
[p]: "Hue slider",
|
|
26
|
+
[C]: "Alpha slider",
|
|
27
|
+
[P]: "Toggle colorgradient inputs",
|
|
28
|
+
[x]: "Cancel",
|
|
29
|
+
[b]: "Apply",
|
|
30
|
+
[k]: "Color Gradient view",
|
|
31
|
+
[m]: "Color Palette view",
|
|
32
|
+
[B]: "Clear color value",
|
|
33
|
+
[h]: "Please check this box if you want to proceed!",
|
|
34
|
+
[f]: "(Optional)",
|
|
35
|
+
[v]: "Please select option if you want to proceed!",
|
|
36
|
+
[L]: "Please turn on if you want to proceed!",
|
|
37
|
+
[w]: "Select",
|
|
38
|
+
[D]: "Rating",
|
|
39
|
+
[V]: "Clear",
|
|
40
|
+
[y]: "Maximize",
|
|
41
|
+
[z]: "Minimize"
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
f as checkboxOptionalText,
|
|
45
|
+
h as checkboxValidation,
|
|
46
|
+
c as colorGradientA,
|
|
47
|
+
G as colorGradientAAALevel,
|
|
48
|
+
u as colorGradientAALevel,
|
|
49
|
+
C as colorGradientAlphaSliderLabel,
|
|
50
|
+
i as colorGradientB,
|
|
51
|
+
d as colorGradientContrastRatio,
|
|
52
|
+
g as colorGradientFail,
|
|
53
|
+
l as colorGradientG,
|
|
54
|
+
s as colorGradientHex,
|
|
55
|
+
p as colorGradientHueSliderLabel,
|
|
56
|
+
A as colorGradientPass,
|
|
57
|
+
n as colorGradientR,
|
|
58
|
+
P as colorGradientToggleInputsButton,
|
|
59
|
+
w as colorPickerDropdownButtonAriaLabel,
|
|
60
|
+
b as flatColorPickerApplyBtn,
|
|
61
|
+
x as flatColorPickerCancelBtn,
|
|
62
|
+
B as flatColorPickerClearBtn,
|
|
63
|
+
k as flatColorPickerColorGradientBtn,
|
|
64
|
+
m as flatColorPickerColorPaletteBtn,
|
|
65
|
+
I as messages,
|
|
66
|
+
o as numericDecreaseValue,
|
|
67
|
+
e as numericIncreaseValue,
|
|
68
|
+
v as radioButtonValidation,
|
|
69
|
+
D as ratingAriaLabel,
|
|
70
|
+
V as signatureClear,
|
|
71
|
+
y as signatureMaximize,
|
|
72
|
+
z as signatureMinimize,
|
|
73
|
+
r as sliderDecreaseValue,
|
|
74
|
+
a as sliderDragTitle,
|
|
75
|
+
t as sliderIncreaseValue,
|
|
76
|
+
L as switchValidation
|
|
77
|
+
};
|
|
@@ -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 te=require("react"),n=require("prop-types"),G=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),w=require("@progress/kendo-svg-icons"),ne=require("@progress/kendo-react-labels"),re=require("../package-metadata.js"),m=require("../messages/index.js"),s=require("./utils/index.js"),A=require("@progress/kendo-react-buttons");function ae(c){const V=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const x=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(V,e,x.get?x:{enumerable:!0,get:()=>c[e]})}}return V.default=c,Object.freeze(V)}const r=ae(te),le="Please enter a valid value!",H=o.createPropsContext(),P=r.forwardRef((c,V)=>{o.validatePackage(re.packageMetadata);const e=o.usePropsContext(H,c),x=o.useId(),B=e.id||x,u=G.useInternationalization(),S=G.useLocalization(),l=r.useRef(null),O=r.useRef(),[K,y]=r.useState(!1),i=r.useRef(s.getInitialState()),E=r.useRef(!1),D=r.useRef(),k=r.useRef(e.defaultValue),C=s.formatValue(i.current.focused&&!e.disabled?i.current.currentLooseValue:s.getStateOrPropsValue(e.value,k.current),e.format,u);D.current=C;const[$]=o.useCustomComponent(e.prefix),[U]=o.useCustomComponent(e.suffix);r.useEffect(()=>{l.current&&l.current.setCustomValidity&&l.current.setCustomValidity(L().valid?"":e.validationMessage||le)});const T=r.useCallback(()=>{l.current&&l.current.focus()},[]),h=r.useCallback(()=>O.current!==void 0?O.current:s.getStateOrPropsValue(e.value,k.current),[e.value]),z=r.useCallback(()=>e.name,[e.name]),I=r.useCallback(()=>e.required,[e.required]),L=r.useCallback(()=>{const a=e.validationMessage!==void 0,t=h(),p=e.valid!==void 0?e.valid:!i.current.valueIsOutOfRange&&(!I()||t!=null);return{customError:a,valid:p,valueMissing:t==null}},[e.validationMessage,e.valid,h,I]),N=r.useCallback(()=>e.validityStyles,[e.validityStyles]),j=r.useCallback(()=>e,[e]),g=r.useCallback(()=>{const a={element:l.current,focus:T};return Object.defineProperty(a,"name",{get:z}),Object.defineProperty(a,"value",{get:h}),Object.defineProperty(a,"validity",{get:L}),Object.defineProperty(a,"validityStyles",{get:N}),Object.defineProperty(a,"required",{get:I}),Object.defineProperty(a,"props",{get:j}),a},[z,h,L,N,I,T,j]);r.useImperativeHandle(V,g);const f=r.useCallback(()=>({eventValue:s.getStateOrPropsValue(e.value,k.current),prevLooseValue:D.current,currentLooseValue:l.current.value,selectionStart:l.current.selectionStart,selectionEnd:l.current.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:E.current,focused:i.current.focused}),[e.value]),b=r.useCallback((a,t)=>{if(e.disabled)return;O.current=t.eventValue,k.current=t.eventValue;const p=s.formatValue(s.rangeValue(t.eventValue,e.min,e.max),e.format,u),d=s.rangeValue(u.parseNumber(p,e.format),e.min,e.max);d!==t.eventValue&&(t.valueIsOutOfRange=!0,t.eventValue=d,k.current=d),e.value!==t.eventValue&&o.dispatchEvent(e.onChange,a,g(),{value:t.eventValue}),O.current=void 0,i.current=t,y(q=>!q)},[e.value,e.onChange,e.disabled,y,g]),W=r.useCallback(a=>{const t=f();E.current=!1,b(a,s.sanitizeNumber(t,e.format,u))},[e.format,e.onChange,u,b,f]),Y=r.useCallback(a=>{let t=f();const p=u.parseNumber(String(t.currentLooseValue),e.format);if(t.selectionEnd>t.selectionStart&&t.selectionEnd-t.selectionStart===String(t.currentLooseValue).length){const d=u.numberSymbols(),v=d&&a.key===d.minusSign,q=d&&a.key===d.decimal;E.current=!v&&!q;return}switch(a.keyCode){case 38:s.increaseValue(p,t,e.step,e.min,e.max,e.format,u);break;case 40:s.decreaseValue(p,t,e.step,e.min,e.max,e.format,u);break;case 13:{if(e.rangeOnEnter===!1)return;const d=s.formatValue(s.rangeValue(p,e.min,e.max),e.format,u),v=s.rangeValue(u.parseNumber(d,e.format),e.min,e.max);t.eventValue=v,t.currentLooseValue=s.formatValue(v,e.format,u),t.selectionStart=t.selectionEnd=t.currentLooseValue.length;break}case 110:{const d=l.current,v=u.numberSymbols();d&&(t.currentLooseValue=t.currentLooseValue.slice(0,t.selectionStart)+v.decimal+t.currentLooseValue.slice(t.selectionEnd),t.selectionStart=t.selectionEnd=t.selectionStart+1,t=s.sanitizeNumber(t,e.format,u));break}default:return}a.preventDefault(),b(a,t)},[e.format,e.min,e.max,e.step,e.onChange,e.rangeOnEnter,b,f]),J=r.useCallback(()=>{E.current=!0},[]),R=r.useCallback(a=>{if(e.readOnly||e.disabled)return;const t=f();s.increaseValue(u.parseNumber(String(t.currentLooseValue),e.format),t,e.step,e.min,e.max,e.format,u),b(a,t)},[e.format,e.min,e.max,e.step,e.onChange,e.readOnly,e.disabled,b,f]),M=r.useCallback(a=>{if(e.readOnly||e.disabled)return;const t=f();s.decreaseValue(u.parseNumber(String(t.currentLooseValue),e.format),t,e.step,e.min,e.max,e.format,u),b(a,t)},[e.format,e.min,e.max,e.step,e.onChange,e.readOnly,e.disabled,b,f]),Q=r.useCallback(a=>{const t=o.getActiveElement(document);!document||t!==l.current||!l.current||e.readOnly||e.disabled||(a.nativeEvent.deltaY<0&&R(a),a.nativeEvent.deltaY>0&&M(a))},[R,M,e.disabled,e.readOnly]),X=r.useCallback(a=>{i.current.currentLooseValue=D.current,i.current.focused=!0,o.dispatchEvent(e.onFocus,a,g(),{}),y(t=>!t)},[e.onFocus,y,g]),Z=r.useCallback(a=>{i.current=s.getInitialState(),o.dispatchEvent(e.onBlur,a,g(),{}),y(t=>!t)},[e.onBlur,y,g]),ee=r.useCallback(a=>{if(document&&l.current){const t=o.getActiveElement(document);a.preventDefault(),t!==l.current&&l.current.focus()}},[]);o.useIsomorphicLayoutEffect(()=>{l.current&&l.current.type!=="number"&&i.current.selectionStart!==void 0&&i.current.selectionEnd!==void 0&&(l.current.selectionStart=i.current.selectionStart,l.current.selectionEnd=i.current.selectionEnd,i.current.selectionStart=void 0,i.current.selectionEnd=void 0)},[K]);const F=!N()||L().valid,_=r.createElement("span",{dir:e.dir,style:e.label?e.style:{width:e.width,...e.style},className:o.classNames("k-input","k-numerictextbox",{[`k-input-${o.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size,[`k-input-${e.fillMode}`]:e.fillMode,[`k-rounded-${o.kendoThemeMaps.roundedMap[e.rounded]||e.rounded}`]:e.rounded,"k-invalid":!F,"k-required":e.required,"k-disabled":e.disabled},e.className),"aria-disabled":e.disabled?"true":void 0},r.createElement($,null),r.createElement("input",{role:"spinbutton",value:C===null?"":C,tabIndex:o.getTabIndex(e.tabIndex,e.disabled),accessKey:e.accessKey,disabled:e.disabled,title:e.title,"aria-disabled":e.disabled?"true":void 0,"aria-valuemin":e.min,"aria-valuemax":e.max,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,placeholder:e.placeholder,spellCheck:!1,autoComplete:"off",autoCorrect:"off",type:e.inputType||"tel",className:"k-input-inner",id:B,name:e.name,readOnly:e.readOnly,style:e.inputStyle,onChange:W,onFocus:X,onBlur:Z,onKeyDown:Y,onPaste:J,onWheel:Q,ref:l}),r.createElement(U,null),e.children,e.spinners&&r.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:ee},r.createElement(A.Button,{tabIndex:-1,type:"button",icon:"caret-alt-up",svgIcon:w.caretAltUpIcon,rounded:null,className:"k-spinner-increase","aria-label":S.toLanguageString(m.numericIncreaseValue,m.messages[m.numericIncreaseValue]),title:S.toLanguageString(m.numericIncreaseValue,m.messages[m.numericIncreaseValue]),onClick:R}),r.createElement(A.Button,{tabIndex:-1,type:"button",icon:"caret-alt-down",svgIcon:w.caretAltDownIcon,rounded:null,className:"k-spinner-decrease","aria-label":S.toLanguageString(m.numericDecreaseValue,m.messages[m.numericDecreaseValue]),title:S.toLanguageString(m.numericDecreaseValue,m.messages[m.numericDecreaseValue]),onClick:M})));return e.label?r.createElement(ne.FloatingLabel,{label:e.label,editorId:B,editorValue:C===null?"":C,editorValid:F,editorDisabled:e.disabled,editorPlaceholder:e.placeholder,children:_,style:{width:e.width},dir:e.dir}):_});P.propTypes={value:n.number,defaultValue:n.number,step:n.number,format:n.oneOfType([n.string,n.shape({style:n.oneOf(["decimal","currency","percent","scientific","accounting"]),currency:n.string,currencyDisplay:n.oneOf(["symbol","code","name"]),useGrouping:n.bool,minimumIntegerDigits:n.number,minimumFractionDigits:n.number,maximumFractionDigits:n.number})]),width:n.oneOfType([n.string,n.number]),tabIndex:n.number,accessKey:n.string,title:n.string,placeholder:n.string,min:n.number,max:n.number,spinners:n.bool,disabled:n.bool,readOnly:n.bool,dir:n.string,name:n.string,label:n.string,validationMessage:n.string,required:n.bool,id:n.string,rangeOnEnter:n.bool,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,onChange:n.func,onFocus:n.func,onBlur:n.func,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])};P.displayName="KendoNumericTextBox";P.defaultProps={prefix:c=>null,suffix:c=>null,step:1,spinners:!0,disabled:!1,required:!1,validityStyles:!0,rangeOnEnter:!0,onChange:c=>{},onFocus:c=>{},onBlur:c=>{},size:"medium",rounded:"medium",fillMode:"solid"};exports.NumericTextBox=P;exports.NumericTextBoxPropsContext=H;
|
|
@@ -0,0 +1,415 @@
|
|
|
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 n from "prop-types";
|
|
11
|
+
import { useInternationalization as ue, useLocalization as ce } from "@progress/kendo-react-intl";
|
|
12
|
+
import { createPropsContext as de, validatePackage as me, usePropsContext as fe, useId as be, useCustomComponent as _, dispatchEvent as B, getActiveElement as H, useIsomorphicLayoutEffect as pe, classNames as ge, kendoThemeMaps as K, getTabIndex as ve } from "@progress/kendo-react-common";
|
|
13
|
+
import { caretAltUpIcon as ye, caretAltDownIcon as Ce } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { FloatingLabel as Ve } from "@progress/kendo-react-labels";
|
|
15
|
+
import { packageMetadata as ke } from "../package-metadata.mjs";
|
|
16
|
+
import { numericIncreaseValue as h, messages as S, numericDecreaseValue as O } from "../messages/index.mjs";
|
|
17
|
+
import { getInitialState as U, formatValue as I, getStateOrPropsValue as F, rangeValue as L, sanitizeNumber as $, decreaseValue as W, increaseValue as Y } from "./utils/index.mjs";
|
|
18
|
+
import { Button as J } from "@progress/kendo-react-buttons";
|
|
19
|
+
const xe = "Please enter a valid value!", Ee = de(), T = r.forwardRef((b, Q) => {
|
|
20
|
+
me(ke);
|
|
21
|
+
const e = fe(Ee, b), X = be(), z = e.id || X, s = ue(), y = ce(), l = r.useRef(null), C = r.useRef(), [Z, p] = r.useState(!1), o = r.useRef(U()), V = r.useRef(!1), P = r.useRef(), g = r.useRef(e.defaultValue), v = I(
|
|
22
|
+
o.current.focused && !e.disabled ? o.current.currentLooseValue : F(e.value, g.current),
|
|
23
|
+
e.format,
|
|
24
|
+
s
|
|
25
|
+
);
|
|
26
|
+
P.current = v;
|
|
27
|
+
const [ee] = _(e.prefix), [te] = _(e.suffix);
|
|
28
|
+
r.useEffect(
|
|
29
|
+
() => {
|
|
30
|
+
l.current && l.current.setCustomValidity && l.current.setCustomValidity(
|
|
31
|
+
E().valid ? "" : e.validationMessage || xe
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
const q = r.useCallback(
|
|
36
|
+
() => {
|
|
37
|
+
l.current && l.current.focus();
|
|
38
|
+
},
|
|
39
|
+
[]
|
|
40
|
+
), k = r.useCallback(
|
|
41
|
+
() => C.current !== void 0 ? C.current : F(e.value, g.current),
|
|
42
|
+
[e.value]
|
|
43
|
+
), G = r.useCallback(
|
|
44
|
+
() => e.name,
|
|
45
|
+
[e.name]
|
|
46
|
+
), x = r.useCallback(
|
|
47
|
+
() => e.required,
|
|
48
|
+
[e.required]
|
|
49
|
+
), E = r.useCallback(
|
|
50
|
+
() => {
|
|
51
|
+
const a = e.validationMessage !== void 0, t = k(), m = e.valid !== void 0 ? e.valid : !o.current.valueIsOutOfRange && (!x() || t != null);
|
|
52
|
+
return {
|
|
53
|
+
customError: a,
|
|
54
|
+
valid: m,
|
|
55
|
+
valueMissing: t == null
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
[e.validationMessage, e.valid, k, x]
|
|
59
|
+
), N = r.useCallback(
|
|
60
|
+
() => e.validityStyles,
|
|
61
|
+
[e.validityStyles]
|
|
62
|
+
), j = r.useCallback(
|
|
63
|
+
() => e,
|
|
64
|
+
[e]
|
|
65
|
+
), d = r.useCallback(
|
|
66
|
+
() => {
|
|
67
|
+
const a = {
|
|
68
|
+
element: l.current,
|
|
69
|
+
focus: q
|
|
70
|
+
};
|
|
71
|
+
return Object.defineProperty(a, "name", { get: G }), Object.defineProperty(a, "value", { get: k }), Object.defineProperty(a, "validity", { get: E }), Object.defineProperty(a, "validityStyles", { get: N }), Object.defineProperty(a, "required", { get: x }), Object.defineProperty(a, "props", { get: j }), a;
|
|
72
|
+
},
|
|
73
|
+
[G, k, E, N, x, q, j]
|
|
74
|
+
);
|
|
75
|
+
r.useImperativeHandle(Q, d);
|
|
76
|
+
const u = r.useCallback(
|
|
77
|
+
() => ({
|
|
78
|
+
eventValue: F(e.value, g.current),
|
|
79
|
+
prevLooseValue: P.current,
|
|
80
|
+
currentLooseValue: l.current.value,
|
|
81
|
+
selectionStart: l.current.selectionStart,
|
|
82
|
+
selectionEnd: l.current.selectionEnd,
|
|
83
|
+
decimalSelect: !1,
|
|
84
|
+
valueIsCorrected: !1,
|
|
85
|
+
valueIsOutOfRange: !1,
|
|
86
|
+
isPaste: V.current,
|
|
87
|
+
focused: o.current.focused
|
|
88
|
+
}),
|
|
89
|
+
[e.value]
|
|
90
|
+
), c = r.useCallback(
|
|
91
|
+
(a, t) => {
|
|
92
|
+
if (e.disabled)
|
|
93
|
+
return;
|
|
94
|
+
C.current = t.eventValue, g.current = t.eventValue;
|
|
95
|
+
const m = I(L(t.eventValue, e.min, e.max), e.format, s), i = L(s.parseNumber(m, e.format), e.min, e.max);
|
|
96
|
+
i !== t.eventValue && (t.valueIsOutOfRange = !0, t.eventValue = i, g.current = i), e.value !== t.eventValue && B(
|
|
97
|
+
e.onChange,
|
|
98
|
+
a,
|
|
99
|
+
d(),
|
|
100
|
+
{ value: t.eventValue }
|
|
101
|
+
), C.current = void 0, o.current = t, p((M) => !M);
|
|
102
|
+
},
|
|
103
|
+
[e.value, e.onChange, e.disabled, p, d]
|
|
104
|
+
), ne = r.useCallback(
|
|
105
|
+
(a) => {
|
|
106
|
+
const t = u();
|
|
107
|
+
V.current = !1, c(a, $(t, e.format, s));
|
|
108
|
+
},
|
|
109
|
+
[e.format, e.onChange, s, c, u]
|
|
110
|
+
), re = r.useCallback(
|
|
111
|
+
(a) => {
|
|
112
|
+
let t = u();
|
|
113
|
+
const m = s.parseNumber(String(t.currentLooseValue), e.format);
|
|
114
|
+
if (t.selectionEnd > t.selectionStart && t.selectionEnd - t.selectionStart === String(t.currentLooseValue).length) {
|
|
115
|
+
const i = s.numberSymbols(), f = i && a.key === i.minusSign, M = i && a.key === i.decimal;
|
|
116
|
+
V.current = !f && !M;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
switch (a.keyCode) {
|
|
120
|
+
case 38:
|
|
121
|
+
Y(
|
|
122
|
+
m,
|
|
123
|
+
t,
|
|
124
|
+
e.step,
|
|
125
|
+
e.min,
|
|
126
|
+
e.max,
|
|
127
|
+
e.format,
|
|
128
|
+
s
|
|
129
|
+
);
|
|
130
|
+
break;
|
|
131
|
+
case 40:
|
|
132
|
+
W(
|
|
133
|
+
m,
|
|
134
|
+
t,
|
|
135
|
+
e.step,
|
|
136
|
+
e.min,
|
|
137
|
+
e.max,
|
|
138
|
+
e.format,
|
|
139
|
+
s
|
|
140
|
+
);
|
|
141
|
+
break;
|
|
142
|
+
case 13: {
|
|
143
|
+
if (e.rangeOnEnter === !1)
|
|
144
|
+
return;
|
|
145
|
+
const i = I(L(m, e.min, e.max), e.format, s), f = L(s.parseNumber(i, e.format), e.min, e.max);
|
|
146
|
+
t.eventValue = f, t.currentLooseValue = I(f, e.format, s), t.selectionStart = t.selectionEnd = t.currentLooseValue.length;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
case 110: {
|
|
150
|
+
const i = l.current, f = s.numberSymbols();
|
|
151
|
+
i && (t.currentLooseValue = t.currentLooseValue.slice(0, t.selectionStart) + f.decimal + t.currentLooseValue.slice(t.selectionEnd), t.selectionStart = t.selectionEnd = t.selectionStart + 1, t = $(t, e.format, s));
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
default:
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
a.preventDefault(), c(a, t);
|
|
158
|
+
},
|
|
159
|
+
[e.format, e.min, e.max, e.step, e.onChange, e.rangeOnEnter, c, u]
|
|
160
|
+
), ae = r.useCallback(
|
|
161
|
+
() => {
|
|
162
|
+
V.current = !0;
|
|
163
|
+
},
|
|
164
|
+
[]
|
|
165
|
+
), D = r.useCallback(
|
|
166
|
+
(a) => {
|
|
167
|
+
if (e.readOnly || e.disabled)
|
|
168
|
+
return;
|
|
169
|
+
const t = u();
|
|
170
|
+
Y(
|
|
171
|
+
s.parseNumber(String(t.currentLooseValue), e.format),
|
|
172
|
+
t,
|
|
173
|
+
e.step,
|
|
174
|
+
e.min,
|
|
175
|
+
e.max,
|
|
176
|
+
e.format,
|
|
177
|
+
s
|
|
178
|
+
), c(a, t);
|
|
179
|
+
},
|
|
180
|
+
[e.format, e.min, e.max, e.step, e.onChange, e.readOnly, e.disabled, c, u]
|
|
181
|
+
), R = r.useCallback(
|
|
182
|
+
(a) => {
|
|
183
|
+
if (e.readOnly || e.disabled)
|
|
184
|
+
return;
|
|
185
|
+
const t = u();
|
|
186
|
+
W(
|
|
187
|
+
s.parseNumber(String(t.currentLooseValue), e.format),
|
|
188
|
+
t,
|
|
189
|
+
e.step,
|
|
190
|
+
e.min,
|
|
191
|
+
e.max,
|
|
192
|
+
e.format,
|
|
193
|
+
s
|
|
194
|
+
), c(a, t);
|
|
195
|
+
},
|
|
196
|
+
[e.format, e.min, e.max, e.step, e.onChange, e.readOnly, e.disabled, c, u]
|
|
197
|
+
), le = r.useCallback(
|
|
198
|
+
(a) => {
|
|
199
|
+
const t = H(document);
|
|
200
|
+
!document || t !== l.current || !l.current || e.readOnly || e.disabled || (a.nativeEvent.deltaY < 0 && D(a), a.nativeEvent.deltaY > 0 && R(a));
|
|
201
|
+
},
|
|
202
|
+
[D, R, e.disabled, e.readOnly]
|
|
203
|
+
), se = r.useCallback(
|
|
204
|
+
(a) => {
|
|
205
|
+
o.current.currentLooseValue = P.current, o.current.focused = !0, B(
|
|
206
|
+
e.onFocus,
|
|
207
|
+
a,
|
|
208
|
+
d(),
|
|
209
|
+
{}
|
|
210
|
+
), p((t) => !t);
|
|
211
|
+
},
|
|
212
|
+
[e.onFocus, p, d]
|
|
213
|
+
), oe = r.useCallback(
|
|
214
|
+
(a) => {
|
|
215
|
+
o.current = U(), B(
|
|
216
|
+
e.onBlur,
|
|
217
|
+
a,
|
|
218
|
+
d(),
|
|
219
|
+
{}
|
|
220
|
+
), p((t) => !t);
|
|
221
|
+
},
|
|
222
|
+
[e.onBlur, p, d]
|
|
223
|
+
), ie = r.useCallback(
|
|
224
|
+
(a) => {
|
|
225
|
+
if (document && l.current) {
|
|
226
|
+
const t = H(document);
|
|
227
|
+
a.preventDefault(), t !== l.current && l.current.focus();
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
[]
|
|
231
|
+
);
|
|
232
|
+
pe(
|
|
233
|
+
() => {
|
|
234
|
+
l.current && l.current.type !== "number" && o.current.selectionStart !== void 0 && o.current.selectionEnd !== void 0 && (l.current.selectionStart = o.current.selectionStart, l.current.selectionEnd = o.current.selectionEnd, o.current.selectionStart = void 0, o.current.selectionEnd = void 0);
|
|
235
|
+
},
|
|
236
|
+
[Z]
|
|
237
|
+
);
|
|
238
|
+
const w = !N() || E().valid, A = /* @__PURE__ */ r.createElement(
|
|
239
|
+
"span",
|
|
240
|
+
{
|
|
241
|
+
dir: e.dir,
|
|
242
|
+
style: e.label ? e.style : { width: e.width, ...e.style },
|
|
243
|
+
className: ge(
|
|
244
|
+
"k-input",
|
|
245
|
+
"k-numerictextbox",
|
|
246
|
+
{
|
|
247
|
+
[`k-input-${K.sizeMap[e.size] || e.size}`]: e.size,
|
|
248
|
+
[`k-input-${e.fillMode}`]: e.fillMode,
|
|
249
|
+
[`k-rounded-${K.roundedMap[e.rounded] || e.rounded}`]: e.rounded,
|
|
250
|
+
"k-invalid": !w,
|
|
251
|
+
"k-required": e.required,
|
|
252
|
+
"k-disabled": e.disabled
|
|
253
|
+
},
|
|
254
|
+
e.className
|
|
255
|
+
),
|
|
256
|
+
"aria-disabled": e.disabled ? "true" : void 0
|
|
257
|
+
},
|
|
258
|
+
/* @__PURE__ */ r.createElement(ee, null),
|
|
259
|
+
/* @__PURE__ */ r.createElement(
|
|
260
|
+
"input",
|
|
261
|
+
{
|
|
262
|
+
role: "spinbutton",
|
|
263
|
+
value: v === null ? "" : v,
|
|
264
|
+
tabIndex: ve(e.tabIndex, e.disabled),
|
|
265
|
+
accessKey: e.accessKey,
|
|
266
|
+
disabled: e.disabled,
|
|
267
|
+
title: e.title,
|
|
268
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
269
|
+
"aria-valuemin": e.min,
|
|
270
|
+
"aria-valuemax": e.max,
|
|
271
|
+
"aria-label": e.ariaLabel,
|
|
272
|
+
"aria-labelledby": e.ariaLabelledBy,
|
|
273
|
+
"aria-describedby": e.ariaDescribedBy,
|
|
274
|
+
placeholder: e.placeholder,
|
|
275
|
+
spellCheck: !1,
|
|
276
|
+
autoComplete: "off",
|
|
277
|
+
autoCorrect: "off",
|
|
278
|
+
type: e.inputType || "tel",
|
|
279
|
+
className: "k-input-inner",
|
|
280
|
+
id: z,
|
|
281
|
+
name: e.name,
|
|
282
|
+
readOnly: e.readOnly,
|
|
283
|
+
style: e.inputStyle,
|
|
284
|
+
onChange: ne,
|
|
285
|
+
onFocus: se,
|
|
286
|
+
onBlur: oe,
|
|
287
|
+
onKeyDown: re,
|
|
288
|
+
onPaste: ae,
|
|
289
|
+
onWheel: le,
|
|
290
|
+
ref: l
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
/* @__PURE__ */ r.createElement(te, null),
|
|
294
|
+
e.children,
|
|
295
|
+
e.spinners && /* @__PURE__ */ r.createElement(
|
|
296
|
+
"span",
|
|
297
|
+
{
|
|
298
|
+
className: "k-input-spinner k-spin-button",
|
|
299
|
+
onMouseDown: ie
|
|
300
|
+
},
|
|
301
|
+
/* @__PURE__ */ r.createElement(
|
|
302
|
+
J,
|
|
303
|
+
{
|
|
304
|
+
tabIndex: -1,
|
|
305
|
+
type: "button",
|
|
306
|
+
icon: "caret-alt-up",
|
|
307
|
+
svgIcon: ye,
|
|
308
|
+
rounded: null,
|
|
309
|
+
className: "k-spinner-increase",
|
|
310
|
+
"aria-label": y.toLanguageString(h, S[h]),
|
|
311
|
+
title: y.toLanguageString(h, S[h]),
|
|
312
|
+
onClick: D
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ r.createElement(
|
|
316
|
+
J,
|
|
317
|
+
{
|
|
318
|
+
tabIndex: -1,
|
|
319
|
+
type: "button",
|
|
320
|
+
icon: "caret-alt-down",
|
|
321
|
+
svgIcon: Ce,
|
|
322
|
+
rounded: null,
|
|
323
|
+
className: "k-spinner-decrease",
|
|
324
|
+
"aria-label": y.toLanguageString(O, S[O]),
|
|
325
|
+
title: y.toLanguageString(O, S[O]),
|
|
326
|
+
onClick: R
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
)
|
|
330
|
+
);
|
|
331
|
+
return e.label ? /* @__PURE__ */ r.createElement(
|
|
332
|
+
Ve,
|
|
333
|
+
{
|
|
334
|
+
label: e.label,
|
|
335
|
+
editorId: z,
|
|
336
|
+
editorValue: v === null ? "" : v,
|
|
337
|
+
editorValid: w,
|
|
338
|
+
editorDisabled: e.disabled,
|
|
339
|
+
editorPlaceholder: e.placeholder,
|
|
340
|
+
children: A,
|
|
341
|
+
style: { width: e.width },
|
|
342
|
+
dir: e.dir
|
|
343
|
+
}
|
|
344
|
+
) : A;
|
|
345
|
+
});
|
|
346
|
+
T.propTypes = {
|
|
347
|
+
value: n.number,
|
|
348
|
+
defaultValue: n.number,
|
|
349
|
+
step: n.number,
|
|
350
|
+
format: n.oneOfType([
|
|
351
|
+
n.string,
|
|
352
|
+
n.shape({
|
|
353
|
+
style: n.oneOf(["decimal", "currency", "percent", "scientific", "accounting"]),
|
|
354
|
+
currency: n.string,
|
|
355
|
+
currencyDisplay: n.oneOf(["symbol", "code", "name"]),
|
|
356
|
+
useGrouping: n.bool,
|
|
357
|
+
minimumIntegerDigits: n.number,
|
|
358
|
+
minimumFractionDigits: n.number,
|
|
359
|
+
maximumFractionDigits: n.number
|
|
360
|
+
})
|
|
361
|
+
]),
|
|
362
|
+
width: n.oneOfType([
|
|
363
|
+
n.string,
|
|
364
|
+
n.number
|
|
365
|
+
]),
|
|
366
|
+
tabIndex: n.number,
|
|
367
|
+
accessKey: n.string,
|
|
368
|
+
title: n.string,
|
|
369
|
+
placeholder: n.string,
|
|
370
|
+
min: n.number,
|
|
371
|
+
max: n.number,
|
|
372
|
+
spinners: n.bool,
|
|
373
|
+
disabled: n.bool,
|
|
374
|
+
readOnly: n.bool,
|
|
375
|
+
dir: n.string,
|
|
376
|
+
name: n.string,
|
|
377
|
+
label: n.string,
|
|
378
|
+
validationMessage: n.string,
|
|
379
|
+
required: n.bool,
|
|
380
|
+
id: n.string,
|
|
381
|
+
rangeOnEnter: n.bool,
|
|
382
|
+
ariaLabelledBy: n.string,
|
|
383
|
+
ariaDescribedBy: n.string,
|
|
384
|
+
ariaLabel: n.string,
|
|
385
|
+
onChange: n.func,
|
|
386
|
+
onFocus: n.func,
|
|
387
|
+
onBlur: n.func,
|
|
388
|
+
size: n.oneOf([null, "small", "medium", "large"]),
|
|
389
|
+
rounded: n.oneOf([null, "small", "medium", "large", "full"]),
|
|
390
|
+
fillMode: n.oneOf([null, "solid", "flat", "outline"])
|
|
391
|
+
};
|
|
392
|
+
T.displayName = "KendoNumericTextBox";
|
|
393
|
+
T.defaultProps = {
|
|
394
|
+
prefix: (b) => null,
|
|
395
|
+
suffix: (b) => null,
|
|
396
|
+
step: 1,
|
|
397
|
+
spinners: !0,
|
|
398
|
+
disabled: !1,
|
|
399
|
+
required: !1,
|
|
400
|
+
validityStyles: !0,
|
|
401
|
+
rangeOnEnter: !0,
|
|
402
|
+
onChange: (b) => {
|
|
403
|
+
},
|
|
404
|
+
onFocus: (b) => {
|
|
405
|
+
},
|
|
406
|
+
onBlur: (b) => {
|
|
407
|
+
},
|
|
408
|
+
size: "medium",
|
|
409
|
+
rounded: "medium",
|
|
410
|
+
fillMode: "solid"
|
|
411
|
+
};
|
|
412
|
+
export {
|
|
413
|
+
T as NumericTextBox,
|
|
414
|
+
Ee as NumericTextBoxPropsContext
|
|
415
|
+
};
|
|
@@ -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 F=11111111111111e-7,be=.31111111111111117,Le=1,w=1,ee=0,V=/\d/,ne=15,he=()=>({eventValue:null,prevLooseValue:"",currentLooseValue:"",focused:!1,selectionStart:void 0,selectionEnd:void 0,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1}),Ie=(t,n)=>t!==void 0?t:n,m=(t,n,r)=>t===null&&t===void 0?"":typeof t=="string"?t:r.formatNumber(t,n),B=t=>(String(t).split(".")[1]||"").length,te=(t,n)=>Math.max(B(t),B(n)),re=t=>Math.min(t,ne),G=(t,n)=>{const r=re(n);return parseFloat(t.toFixed(r))},Ne=(t,n,r,e,u,s,a)=>{const o=te(t||0,r||0),l=U(G((t||0)+(r||0),o),e,u);n.eventValue=l,n.currentLooseValue=m(l,s,a),n.selectionStart=n.selectionEnd=N(n.currentLooseValue,V)},Pe=(t,n,r,e,u,s,a)=>{const o=te(t||0,r||0),l=U(G((t||0)-(r||0),o),e,u);n.eventValue=l,n.currentLooseValue=m(l,s,a),n.selectionStart=n.selectionEnd=N(n.currentLooseValue,V)},U=(t,n,r)=>t==null?t:!(t>1||t<1||t===1)||r!==void 0&&n!==void 0&&r<n?null:(r!==void 0&&t>r&&(t=r),n!==void 0&&t<n&&(t=n),t),oe=(t,n)=>{const r=n.findIndex(([u,s])=>!!s&&t.indexOf(s)===t.length-s.length);if(r===-1)return-1;const e=n[r][1];return t.length-e.length},se=(t,n)=>{const r=n.findIndex(([u,s])=>!!u&&t.indexOf(u)===0);return r===-1?-1:n[r][0].length},ue=(t,n,r)=>{const e=oe(t,n);if(e!==-1&&r.selectionStart>e){r.selectionStart=r.selectionEnd=e;return}r.selectionStart>t.length&&(r.selectionStart=r.selectionEnd=t.length);const u=se(t,n);u!==-1&&r.selectionStart<u&&(r.selectionStart=r.selectionEnd=u),r.selectionStart===-1&&(r.selectionStart=r.selectionEnd=0)},p=(t,n,r,e)=>{t.selectionStart=t.selectionEnd=n,ue(r,e,t)},v=(t,n,r,e)=>{t.eventValue=e.parseNumber(t.prevLooseValue,n),t.currentLooseValue=t.prevLooseValue,t.valueIsCorrected=!0,p(t,t.selectionStart,t.currentLooseValue,r)},ie=(t,n)=>{const r=String(t.currentLooseValue),e=String(t.prevLooseValue);return r.split(n.minusSign).length!==e.split(n.minusSign).length&&r.length===e.length+n.minusSign.length},le=(t,n)=>{const r=String(t.currentLooseValue),e=String(t.prevLooseValue);return r.indexOf(n.minusSign)===-1&&e.indexOf(n.minusSign)!==-1},ce=(t,n)=>String(t.currentLooseValue).split(n.decimal).length>2,ae=(t,n)=>{const r=n.formatNumber(F,t),e=n.formatNumber(-F,t),u=n.formatNumber(ee,t),s=n.formatNumber(w,t),a=D(r),o=D(e),l=D(u),c=D(s),P=R(r),E=R(e),b=R(u),L=R(s);return{positiveInfo:[a,P],negativeInfo:[o,E],zeroInfo:[l,b],oneInfo:[c,L]}},de=(t,n)=>{const r=n.formatNumber(F,t),e=n.formatNumber(-F,t),u=n.formatNumber(ee,t),s=n.formatNumber(w,t),a=n.numberSymbols(),o=new RegExp(`[\\d\\${a.decimal}${a.group}]`,"g");return[r,e,u,s].map(c=>c.replace(o,"")).join("").split("").filter((c,P,E)=>E.indexOf(c)===P).join("")},y=(t,n)=>{const r=t.indexOf(n.decimal);return r>-1?r:N(t,V)},S=t=>t.split("").reverse().join(""),N=(t,n)=>t.length-S(t).search(n),D=t=>t.split(t[t.search(V)])[0],R=t=>{const n=S(t);return S(n.split(n[n.search(V)])[0])},C=(t,n)=>t.search(n),$=(t,n)=>{const r=t.indexOf(n);return r>-1?t.length-r-1:0},j=(t,n,r,e,u)=>{const s=t.replace(u,"")[0]==="0",a=n.replace(u,"")[0]==="0";if(s&&!a)return r-1;if(a&&e)return r+1;let o=0;for(let c=0;c<r;c++)V.test(t.charAt(c))&&o++;let l=0;for(;o>0&&n.length>l;)V.test(n.charAt(l))&&o--,l++;return l},Ee=(t,n,r)=>{const e={...t},{prevLooseValue:u}=e,s=r.numberSymbols(),a=de(n,r),o=String(e.currentLooseValue),l=String(u),c=new RegExp(`[^\\d\\${s.decimal}]`,"g"),P=new RegExp(`[^\\d\\${s.decimal}\\${s.group}]`,"g"),E=new RegExp(`[\\d\\${s.decimal}\\${s.group}]`),b=o.replace(c,""),L=C(o,V),O=L===-1?-1:N(o,V),ge=o.indexOf(s.decimal),X=(o.substring(0,L)+o.substring(L,O).replace(P,"")+o.substring(O,o.length)).split("").filter(x=>a.indexOf(x)!==-1||x.search(E)!==-1).join(""),Z=r.formatNumber(be,n).replace(c,""),W=Z.indexOf(s.decimal),I=W>-1?Z.length-W-1:0,k=r.formatNumber(Le,n).replace(c,""),q=k.indexOf(s.decimal),M=q>-1?k.length-q-1:0,{positiveInfo:fe,negativeInfo:me,zeroInfo:Ve,oneInfo:xe}=ae(n,r),g=[fe,me,Ve,xe],pe=g.findIndex(x=>x.findIndex(h=>!!h)!==-1)!==1,z=o.length>0&&o.length<l.length,H=typeof n=="string"&&n[0]==="p"&&o&&o.indexOf(s.percentSign)===-1;if(!e.isPaste){if(o==="")return e.eventValue=null,e.currentLooseValue="",e;if(e.currentLooseValue===s.minusSign&&r.formatNumber(-0,n)!==l)return e.eventValue=-0,e.currentLooseValue=m(e.eventValue,n,r),p(e,y(e.currentLooseValue,s),e.currentLooseValue,g),e;if(e.currentLooseValue===s.decimal){e.eventValue=0;const f=m(e.eventValue,n,r);if(M===0&&I>0){const i=N(f,V);e.currentLooseValue=f.substring(0,i)+s.decimal+f.substring(i)}else e.currentLooseValue=f;return p(e,y(e.currentLooseValue,s)+1,e.currentLooseValue,g),e}if(ie(e,s)){const f=r.parseNumber(u,n);e.eventValue=-(f!==null?f:0),e.currentLooseValue=m(e.eventValue,n,r);const i=C(e.currentLooseValue,V),d=C(l,V);return p(e,e.selectionEnd-1+(i-d),e.currentLooseValue,g),e}if(le(e,s))return e.eventValue=r.parseNumber(e.currentLooseValue,n),p(e,e.selectionStart,e.currentLooseValue,g),e;if(ce(e,s))return v(e,n,g,r),e;if(H)return e.eventValue=r.parseNumber(o,n)/100,e.currentLooseValue=m(e.eventValue,n,r),e;if(String(e.currentLooseValue).replace(/[^\d]/g,"").length>ne||b!==o&&o&&pe&&g.findIndex(([i,d])=>{const T=o.indexOf(i),_=o.indexOf(d),J=T===0,K=_===o.length-d.length,Q=T+i.length!==L&&L!==-1&&o[T+i.length]!==s.decimal,Y=_!==O&&O!==-1&&o[_-1]!==s.decimal;return i&&d?Q||Y?!1:J&&K:i?Q?!1:J:d?Y?!1:K:!1})===-1)return v(e,n,g,r),e;if(b[b.length-1]===s.decimal&&I>0)return e.eventValue=r.parseNumber(o,n),e.currentLooseValue=X,e;if(e.currentLooseValue&&u&&(a+s.decimal+s.group).split("").findIndex(i=>o.split("").filter(d=>d===i).length<l.split("").filter(d=>d===i).length&&o.length+1===l.length?!(i===s.decimal&&$(l.replace(c,""),s.decimal)===0):!1)>-1)return e.eventValue=r.parseNumber(t.prevLooseValue,n),e.currentLooseValue=t.prevLooseValue,e;const h=$(b,s.decimal),A=b[b.length-1]==="0";if(z&&A&&h<M)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=m(e.eventValue,n,r),e;if(h>0){const f=o.substring(0,ge);if(A&&(!f||l.indexOf(f)!==0)){e.eventValue=r.parseNumber(e.currentLooseValue,n);const i=m(e.eventValue,n,r);return p(e,j(o,i,e.selectionEnd,z,c),i,g),e.currentLooseValue=i,e}if(h>I){const i=o.indexOf(s.decimal),d=o.substring(0,i)+o.substring(i,i+1+I)+o.substring(O,String(e.currentLooseValue).length);return e.eventValue=r.parseNumber(d,n),e.currentLooseValue=d,p(e,e.selectionStart,d,g),e}if(M!==I&&h<=I&&A)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=X,e;if(h<M)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=m(e.eventValue,n,r),e}}if(e.eventValue=r.parseNumber(e.currentLooseValue,n),H&&(e.eventValue=e.eventValue/100),typeof e.eventValue=="number"){const x=m(e.eventValue,n,r);o.length===1?p(e,y(x,s),x,g):p(e,j(o,x,e.selectionEnd,z,c),x,g),e.currentLooseValue=x}else e.currentLooseValue=m(r.parseNumber(b),n,r);return e};exports.changeBasedSelection=j;exports.decreaseValue=Pe;exports.formatValue=m;exports.fractionLength=B;exports.getDecimalCount=$;exports.getFirstNumberIndex=C;exports.getFormatPrefixSufix=ae;exports.getFormatSymbols=de;exports.getInitialPosition=y;exports.getInitialState=he;exports.getLastNumberIndex=N;exports.getMaxCursorPosition=oe;exports.getMinCursorPosition=se;exports.getPrefix=D;exports.getStateOrPropsValue=Ie;exports.getSuffix=R;exports.increaseValue=Ne;exports.isDecimalDuplicated=ce;exports.isMinusSymbolAdded=ie;exports.isMinusSymbolRemoved=le;exports.limitPrecision=re;exports.rangeSelection=ue;exports.rangeValue=U;exports.reverseString=S;exports.sanitizeNumber=Ee;exports.setInvalid=v;exports.setSelection=p;exports.toFixedPrecision=G;
|