@progress/kendo-react-inputs 5.7.0-sig.202208281415 → 5.7.0
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/LICENSE.md +11 -0
- package/NOTICE.txt +111 -0
- package/README.md +4 -4
- package/about.md +1 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/dist/es/checkbox/Checkbox.js +1 -0
- package/dist/es/colors/ColorInput.js +1 -1
- package/dist/es/colors/ColorPalette.d.ts +1 -1
- package/dist/es/colors/ColorPicker.js +1 -1
- package/dist/es/colors/FlatColorPicker.js +1 -1
- package/dist/es/input/InputClearValue.d.ts +15 -0
- package/dist/es/input/InputClearValue.js +24 -0
- package/dist/es/input/InputPrefix.d.ts +15 -0
- package/dist/es/input/InputPrefix.js +24 -0
- package/dist/es/input/InputSeparator.d.ts +15 -0
- package/dist/es/input/InputSeparator.js +24 -0
- package/dist/es/input/InputSuffix.d.ts +15 -0
- package/dist/es/input/InputSuffix.js +24 -0
- package/dist/es/input/InputValidationIcon.d.ts +14 -0
- package/dist/es/input/InputValidationIcon.js +20 -0
- package/dist/es/main.d.ts +6 -0
- package/dist/es/main.js +6 -0
- package/dist/es/maskedtextbox/MaskedTextBox.d.ts +1 -1
- package/dist/es/numerictextbox/NumericTextBox.js +2 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rating/Rating.js +1 -1
- package/dist/es/signature/Signature.js +5 -5
- package/dist/es/signature/interfaces/SignatureProps.d.ts +4 -0
- package/dist/es/slider/Slider.js +2 -6
- package/dist/es/slider/SliderLabel.js +1 -2
- package/dist/es/switch/Switch.js +5 -5
- package/dist/es/textbox/Textbox.d.ts +69 -0
- package/dist/es/textbox/Textbox.js +111 -0
- package/dist/npm/checkbox/Checkbox.js +1 -0
- package/dist/npm/colors/ColorInput.js +1 -1
- package/dist/npm/colors/ColorPalette.d.ts +1 -1
- package/dist/npm/colors/ColorPicker.js +1 -1
- package/dist/npm/colors/FlatColorPicker.js +1 -1
- package/dist/npm/input/InputClearValue.d.ts +15 -0
- package/dist/npm/input/InputClearValue.js +27 -0
- package/dist/npm/input/InputPrefix.d.ts +15 -0
- package/dist/npm/input/InputPrefix.js +27 -0
- package/dist/npm/input/InputSeparator.d.ts +15 -0
- package/dist/npm/input/InputSeparator.js +27 -0
- package/dist/npm/input/InputSuffix.d.ts +15 -0
- package/dist/npm/input/InputSuffix.js +27 -0
- package/dist/npm/input/InputValidationIcon.d.ts +14 -0
- package/dist/npm/input/InputValidationIcon.js +23 -0
- package/dist/npm/main.d.ts +6 -0
- package/dist/npm/main.js +13 -1
- package/dist/npm/maskedtextbox/MaskedTextBox.d.ts +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.js +2 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rating/Rating.js +1 -1
- package/dist/npm/signature/Signature.js +5 -5
- package/dist/npm/signature/interfaces/SignatureProps.d.ts +4 -0
- package/dist/npm/slider/Slider.js +2 -6
- package/dist/npm/slider/SliderLabel.js +1 -2
- package/dist/npm/switch/Switch.js +5 -5
- package/dist/npm/textbox/Textbox.d.ts +69 -0
- package/dist/npm/textbox/Textbox.js +114 -0
- package/dist/systemjs/kendo-react-inputs.js +1 -1
- package/package.json +19 -17
- package/api.json +0 -71211
- package/dist/npm/signature/interfaces/SignatureState.d.ts +0 -15
- package/dist/npm/signature/interfaces/SignatureState.js +0 -2
- package/docs/_meta.yml +0 -3
- package/docs/api/Checkbox.md +0 -23
- package/docs/api/CheckboxBlurEvent.md +0 -132
- package/docs/api/CheckboxChangeEvent.md +0 -167
- package/docs/api/CheckboxFocusEvent.md +0 -132
- package/docs/api/CheckboxHandle.md +0 -167
- package/docs/api/CheckboxProps.md +0 -1068
- package/docs/api/CheckboxPropsContext.md +0 -17
- package/docs/api/ColorGradient.md +0 -27
- package/docs/api/ColorGradientChangeEvent.md +0 -167
- package/docs/api/ColorGradientHandle.md +0 -99
- package/docs/api/ColorGradientProps.md +0 -538
- package/docs/api/ColorGradientPropsContext.md +0 -17
- package/docs/api/ColorPalette.md +0 -26
- package/docs/api/ColorPaletteChangeEvent.md +0 -202
- package/docs/api/ColorPaletteHandle.md +0 -64
- package/docs/api/ColorPaletteProps.md +0 -542
- package/docs/api/ColorPalettePropsContext.md +0 -17
- package/docs/api/ColorPicker.md +0 -23
- package/docs/api/ColorPickerActiveColorClick.md +0 -132
- package/docs/api/ColorPickerBlurEvent.md +0 -97
- package/docs/api/ColorPickerChangeEvent.md +0 -132
- package/docs/api/ColorPickerFocusEvent.md +0 -97
- package/docs/api/ColorPickerGradientSettings.md +0 -102
- package/docs/api/ColorPickerPaletteSettings.md +0 -148
- package/docs/api/ColorPickerPopupSettings.md +0 -97
- package/docs/api/ColorPickerProps.md +0 -1078
- package/docs/api/ColorPickerPropsContext.md +0 -17
- package/docs/api/ColorPickerView.md +0 -19
- package/docs/api/Direction.md +0 -12
- package/docs/api/FlatColorPicker.md +0 -13
- package/docs/api/FlatColorPickerHandle.md +0 -127
- package/docs/api/FlatColorPickerProps.md +0 -412
- package/docs/api/FormComponentValidity.md +0 -428
- package/docs/api/Input.md +0 -17
- package/docs/api/InputChangeEvent.md +0 -167
- package/docs/api/InputHandle.md +0 -204
- package/docs/api/InputProps.md +0 -428
- package/docs/api/InputPropsContext.md +0 -17
- package/docs/api/MaskedTextBox.md +0 -17
- package/docs/api/MaskedTextBoxChangeEvent.md +0 -237
- package/docs/api/MaskedTextBoxEvent.md +0 -132
- package/docs/api/MaskedTextBoxHandle.md +0 -265
- package/docs/api/MaskedTextBoxProps.md +0 -1395
- package/docs/api/MaskedTextBoxPropsContext.md +0 -17
- package/docs/api/NumericTextBox.md +0 -13
- package/docs/api/NumericTextBoxBlurEvent.md +0 -132
- package/docs/api/NumericTextBoxChangeEvent.md +0 -167
- package/docs/api/NumericTextBoxFocusEvent.md +0 -132
- package/docs/api/NumericTextBoxHandle.md +0 -197
- package/docs/api/NumericTextBoxProps.md +0 -1471
- package/docs/api/NumericTextBoxPropsContext.md +0 -17
- package/docs/api/RadioButton.md +0 -17
- package/docs/api/RadioButtonBlurEvent.md +0 -132
- package/docs/api/RadioButtonChangeEvent.md +0 -167
- package/docs/api/RadioButtonFocusEvent.md +0 -132
- package/docs/api/RadioButtonHandle.md +0 -97
- package/docs/api/RadioButtonProps.md +0 -791
- package/docs/api/RadioButtonPropsContext.md +0 -17
- package/docs/api/RadioGroup.md +0 -17
- package/docs/api/RadioGroupChangeEvent.md +0 -167
- package/docs/api/RadioGroupFocusEvent.md +0 -132
- package/docs/api/RadioGroupHandle.md +0 -97
- package/docs/api/RadioGroupProps.md +0 -707
- package/docs/api/RadioGroupPropsContext.md +0 -17
- package/docs/api/Range.md +0 -13
- package/docs/api/RangeSlider.md +0 -17
- package/docs/api/RangeSliderChangeEvent.md +0 -132
- package/docs/api/RangeSliderHandle.md +0 -127
- package/docs/api/RangeSliderProps.md +0 -853
- package/docs/api/RangeSliderPropsContext.md +0 -17
- package/docs/api/Rating.md +0 -17
- package/docs/api/RatingChangeEvent.md +0 -132
- package/docs/api/RatingFocusEvent.md +0 -97
- package/docs/api/RatingHandle.md +0 -97
- package/docs/api/RatingItem.md +0 -13
- package/docs/api/RatingItemFocusEvent.md +0 -97
- package/docs/api/RatingItemHandle.md +0 -132
- package/docs/api/RatingItemKeyboardEvent.md +0 -97
- package/docs/api/RatingItemMouseEvent.md +0 -97
- package/docs/api/RatingItemProps.md +0 -941
- package/docs/api/RatingKeyboardEvent.md +0 -97
- package/docs/api/RatingMouseEvent.md +0 -97
- package/docs/api/RatingProps.md +0 -1308
- package/docs/api/RatingPropsContext.md +0 -17
- package/docs/api/Signature.md +0 -13
- package/docs/api/SignatureBlurEvent.md +0 -132
- package/docs/api/SignatureChangeEvent.md +0 -167
- package/docs/api/SignatureCloseEvent.md +0 -132
- package/docs/api/SignatureFocusEvent.md +0 -132
- package/docs/api/SignatureHandle.md +0 -162
- package/docs/api/SignatureOpenEvent.md +0 -132
- package/docs/api/SignatureProps.md +0 -1592
- package/docs/api/SignaturePropsContext.md +0 -17
- package/docs/api/Slider.md +0 -17
- package/docs/api/SliderChangeEvent.md +0 -167
- package/docs/api/SliderHandle.md +0 -99
- package/docs/api/SliderLabel.md +0 -62
- package/docs/api/SliderLabelProps.md +0 -171
- package/docs/api/SliderProps.md +0 -902
- package/docs/api/SliderPropsContext.md +0 -17
- package/docs/api/Switch.md +0 -17
- package/docs/api/SwitchChangeEvent.md +0 -167
- package/docs/api/SwitchHandle.md +0 -239
- package/docs/api/SwitchProps.md +0 -1081
- package/docs/api/SwitchPropsContext.md +0 -17
- package/docs/api/TextArea.md +0 -27
- package/docs/api/TextAreaBlurEvent.md +0 -132
- package/docs/api/TextAreaChangeEvent.md +0 -167
- package/docs/api/TextAreaFocusEvent.md +0 -132
- package/docs/api/TextAreaProps.md +0 -1082
- package/docs/api/TextAreaPropsContext.md +0 -17
- package/docs/api/TileSize.md +0 -18
- package/docs/api/ToggleBaseProps.md +0 -132
- package/docs/api/_meta.yml +0 -3
- package/docs/api/index.md +0 -425
- package/docs/auto-imports.js +0 -40
- package/docs/checkbox/_meta.yml +0 -3
- package/docs/checkbox/accessibility.md +0 -26
- package/docs/checkbox/appearance.md +0 -28
- package/docs/checkbox/controlled.md +0 -57
- package/docs/checkbox/default-state.md +0 -24
- package/docs/checkbox/disabled.md +0 -23
- package/docs/checkbox/forms-support.md +0 -90
- package/docs/checkbox/index.md +0 -46
- package/docs/checkbox/keyboard-navigation.md +0 -36
- package/docs/checkbox/labels.md +0 -36
- package/docs/colorgradient/_meta.yml +0 -3
- package/docs/colorgradient/color-contrast.md +0 -34
- package/docs/colorgradient/controlled.md +0 -32
- package/docs/colorgradient/disabled.md +0 -23
- package/docs/colorgradient/index.md +0 -42
- package/docs/colorgradient/noopacity.md +0 -28
- package/docs/colorpalette/_meta.yml +0 -3
- package/docs/colorpalette/assets/demo-img.png +0 -0
- package/docs/colorpalette/controlled.md +0 -32
- package/docs/colorpalette/custom.md +0 -23
- package/docs/colorpalette/disabled.md +0 -23
- package/docs/colorpalette/events.md +0 -27
- package/docs/colorpalette/index.md +0 -47
- package/docs/colorpalette/keyboard-navigation.md +0 -36
- package/docs/colorpalette/presets.md +0 -23
- package/docs/colorpicker/_meta.yml +0 -3
- package/docs/colorpicker/appearance.md +0 -30
- package/docs/colorpicker/color-contrast.md +0 -33
- package/docs/colorpicker/combined-views.md +0 -46
- package/docs/colorpicker/controlled.md +0 -57
- package/docs/colorpicker/custom.md +0 -67
- package/docs/colorpicker/default-value.md +0 -20
- package/docs/colorpicker/disabled.md +0 -20
- package/docs/colorpicker/index.md +0 -41
- package/docs/colorpicker/keyboard-navigation.md +0 -39
- package/docs/custom-attributes.md +0 -27
- package/docs/examples/attribute/class/main.tsx +0 -44
- package/docs/examples/attribute/func/main.tsx +0 -58
- package/docs/examples/checkbox/appearance/func/main.tsx +0 -33
- package/docs/examples/checkbox/controlled/checked/class/main.tsx +0 -32
- package/docs/examples/checkbox/controlled/checked/func/main.tsx +0 -29
- package/docs/examples/checkbox/controlled/value/class/main.tsx +0 -32
- package/docs/examples/checkbox/controlled/value/func/main.tsx +0 -28
- package/docs/examples/checkbox/default/func/main.tsx +0 -15
- package/docs/examples/checkbox/disabled/func/main.tsx +0 -19
- package/docs/examples/checkbox/forms/basic/class/main.tsx +0 -79
- package/docs/examples/checkbox/forms/basic/func/main.tsx +0 -71
- package/docs/examples/checkbox/forms/custom-message/class/main.tsx +0 -117
- package/docs/examples/checkbox/forms/custom-message/func/main.tsx +0 -124
- package/docs/examples/checkbox/forms/disable-styles/class/main.tsx +0 -126
- package/docs/examples/checkbox/forms/disable-styles/func/main.tsx +0 -125
- package/docs/examples/checkbox/forms/kendo-react-form/func/main.tsx +0 -137
- package/docs/examples/checkbox/keyboard/class/main.tsx +0 -32
- package/docs/examples/checkbox/keyboard/func/main.tsx +0 -27
- package/docs/examples/checkbox/labels/custom/func/main.tsx +0 -20
- package/docs/examples/checkbox/labels/setup/func/main.tsx +0 -20
- package/docs/examples/checkbox/main/func/main.tsx +0 -22
- package/docs/examples/colorgradient/colorcontrast/class/main.tsx +0 -48
- package/docs/examples/colorgradient/colorcontrast/func/main.tsx +0 -43
- package/docs/examples/colorgradient/controlled/class/main.tsx +0 -29
- package/docs/examples/colorgradient/controlled/func/main.tsx +0 -21
- package/docs/examples/colorgradient/disabled/func/main.tsx +0 -17
- package/docs/examples/colorgradient/opacity/class/main.tsx +0 -32
- package/docs/examples/colorgradient/opacity/func/main.tsx +0 -24
- package/docs/examples/colorgradient/overview/class/main.tsx +0 -42
- package/docs/examples/colorgradient/overview/func/main.tsx +0 -34
- package/docs/examples/colorpalette/controlled/class/main.tsx +0 -25
- package/docs/examples/colorpalette/controlled/func/main.tsx +0 -17
- package/docs/examples/colorpalette/custom/func/main.tsx +0 -13
- package/docs/examples/colorpalette/disabled/func/main.tsx +0 -13
- package/docs/examples/colorpalette/keyboard/class/main.tsx +0 -30
- package/docs/examples/colorpalette/keyboard/func/main.tsx +0 -30
- package/docs/examples/colorpalette/overview/basic/class/main.tsx +0 -55
- package/docs/examples/colorpalette/overview/basic/class/styles.css +0 -50
- package/docs/examples/colorpalette/overview/basic/func/main.tsx +0 -47
- package/docs/examples/colorpalette/overview/basic/func/styles.css +0 -50
- package/docs/examples/colorpalette/overview/events/class/main.tsx +0 -48
- package/docs/examples/colorpalette/overview/events/func/main.tsx +0 -40
- package/docs/examples/colorpalette/presets/func/main.tsx +0 -70
- package/docs/examples/colorpicker/appearance/func/main.tsx +0 -37
- package/docs/examples/colorpicker/colorcontrast/class/main.tsx +0 -50
- package/docs/examples/colorpicker/colorcontrast/func/main.tsx +0 -44
- package/docs/examples/colorpicker/controlled/popup/class/main.tsx +0 -39
- package/docs/examples/colorpicker/controlled/popup/func/main.tsx +0 -31
- package/docs/examples/colorpicker/controlled/value/class/main.tsx +0 -25
- package/docs/examples/colorpicker/controlled/value/func/main.tsx +0 -17
- package/docs/examples/colorpicker/custom/custom-icons/func/main.tsx +0 -18
- package/docs/examples/colorpicker/custom/gradient/func/main.tsx +0 -24
- package/docs/examples/colorpicker/custom/kendo-icons/func/main.tsx +0 -18
- package/docs/examples/colorpicker/custom/palette/func/main.tsx +0 -28
- package/docs/examples/colorpicker/default/func/main.tsx +0 -24
- package/docs/examples/colorpicker/disabled/func/main.tsx +0 -17
- package/docs/examples/colorpicker/keyboard/class/main.tsx +0 -30
- package/docs/examples/colorpicker/keyboard/func/main.tsx +0 -29
- package/docs/examples/colorpicker/overview/func/main.tsx +0 -24
- package/docs/examples/colorpicker/view/combined/class/main.tsx +0 -37
- package/docs/examples/colorpicker/view/combined/func/main.tsx +0 -27
- package/docs/examples/colorpicker/view/popup/class/main.tsx +0 -66
- package/docs/examples/colorpicker/view/popup/func/main.tsx +0 -55
- package/docs/examples/flatcolorpicker/basic/func/main.tsx +0 -13
- package/docs/examples/flatcolorpicker/customization/footer/func/main.tsx +0 -13
- package/docs/examples/flatcolorpicker/customization/header/func/main.tsx +0 -13
- package/docs/examples/flatcolorpicker/disabled/func/main.tsx +0 -13
- package/docs/examples/get-started/func/main.tsx +0 -14
- package/docs/examples/globalization/func/main.tsx +0 -47
- package/docs/examples/input/counter/main.tsx +0 -30
- package/docs/examples/input/forms/basic/class/main.tsx +0 -87
- package/docs/examples/input/forms/basic/func/main.tsx +0 -79
- package/docs/examples/input/forms/custom-message/class/main.tsx +0 -94
- package/docs/examples/input/forms/custom-message/func/main.tsx +0 -86
- package/docs/examples/input/forms/disable-styles/class/main.tsx +0 -115
- package/docs/examples/input/forms/disable-styles/func/main.tsx +0 -106
- package/docs/examples/input/forms/override/class/main.tsx +0 -111
- package/docs/examples/input/forms/override/func/main.tsx +0 -102
- package/docs/examples/input/main/main.jsx +0 -17
- package/docs/examples/input/overview/func/main.tsx +0 -88
- package/docs/examples/label/class/main.tsx +0 -69
- package/docs/examples/label/func/main.tsx +0 -65
- package/docs/examples/maskedtextbox/appearance/func/main.tsx +0 -41
- package/docs/examples/maskedtextbox/disabled/func/main.tsx +0 -24
- package/docs/examples/maskedtextbox/forms/basic/class/main.tsx +0 -78
- package/docs/examples/maskedtextbox/forms/basic/func/main.tsx +0 -70
- package/docs/examples/maskedtextbox/forms/custom-message/class/main.tsx +0 -81
- package/docs/examples/maskedtextbox/forms/custom-message/func/main.tsx +0 -73
- package/docs/examples/maskedtextbox/forms/disable-styles/class/main.tsx +0 -75
- package/docs/examples/maskedtextbox/forms/disable-styles/func/main.tsx +0 -67
- package/docs/examples/maskedtextbox/forms/override/class/main.tsx +0 -85
- package/docs/examples/maskedtextbox/forms/override/func/main.tsx +0 -75
- package/docs/examples/maskedtextbox/mask/basic/func/main.tsx +0 -19
- package/docs/examples/maskedtextbox/mask/extend/func/main.tsx +0 -35
- package/docs/examples/maskedtextbox/overview/basic/func/main.tsx +0 -18
- package/docs/examples/maskedtextbox/readonly/func/main.tsx +0 -20
- package/docs/examples/maskedtextbox/valid/class/main.tsx +0 -59
- package/docs/examples/maskedtextbox/valid/func/main.tsx +0 -51
- package/docs/examples/maskedtextbox/value/class/main.tsx +0 -37
- package/docs/examples/maskedtextbox/value/func/main.tsx +0 -29
- package/docs/examples/numerictextbox/appearance/func/main.tsx +0 -39
- package/docs/examples/numerictextbox/formats/func/main.tsx +0 -53
- package/docs/examples/numerictextbox/forms/basic/class/main.tsx +0 -75
- package/docs/examples/numerictextbox/forms/basic/func/main.tsx +0 -67
- package/docs/examples/numerictextbox/forms/custom-message/class/main.tsx +0 -82
- package/docs/examples/numerictextbox/forms/custom-message/func/main.tsx +0 -74
- package/docs/examples/numerictextbox/forms/disable-styles/class/main.tsx +0 -98
- package/docs/examples/numerictextbox/forms/disable-styles/func/main.tsx +0 -85
- package/docs/examples/numerictextbox/forms/override/class/main.tsx +0 -96
- package/docs/examples/numerictextbox/forms/override/func/main.tsx +0 -87
- package/docs/examples/numerictextbox/forms/ref/class/main.tsx +0 -44
- package/docs/examples/numerictextbox/forms/ref/func/main.tsx +0 -34
- package/docs/examples/numerictextbox/keyboard/func/main.tsx +0 -20
- package/docs/examples/numerictextbox/overview/class/main.tsx +0 -55
- package/docs/examples/numerictextbox/overview/func/main.tsx +0 -43
- package/docs/examples/numerictextbox/spin/func/main.tsx +0 -22
- package/docs/examples/numerictextbox/step/func/main.tsx +0 -21
- package/docs/examples/overview/func/main.tsx +0 -102
- package/docs/examples/props-context/overview/class/grid-with-filtering.tsx +0 -32
- package/docs/examples/props-context/overview/class/main.tsx +0 -26
- package/docs/examples/props-context/overview/class/sample-products.ts +0 -182
- package/docs/examples/props-context/overview/func/grid-with-filtering.tsx +0 -32
- package/docs/examples/props-context/overview/func/main.tsx +0 -24
- package/docs/examples/props-context/overview/func/sample-products.ts +0 -182
- package/docs/examples/radiobutton/appearance/func/main.tsx +0 -28
- package/docs/examples/radiobutton/custom-labels/func/main.tsx +0 -28
- package/docs/examples/radiobutton/disabled/func/main.tsx +0 -20
- package/docs/examples/radiobutton/labels/func/main.tsx +0 -20
- package/docs/examples/radiobutton/overview/class/main.tsx +0 -35
- package/docs/examples/radiobutton/overview/func/main.tsx +0 -30
- package/docs/examples/radiogroup/controlled/class/main.tsx +0 -49
- package/docs/examples/radiogroup/controlled/func/main.tsx +0 -40
- package/docs/examples/radiogroup/default-state/func/main.tsx +0 -19
- package/docs/examples/radiogroup/forms/class/main.tsx +0 -150
- package/docs/examples/radiogroup/forms/func/main.tsx +0 -146
- package/docs/examples/radiogroup/keyboard/class/main.tsx +0 -37
- package/docs/examples/radiogroup/keyboard/func/main.tsx +0 -31
- package/docs/examples/radiogroup/layout/class/main.tsx +0 -49
- package/docs/examples/radiogroup/layout/func/main.tsx +0 -43
- package/docs/examples/radiogroup/overview/func/main.tsx +0 -18
- package/docs/examples/rangeslider/controlled/class/main.tsx +0 -45
- package/docs/examples/rangeslider/controlled/func/main.tsx +0 -37
- package/docs/examples/rangeslider/disabled/func/main.tsx +0 -27
- package/docs/examples/rangeslider/labels/func/main.tsx +0 -26
- package/docs/examples/rangeslider/orientation/func/main.tsx +0 -27
- package/docs/examples/rangeslider/overview/func/main.tsx +0 -26
- package/docs/examples/rating/controlled/class/main.tsx +0 -29
- package/docs/examples/rating/controlled/func/main.tsx +0 -21
- package/docs/examples/rating/disabled/func/main.tsx +0 -18
- package/docs/examples/rating/forms/class/main.tsx +0 -85
- package/docs/examples/rating/forms/func/main.tsx +0 -79
- package/docs/examples/rating/icon/func/main.tsx +0 -15
- package/docs/examples/rating/items/func/main.tsx +0 -15
- package/docs/examples/rating/label/class/main.tsx +0 -33
- package/docs/examples/rating/label/func/main.tsx +0 -26
- package/docs/examples/rating/navigation/func/main.tsx +0 -15
- package/docs/examples/rating/overview/func/main.tsx +0 -12
- package/docs/examples/rating/precision/func/main.tsx +0 -27
- package/docs/examples/rating/rating-item/advanced/class/main.tsx +0 -82
- package/docs/examples/rating/rating-item/advanced/func/main.tsx +0 -76
- package/docs/examples/rating/rating-item/overview/func/main.tsx +0 -75
- package/docs/examples/rating/readonly/func/main.tsx +0 -18
- package/docs/examples/rating/selection/func/main.tsx +0 -25
- package/docs/examples/rtl/func/main.tsx +0 -99
- package/docs/examples/shared/checkbox-style-configurator.tsx +0 -69
- package/docs/examples/shared/es.json +0 -6
- package/docs/examples/shared/radiobutton-style-configurator.tsx +0 -47
- package/docs/examples/shared/sample-signature.ts +0 -2
- package/docs/examples/shared/style-configurator.tsx +0 -93
- package/docs/examples/shared/switch-style-configurator.tsx +0 -91
- package/docs/examples/signature/appearance/all-options/func/main.tsx +0 -89
- package/docs/examples/signature/appearance/color/func/main.tsx +0 -17
- package/docs/examples/signature/appearance/stroke-width/func/main.tsx +0 -16
- package/docs/examples/signature/controlled/export-scale/func/main.tsx +0 -34
- package/docs/examples/signature/controlled/popup/func/main.tsx +0 -28
- package/docs/examples/signature/controlled/value/func/main.tsx +0 -19
- package/docs/examples/signature/disabled/func/main.tsx +0 -17
- package/docs/examples/signature/events/func/main.tsx +0 -66
- package/docs/examples/signature/forms/kendo/func/main.tsx +0 -148
- package/docs/examples/signature/overview/func/main.tsx +0 -239
- package/docs/examples/signature/overview/func/styles.css +0 -56
- package/docs/examples/signature/popup/disabled/func/main.tsx +0 -14
- package/docs/examples/signature/popup/scale/func/main.tsx +0 -14
- package/docs/examples/signature/readonly/func/main.tsx +0 -17
- package/docs/examples/signature/smooth/func/main.tsx +0 -14
- package/docs/examples/slider/buttons/func/main.tsx +0 -18
- package/docs/examples/slider/controlled/class/main.tsx +0 -45
- package/docs/examples/slider/controlled/func/main.tsx +0 -36
- package/docs/examples/slider/labels/class/main.tsx +0 -44
- package/docs/examples/slider/labels/func/main.tsx +0 -35
- package/docs/examples/slider/orientation/func/main.tsx +0 -25
- package/docs/examples/slider/overview/func/main.tsx +0 -24
- package/docs/examples/switch/appearance/func/main.tsx +0 -38
- package/docs/examples/switch/controlled/manual/class/main.tsx +0 -40
- package/docs/examples/switch/controlled/manual/func/main.tsx +0 -33
- package/docs/examples/switch/controlled/readonly/func/main.tsx +0 -15
- package/docs/examples/switch/default/func/main.tsx +0 -15
- package/docs/examples/switch/disabled/func/main.tsx +0 -15
- package/docs/examples/switch/forms/basic/class/main.tsx +0 -81
- package/docs/examples/switch/forms/basic/func/main.tsx +0 -72
- package/docs/examples/switch/forms/custom-message/class/main.tsx +0 -108
- package/docs/examples/switch/forms/custom-message/func/main.tsx +0 -100
- package/docs/examples/switch/forms/disable-styles/class/main.tsx +0 -129
- package/docs/examples/switch/forms/disable-styles/func/main.tsx +0 -118
- package/docs/examples/switch/forms/kendo-react-form/class/main.tsx +0 -104
- package/docs/examples/switch/forms/kendo-react-form/func/main.tsx +0 -106
- package/docs/examples/switch/keyboard/class/main.tsx +0 -22
- package/docs/examples/switch/keyboard/func/main.tsx +0 -23
- package/docs/examples/switch/labels/func/main.tsx +0 -15
- package/docs/examples/switch/overview/basic/func/main.tsx +0 -15
- package/docs/examples/textarea/appearance/func/main.tsx +0 -39
- package/docs/examples/textarea/auto-sizing/func/main.tsx +0 -18
- package/docs/examples/textarea/controlled/class/main.tsx +0 -32
- package/docs/examples/textarea/controlled/func/main.tsx +0 -26
- package/docs/examples/textarea/counter/class/main.tsx +0 -38
- package/docs/examples/textarea/counter/func/main.tsx +0 -32
- package/docs/examples/textarea/default-state/func/main.tsx +0 -18
- package/docs/examples/textarea/disabled/func/main.tsx +0 -20
- package/docs/examples/textarea/forms/kendo-react-form/class/main.tsx +0 -152
- package/docs/examples/textarea/forms/kendo-react-form/func/main.tsx +0 -140
- package/docs/examples/textarea/main/func/main.tsx +0 -15
- package/docs/examples/textarea/overview/class/main.tsx +0 -103
- package/docs/examples/textarea/overview/func/main.tsx +0 -90
- package/docs/examples/textarea/sizing/func/main.tsx +0 -15
- package/docs/examples/tsconfig.json +0 -29
- package/docs/flatcolorpicker/_meta.yml +0 -3
- package/docs/flatcolorpicker/customization.md +0 -33
- package/docs/flatcolorpicker/disabled.md +0 -22
- package/docs/flatcolorpicker/index.md +0 -30
- package/docs/floating-labels.md +0 -35
- package/docs/get-started.md +0 -153
- package/docs/globalization.md +0 -67
- package/docs/index.md +0 -212
- package/docs/input/_meta.yml +0 -3
- package/docs/input/counter.md +0 -20
- package/docs/input/forms.md +0 -87
- package/docs/input/index.md +0 -40
- package/docs/maskedtextbox/_meta.yml +0 -3
- package/docs/maskedtextbox/accessibility.md +0 -22
- package/docs/maskedtextbox/appearance.md +0 -30
- package/docs/maskedtextbox/disabled-state.md +0 -20
- package/docs/maskedtextbox/forms.md +0 -87
- package/docs/maskedtextbox/index.md +0 -40
- package/docs/maskedtextbox/masks.md +0 -44
- package/docs/maskedtextbox/readonly-state.md +0 -20
- package/docs/maskedtextbox/valid-state.md +0 -25
- package/docs/maskedtextbox/value.md +0 -23
- package/docs/numerictextbox/_meta.yml +0 -3
- package/docs/numerictextbox/accessibility.md +0 -25
- package/docs/numerictextbox/appearance.md +0 -30
- package/docs/numerictextbox/formats.md +0 -25
- package/docs/numerictextbox/forms.md +0 -87
- package/docs/numerictextbox/index.md +0 -49
- package/docs/numerictextbox/keyboard-navigation.md +0 -26
- package/docs/numerictextbox/predefined-step.md +0 -20
- package/docs/numerictextbox/ref.md +0 -28
- package/docs/numerictextbox/spin-buttons.md +0 -20
- package/docs/props-context.md +0 -65
- package/docs/radiobutton/_meta.yml +0 -3
- package/docs/radiobutton/appearance.md +0 -26
- package/docs/radiobutton/disabled.md +0 -23
- package/docs/radiobutton/index.md +0 -47
- package/docs/radiobutton/labels.md +0 -36
- package/docs/radiogroup/_meta.yml +0 -3
- package/docs/radiogroup/accessibility.md +0 -25
- package/docs/radiogroup/controlled_mode.md +0 -34
- package/docs/radiogroup/default_state.md +0 -24
- package/docs/radiogroup/forms_support.md +0 -37
- package/docs/radiogroup/index.md +0 -41
- package/docs/radiogroup/keyboard_navigation.md +0 -37
- package/docs/radiogroup/layout.md +0 -29
- package/docs/rangeslider/_meta.yml +0 -3
- package/docs/rangeslider/accessibility.md +0 -26
- package/docs/rangeslider/controlled.md +0 -32
- package/docs/rangeslider/disabled.md +0 -23
- package/docs/rangeslider/index.md +0 -41
- package/docs/rangeslider/keyboard-navigation.md +0 -33
- package/docs/rangeslider/orientation.md +0 -24
- package/docs/rangeslider/ticks.md +0 -26
- package/docs/rating/_meta.yml +0 -3
- package/docs/rating/accessibility.md +0 -26
- package/docs/rating/forms_support.md +0 -39
- package/docs/rating/functionality-and-features/_meta.yml +0 -2
- package/docs/rating/functionality-and-features/controlled.md +0 -34
- package/docs/rating/functionality-and-features/disabled.md +0 -23
- package/docs/rating/functionality-and-features/icon.md +0 -27
- package/docs/rating/functionality-and-features/items.md +0 -24
- package/docs/rating/functionality-and-features/label.md +0 -28
- package/docs/rating/functionality-and-features/precision.md +0 -51
- package/docs/rating/functionality-and-features/readonly.md +0 -23
- package/docs/rating/functionality-and-features/selection.md +0 -23
- package/docs/rating/index.md +0 -45
- package/docs/rating/item_custamization.md +0 -45
- package/docs/rating/keyboard-navigation.md +0 -33
- package/docs/signature/_meta.yml +0 -3
- package/docs/signature/appearance.md +0 -96
- package/docs/signature/controlled.md +0 -60
- package/docs/signature/disabled.md +0 -21
- package/docs/signature/events.md +0 -20
- package/docs/signature/forms.md +0 -28
- package/docs/signature/index.md +0 -34
- package/docs/signature/line-smoothing.md +0 -16
- package/docs/signature/popup.md +0 -34
- package/docs/signature/readonly.md +0 -21
- package/docs/slider/_meta.yml +0 -3
- package/docs/slider/accessibility.md +0 -26
- package/docs/slider/controlled.md +0 -32
- package/docs/slider/index.md +0 -41
- package/docs/slider/keyboard-navigation.md +0 -33
- package/docs/slider/orientation.md +0 -24
- package/docs/slider/side-buttons.md +0 -24
- package/docs/slider/ticks.md +0 -31
- package/docs/switch/_meta.yml +0 -3
- package/docs/switch/accessibility.md +0 -17
- package/docs/switch/appearance.md +0 -30
- package/docs/switch/controlled-switch.md +0 -44
- package/docs/switch/default-state.md +0 -20
- package/docs/switch/disabled-state.md +0 -20
- package/docs/switch/forms-support.md +0 -78
- package/docs/switch/index.md +0 -44
- package/docs/switch/keyboard-navigation.md +0 -31
- package/docs/switch/labels.md +0 -29
- package/docs/textarea/_meta.yml +0 -3
- package/docs/textarea/appearance.md +0 -30
- package/docs/textarea/controlled_mode.md +0 -37
- package/docs/textarea/counter.md +0 -28
- package/docs/textarea/default_state.md +0 -25
- package/docs/textarea/disabled.md +0 -24
- package/docs/textarea/forms_support.md +0 -39
- package/docs/textarea/index.md +0 -51
- package/docs/textarea/sizing.md +0 -38
- package/e2e/a11y.tests.ts +0 -154
- package/e2e/input.tests.ts +0 -143
- package/e2e/numeric.tests.ts +0 -134
- package/e2e/switch.tests.ts +0 -122
- package/examples/checkbox/checkbox.html +0 -9
- package/examples/checkbox/checkbox.tsx +0 -292
- package/examples/checkbox/checkboxForm.html +0 -9
- package/examples/checkbox/checkboxForm.tsx +0 -81
- package/examples/checkbox/checked-n-value.html +0 -9
- package/examples/checkbox/checked-n-value.tsx +0 -115
- package/examples/checkbox/controlled-mode.html +0 -9
- package/examples/checkbox/controlled-mode.tsx +0 -69
- package/examples/checkbox/form.html +0 -9
- package/examples/checkbox/form.tsx +0 -78
- package/examples/checkbox/formik.html +0 -9
- package/examples/checkbox/formik.tsx +0 -89
- package/examples/colors/colorContrast.html +0 -12
- package/examples/colors/colorContrast.tsx +0 -52
- package/examples/colors/colorGradient.html +0 -9
- package/examples/colors/colorGradient.tsx +0 -37
- package/examples/colors/colorPalette.html +0 -9
- package/examples/colors/colorPalette.tsx +0 -29
- package/examples/colors/colorPicker.html +0 -22
- package/examples/colors/colorPicker.tsx +0 -58
- package/examples/colors/colorPickerLocalization.html +0 -9
- package/examples/colors/colorPickerLocalization.tsx +0 -31
- package/examples/colors/flatColorPicker.html +0 -12
- package/examples/colors/flatColorPicker.tsx +0 -21
- package/examples/context/class/grid-with-filtering.tsx +0 -32
- package/examples/context/class/index.html +0 -9
- package/examples/context/class/index.tsx +0 -28
- package/examples/context/class/sample-products.tsx +0 -182
- package/examples/context/func/grid-with-filtering.tsx +0 -32
- package/examples/context/func/index.html +0 -9
- package/examples/context/func/index.tsx +0 -26
- package/examples/context/func/sample-products.tsx +0 -182
- package/examples/e2e/accessibility/CheckboxExample.tsx +0 -26
- package/examples/e2e/accessibility/ColorGradientExample.tsx +0 -28
- package/examples/e2e/accessibility/ColorPaletteExample.tsx +0 -33
- package/examples/e2e/accessibility/ColorPickerExample.tsx +0 -21
- package/examples/e2e/accessibility/InputExample.tsx +0 -49
- package/examples/e2e/accessibility/MaskedTextBoxExample.tsx +0 -29
- package/examples/e2e/accessibility/NumericTextBoxExample.tsx +0 -24
- package/examples/e2e/accessibility/RadioButtonExample.tsx +0 -29
- package/examples/e2e/accessibility/RangeSliderExample.tsx +0 -26
- package/examples/e2e/accessibility/RatingExample.tsx +0 -13
- package/examples/e2e/accessibility/SliderExample.tsx +0 -19
- package/examples/e2e/accessibility/SwitchExample.tsx +0 -26
- package/examples/e2e/accessibility/TextAreaExample.tsx +0 -70
- package/examples/e2e/accessibility/main.html +0 -14
- package/examples/e2e/accessibility/main.tsx +0 -104
- package/examples/e2e/input/input.html +0 -9
- package/examples/e2e/input/input.tsx +0 -58
- package/examples/e2e/numerictextbox/numericLabel.html +0 -9
- package/examples/e2e/numerictextbox/numericLabel.tsx +0 -38
- package/examples/e2e/switch/switch.html +0 -16
- package/examples/e2e/switch/switch.tsx +0 -74
- package/examples/focus/focus.html +0 -9
- package/examples/focus/focus.tsx +0 -81
- package/examples/input/inputFloatingLabels.html +0 -9
- package/examples/input/inputFloatingLabels.tsx +0 -26
- package/examples/input/inputForm.html +0 -9
- package/examples/input/inputForm.tsx +0 -151
- package/examples/maskedtextbox/basic.html +0 -9
- package/examples/maskedtextbox/basic.tsx +0 -54
- package/examples/maskedtextbox/ipmask.html +0 -9
- package/examples/maskedtextbox/ipmask.tsx +0 -79
- package/examples/messages/index.ts +0 -4
- package/examples/numerictextbox/newNumeric.html +0 -9
- package/examples/numerictextbox/newNumeric.tsx +0 -149
- package/examples/numerictextbox/numeric.html +0 -9
- package/examples/numerictextbox/numeric.tsx +0 -247
- package/examples/numerictextbox/numericApiExample.html +0 -9
- package/examples/numerictextbox/numericApiExample.tsx +0 -25
- package/examples/numerictextbox/numericForm.html +0 -9
- package/examples/numerictextbox/numericForm.tsx +0 -89
- package/examples/numerictextbox/roundingIssues.html +0 -9
- package/examples/numerictextbox/roundingIssues.tsx +0 -51
- package/examples/numerictextbox/test.html +0 -9
- package/examples/numerictextbox/test.tsx +0 -165
- package/examples/numerictextbox/testingBlurDisabled.html +0 -9
- package/examples/numerictextbox/testingBlurDisabled.tsx +0 -167
- package/examples/radio-group/customization/index.html +0 -12
- package/examples/radio-group/customization/index.tsx +0 -32
- package/examples/radioButton/accessibility.html +0 -12
- package/examples/radioButton/accessibility.tsx +0 -81
- package/examples/radioButton/html-forms.html +0 -9
- package/examples/radioButton/html-forms.tsx +0 -63
- package/examples/radioButton/kendo-react-form.html +0 -12
- package/examples/radioButton/kendo-react-form.tsx +0 -80
- package/examples/radioButton/radio.html +0 -9
- package/examples/radioButton/radio.tsx +0 -45
- package/examples/radioButton/standalone-radio.html +0 -9
- package/examples/radioButton/standalone-radio.tsx +0 -76
- package/examples/range-slider/form/index.html +0 -9
- package/examples/range-slider/form/index.tsx +0 -57
- package/examples/range-slider/index.html +0 -9
- package/examples/range-slider/index.tsx +0 -147
- package/examples/rating/index.html +0 -9
- package/examples/rating/index.tsx +0 -158
- package/examples/rtl/index.html +0 -12
- package/examples/rtl/index.tsx +0 -29
- package/examples/signature/basic.html +0 -9
- package/examples/signature/basic.tsx +0 -72
- package/examples/signature/forms-basic.html +0 -9
- package/examples/signature/forms-basic.tsx +0 -72
- package/examples/signature/forms.html +0 -9
- package/examples/signature/forms.tsx +0 -90
- package/examples/slider/slider.html +0 -15
- package/examples/slider/slider.tsx +0 -99
- package/examples/slider/vertical.html +0 -15
- package/examples/slider/vertical.tsx +0 -28
- package/examples/switch/switch.html +0 -9
- package/examples/switch/switch.tsx +0 -44
- package/examples/switch/switchDoubleEvent.html +0 -9
- package/examples/switch/switchDoubleEvent.tsx +0 -25
- package/examples/switch/switchForm.html +0 -9
- package/examples/switch/switchForm.tsx +0 -138
- package/examples/textarea/formik.html +0 -12
- package/examples/textarea/formik.tsx +0 -84
- package/examples/textarea/textarea.html +0 -12
- package/examples/textarea/textarea.tsx +0 -96
- package/gulpfile.js +0 -7
- package/src/checkbox/Checkbox.tsx +0 -352
- package/src/checkbox/interfaces/CheckboxBlurEvent.ts +0 -7
- package/src/checkbox/interfaces/CheckboxChangeEvent.ts +0 -12
- package/src/checkbox/interfaces/CheckboxFocusEvent.ts +0 -7
- package/src/checkbox/interfaces/CheckboxProps.ts +0 -122
- package/src/colors/ColorContrastLabels.tsx +0 -83
- package/src/colors/ColorContrastSvg.tsx +0 -88
- package/src/colors/ColorGradient.tsx +0 -450
- package/src/colors/ColorInput.tsx +0 -192
- package/src/colors/ColorPalette.tsx +0 -329
- package/src/colors/ColorPicker.tsx +0 -387
- package/src/colors/FlatColorPicker.tsx +0 -258
- package/src/colors/HexInput.tsx +0 -67
- package/src/colors/Picker.tsx +0 -56
- package/src/colors/interfaces/ColorGradientChangeEvent.ts +0 -12
- package/src/colors/interfaces/ColorGradientProps.ts +0 -77
- package/src/colors/interfaces/ColorPaletteChangeEvent.ts +0 -16
- package/src/colors/interfaces/ColorPaletteProps.ts +0 -78
- package/src/colors/interfaces/ColorPickerActiveColorClick.ts +0 -17
- package/src/colors/interfaces/ColorPickerBlurEvent.ts +0 -13
- package/src/colors/interfaces/ColorPickerChangeEvent.ts +0 -17
- package/src/colors/interfaces/ColorPickerFocusEvent.ts +0 -13
- package/src/colors/interfaces/ColorPickerGradientSettings.ts +0 -19
- package/src/colors/interfaces/ColorPickerPaletteSettings.ts +0 -35
- package/src/colors/interfaces/ColorPickerPopupSettings.ts +0 -16
- package/src/colors/interfaces/ColorPickerProps.ts +0 -170
- package/src/colors/interfaces/ColorPickerView.ts +0 -10
- package/src/colors/interfaces/PickerPopupSettings.ts +0 -21
- package/src/colors/interfaces/PickerProps.ts +0 -51
- package/src/colors/models/hsva.ts +0 -9
- package/src/colors/models/output-format.ts +0 -4
- package/src/colors/models/palette-presets.ts +0 -54
- package/src/colors/models/rgb.ts +0 -8
- package/src/colors/models/rgba.ts +0 -9
- package/src/colors/models/table-cell.ts +0 -7
- package/src/colors/models/tile-size.ts +0 -8
- package/src/colors/utils/color-cache.ts +0 -71
- package/src/colors/utils/color-palette.service.ts +0 -79
- package/src/colors/utils/color-parser.ts +0 -158
- package/src/colors/utils/misc.ts +0 -23
- package/src/colors/utils/svg-calc.ts +0 -115
- package/src/common/SliderTooltip.tsx +0 -83
- package/src/common/SwitchController.ts +0 -130
- package/src/common/SwitchModel.ts +0 -12
- package/src/input/Input.tsx +0 -346
- package/src/input/interfaces/InputChangeEvent.tsx +0 -12
- package/src/interfaces/Direction.ts +0 -1
- package/src/interfaces/ToggleBaseProps.ts +0 -8
- package/src/main.ts +0 -57
- package/src/maskedtextbox/MaskedTextBox.tsx +0 -541
- package/src/maskedtextbox/MaskedTextBoxProps.ts +0 -215
- package/src/maskedtextbox/masking.service.ts +0 -230
- package/src/maskedtextbox/parsing/combinators.ts +0 -30
- package/src/maskedtextbox/parsing/parsers.ts +0 -179
- package/src/maskedtextbox/parsing/result.ts +0 -39
- package/src/maskedtextbox/parsing/stream.ts +0 -41
- package/src/maskedtextbox/utils.ts +0 -70
- package/src/messages/index.ts +0 -151
- package/src/numerictextbox/NumericTextBox.tsx +0 -626
- package/src/numerictextbox/interfaces/NumericTextBoxBlurEvent.tsx +0 -7
- package/src/numerictextbox/interfaces/NumericTextBoxChangeEvent.tsx +0 -12
- package/src/numerictextbox/interfaces/NumericTextBoxFocusEvent.tsx +0 -7
- package/src/numerictextbox/interfaces/NumericTextBoxHandle.tsx +0 -40
- package/src/numerictextbox/interfaces/NumericTextBoxProps.tsx +0 -180
- package/src/numerictextbox/interfaces/NumericTextBoxState.tsx +0 -15
- package/src/numerictextbox/utils/index.tsx +0 -744
- package/src/package-metadata.ts +0 -13
- package/src/radiobutton/RadioButton.tsx +0 -194
- package/src/radiobutton/RadioGroup.tsx +0 -190
- package/src/radiobutton/interfaces/RadioButtonBlurEvent.ts +0 -7
- package/src/radiobutton/interfaces/RadioButtonChangeEvent.ts +0 -12
- package/src/radiobutton/interfaces/RadioButtonFocusEvent.ts +0 -7
- package/src/radiobutton/interfaces/RadioButtonProps.ts +0 -102
- package/src/radiobutton/interfaces/RadioGroupChangeEvent.ts +0 -12
- package/src/radiobutton/interfaces/RadioGroupFocusEvent.ts +0 -7
- package/src/radiobutton/interfaces/RadioGroupProps.ts +0 -89
- package/src/range-slider/RangeSlider.tsx +0 -644
- package/src/range-slider/range-raducer.tsx +0 -153
- package/src/rating/Rating.tsx +0 -633
- package/src/rating/RatingItem.tsx +0 -268
- package/src/rating/models/index.tsx +0 -91
- package/src/rating/rating-reducer.tsx +0 -70
- package/src/rating/utils/index.tsx +0 -65
- package/src/signature/Signature.tsx +0 -488
- package/src/signature/interfaces/SignatureBlurEvent.tsx +0 -7
- package/src/signature/interfaces/SignatureChangeEvent.tsx +0 -12
- package/src/signature/interfaces/SignatureCloseEvent.tsx +0 -7
- package/src/signature/interfaces/SignatureFocusEvent.tsx +0 -7
- package/src/signature/interfaces/SignatureHandle.tsx +0 -35
- package/src/signature/interfaces/SignatureOpenEvent.tsx +0 -7
- package/src/signature/interfaces/SignatureProps.tsx +0 -227
- package/src/signature/interfaces/index.ts +0 -7
- package/src/signature/utils/index.ts +0 -11
- package/src/slider/Slider.tsx +0 -470
- package/src/slider/SliderLabel.tsx +0 -69
- package/src/switch/Switch.tsx +0 -559
- package/src/textarea/TextArea.tsx +0 -263
- package/src/textarea/interfaces/TextAreaBlurEvent.ts +0 -7
- package/src/textarea/interfaces/TextAreaChangeEvent.ts +0 -12
- package/src/textarea/interfaces/TextAreaFocusEvent.ts +0 -7
- package/src/textarea/interfaces/TextAreaProps.tsx +0 -131
- package/src/utils.ts +0 -16
- package/test/Checkbox.tsx +0 -252
- package/test/ColorGradient.tsx +0 -260
- package/test/ColorPalette.tsx +0 -440
- package/test/ColorPicker.tsx +0 -74
- package/test/Input.tsx +0 -255
- package/test/NumericTextBox.tsx +0 -984
- package/test/RadioButton.tsx +0 -176
- package/test/RangeSlider.tsx +0 -502
- package/test/Rating.tsx +0 -227
- package/test/Slider.tsx +0 -198
- package/test/Switch.tsx +0 -154
- package/test/TextArea.tsx +0 -216
- package/test/maskedtextbox/component.tsx +0 -424
- package/test/maskedtextbox/masking.service.tsx +0 -1345
- package/test/maskedtextbox/parser.tsx +0 -364
- package/tsconfig.es.json +0 -25
- package/tsconfig.json +0 -26
- package/tsconfig.npm.json +0 -25
package/test/NumericTextBox.tsx
DELETED
|
@@ -1,984 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Enzyme } from '@progress//kendo-react-tasks/test-utils';
|
|
4
|
-
import { loadMessages, LocalizationService } from '@progress/kendo-react-intl';
|
|
5
|
-
|
|
6
|
-
const { shallow, mount } = Enzyme;
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
NumericTextBox
|
|
10
|
-
} from '../src/numerictextbox/NumericTextBox';
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
messages,
|
|
14
|
-
|
|
15
|
-
numericDecreaseValue as decreaseValue,
|
|
16
|
-
numericIncreaseValue as increaseValue
|
|
17
|
-
} from '../src/messages';
|
|
18
|
-
import { IntlService, load } from '@progress/kendo-react-intl';
|
|
19
|
-
import { NumericTextBoxChangeEvent } from '../src/numerictextbox/interfaces/NumericTextBoxChangeEvent';
|
|
20
|
-
import { sanitizeNumber } from '../src/numerictextbox/utils';
|
|
21
|
-
|
|
22
|
-
// Bulgarian format space symbol - it's not regular space (32)
|
|
23
|
-
const fs = String.fromCharCode(160);
|
|
24
|
-
const skip = undefined;
|
|
25
|
-
const customCurrencyFormat = {
|
|
26
|
-
style: 'currency',
|
|
27
|
-
currency: 'EUR',
|
|
28
|
-
currencyDisplay: 'name'
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const testSanitize = (value, expectedValue, format?, prevLooseValue?, expectedEventValue?, isPaste?) => {
|
|
32
|
-
const result = sanitizeNumber(
|
|
33
|
-
{currentLooseValue: value, selectionStart: 0, selectionEnd: 0, prevLooseValue, isPaste} as any,
|
|
34
|
-
format,
|
|
35
|
-
new IntlService('bg')
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
expect(result.currentLooseValue).toBe(expectedValue);
|
|
39
|
-
|
|
40
|
-
if (expectedEventValue !== undefined) {
|
|
41
|
-
expect(result.eventValue).toBe(expectedEventValue);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const testSanitizePosition = (value, position, expectedValue, expectedPosition, format?, prevLooseValue?) => {
|
|
46
|
-
const newState = sanitizeNumber(
|
|
47
|
-
{
|
|
48
|
-
currentLooseValue: value,
|
|
49
|
-
selectionStart: position,
|
|
50
|
-
selectionEnd: position,
|
|
51
|
-
prevLooseValue: prevLooseValue
|
|
52
|
-
} as any,
|
|
53
|
-
format,
|
|
54
|
-
new IntlService('bg'));
|
|
55
|
-
expect(newState.currentLooseValue).toBe(expectedValue);
|
|
56
|
-
expect(newState.selectionStart).toBe(expectedPosition);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const testSanitizeEn = (value, position, expectedValue, expectedPosition, format?, prevLooseValue?) => {
|
|
60
|
-
const newState = sanitizeNumber(
|
|
61
|
-
{
|
|
62
|
-
currentLooseValue: value,
|
|
63
|
-
selectionStart: position,
|
|
64
|
-
selectionEnd: position,
|
|
65
|
-
prevLooseValue: prevLooseValue
|
|
66
|
-
} as any,
|
|
67
|
-
format,
|
|
68
|
-
new IntlService('en'));
|
|
69
|
-
expect(newState.currentLooseValue).toBe(expectedValue);
|
|
70
|
-
expect(newState.selectionStart).toBe(expectedPosition);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const loadCldr = () => {
|
|
74
|
-
load(
|
|
75
|
-
require('cldr-core/supplemental/likelySubtags.json'),
|
|
76
|
-
require('cldr-core/supplemental/currencyData.json'),
|
|
77
|
-
require('cldr-core/supplemental/weekData.json'),
|
|
78
|
-
|
|
79
|
-
require('cldr-numbers-full/main/bg/numbers.json'),
|
|
80
|
-
require('cldr-numbers-full/main/bg/currencies.json'),
|
|
81
|
-
require('cldr-dates-full/main/bg/ca-gregorian.json'),
|
|
82
|
-
require('cldr-dates-full/main/bg/dateFields.json'),
|
|
83
|
-
require('cldr-dates-full/main/bg/timeZoneNames.json')
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
describe('NumericTextBox', () => {
|
|
88
|
-
|
|
89
|
-
beforeEach(() => {
|
|
90
|
-
spyOn(console, 'error');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
describe('sanitizeNumber', () => {
|
|
94
|
-
loadCldr();
|
|
95
|
-
|
|
96
|
-
it('sanitize decimal number and minus symbol', () => {
|
|
97
|
-
testSanitize('-3,0-', '3', undefined, '-3,0');
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('sanitize double decimal symbol', () => {
|
|
101
|
-
testSanitize(',,', ',' , undefined, ',');
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('sanitize percent format', () => {
|
|
105
|
-
testSanitize('123%', '123%' , 'p', '12%', 1.23);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('sanitize percent format paste', () => {
|
|
109
|
-
testSanitize('1', '1%' , 'p', '', 0.01, true);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it('sanitize percent format', () => {
|
|
113
|
-
testSanitize('12300%', '12 300%' , 'p', '12 300%', 123);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('sanitize percent format deletion', () => {
|
|
117
|
-
testSanitize('%', '', 'p', '1%', null);
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it('sanitize percent format deletion with decimal places', () => {
|
|
121
|
-
testSanitize('4', '4,0%', 'p1', '1%', 0.04);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it('sanitize percent format with initial value', () => {
|
|
125
|
-
testSanitize('12', '12%' , 'p', undefined, 0.12);
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('sanitize repetitive number char', () => {
|
|
129
|
-
testSanitize('111,', '111,');
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it('sanitize decimal symbol', () => {
|
|
133
|
-
testSanitize(',', '0,');
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it('sanitize decimal symbol with no decimal', () => {
|
|
137
|
-
testSanitize(',', '0', '#', '');
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it('sanitize another culture group symbol', () => {
|
|
141
|
-
testSanitize('.', '');
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it('sanitize minus symbol when previous is null', () => {
|
|
145
|
-
testSanitize('-', '-0', undefined, '');
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it('sanitize group symbol', () => {
|
|
149
|
-
testSanitize(' ', '');
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it('sanitize exponential symbol', () => {
|
|
153
|
-
testSanitize('e', '');
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// Special case comes when format have OPTIONAL DECIMAL PLACES
|
|
157
|
-
it('sanitize zero with optional decimals', () => {
|
|
158
|
-
testSanitize('0,00', '0,00', undefined, '0,0');
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
it('sanitize number deleting zero from negative zero', () => {
|
|
162
|
-
testSanitize('-', '', undefined, '-0');
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('sanitize replacing value', () => {
|
|
166
|
-
testSanitize('-', '-0', undefined, '123455');
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it('sanitize number with two decimals', () => {
|
|
170
|
-
testSanitize('1,01', '1,01');
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it('sanitize number with several minus symbols', () => {
|
|
174
|
-
testSanitize('-0-', '-0');
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it('sanitize number with leading zeros', () => {
|
|
178
|
-
// leading zeros are not problem as you are not typing backwards
|
|
179
|
-
testSanitize('000,1', '000,1', '000.##');
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('sanitize number ending on letters', () => {
|
|
183
|
-
testSanitize(',sad', ',');
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
it('sanitize number ending on letters with custom format', () => {
|
|
187
|
-
testSanitize('(1,)', '(1,)', '#.#;(#.#)');
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
it('sanitize number several decimal separators', () => {
|
|
191
|
-
testSanitize('1,111,010', '1,111010', 'n2', '1,111010');
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it('sanitize number with optional decimals', () => {
|
|
195
|
-
testSanitize('1,00', '1,00', undefined, '1,0');
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it('sanitize number with optional decimals and custom negative format', () => {
|
|
199
|
-
testSanitize('-1,00', '(1)', '#.#;(0.##)', '1,00');
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
it('sanitize number with optional decimals', () => {
|
|
203
|
-
testSanitize('1,00', '1,0', '#.#;(0.##)', '1,0');
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
it('sanitize number with optional decimals and deletion', () => {
|
|
207
|
-
testSanitize('1', '1', '#.#', '1,');
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
it('sanitize number with required decimals and deletion', () => {
|
|
211
|
-
testSanitize('10', '1,0', '#.0', '1,0');
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it('sanitize number with optional decimals during paste', () => {
|
|
215
|
-
testSanitize('-1,00', '(1)', '#.#;(0.##)', undefined, undefined, true);
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
it('sanitize number with optional decimals and grouping', () => {
|
|
219
|
-
// case when from formatted number we can move to unformatted due to decimal ending on zero
|
|
220
|
-
// Keep in mind that in BG culture group separator is not SPACE!
|
|
221
|
-
testSanitize('1 111,010', '1 111,010', undefined, '1 111,01');
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
it('sanitize number with optional decimals and more decimals than max', () => {
|
|
225
|
-
// case when you try handle trailing zero incorrectly
|
|
226
|
-
testSanitize('1,0000', '1,000', undefined, '1,000');
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it('sanitize number where format is without decimals', () => {
|
|
230
|
-
testSanitize('1,', `1`, 'n0');
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
it('sanitize number with optional decimals and accounting format', () => {
|
|
234
|
-
// case when from formatted number we can move to unformatted due to decimal ending on zero
|
|
235
|
-
testSanitize(`(1 111,010${fs}лв.)`, `(1 111,010${fs}лв.)`, 'a3');
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
// actually not valid case
|
|
239
|
-
it('sanitize decimal negative zero', () => {
|
|
240
|
-
testSanitize('-,0', '-,0', undefined, '-,0');
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
it('sanitize zero', () => {
|
|
244
|
-
testSanitize('-0,0', '-0,0', undefined, '-0,');
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
it('sanitize decimal zero', () => {
|
|
248
|
-
testSanitize(',', '0,', undefined, '');
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
it('sanitize typing more than 15 symbols', () => {
|
|
252
|
-
testSanitize('11,11111111111111', '11,1111111111111', '##.#############', '11,1111111111111');
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
it('sanitize negative parsable decimal', () => {
|
|
256
|
-
testSanitize('-,1', '-0,1');
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
it('sanitize decimal negative zero', () => {
|
|
260
|
-
testSanitize('-,', '-,');
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
it('sanitize NaN as string zero', () => {
|
|
264
|
-
testSanitize('NaN', '');
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
it('sanitize NaN zero', () => {
|
|
268
|
-
testSanitize(NaN, '', skip, skip, null);
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
/// to format
|
|
272
|
-
it('sanitize negative', () => {
|
|
273
|
-
testSanitize('-10,', '-10,', skip, skip, -10);
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
it('sanitize negative parsable', () => {
|
|
277
|
-
testSanitize('-0,123', '-0,123', skip, skip, -0.123);
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
it('sanitize accounting format', () => {
|
|
281
|
-
testSanitize(`(123${fs}лв.)`, `(123,00${fs}лв.)`, 'a2', skip, -123);
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
it('sanitize decimal inside format symbols', () => {
|
|
285
|
-
testSanitize(`123${fs}л,в.`, `123${fs}лв.`, 'a2', `123${fs}лв.`, 123);
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
it('sanitize dots inside format symbols', () => {
|
|
289
|
-
testSanitize(`123${fs}л,.в.`, `123${fs}лв.`, 'a2', `123${fs}лв.`, 123);
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
it('sanitize typing after format', () => {
|
|
293
|
-
testSanitize(`(123${fs}лв.4)`, `(123${fs}лв.)`, 'a2', `(123${fs}лв.)`, -123);
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
it('sanitize typing format symbols in numbers', () => {
|
|
297
|
-
testSanitize(`(123.,00${fs}лв.)`, `(123,00${fs}лв.)`, 'a2', undefined, -123);
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
it('sanitize trailing format symbols', () => {
|
|
301
|
-
testSanitize(`(123,00..${fs}лв.)`, `(123,00${fs}лв.)`, 'a2', `(123,00${fs}лв.)`, -123);
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
it('sanitize format symbols in front of prefix', () => {
|
|
305
|
-
testSanitize(`(.123,00${fs}лв.)`, `(123,00${fs}лв.)`, 'a2', `(123,00${fs}лв.)`, -123);
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
it('sanitize format symbols in front of number', () => {
|
|
309
|
-
testSanitize(`лв. .123,00`, `лв. 123,00`, '$ ##.##', `лв. 123,00`, 123);
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
it('sanitize deleted number with trailing zero', () => {
|
|
313
|
-
testSanitize(`лв. 123,0`, `лв. 123,00`, '$ ##.00', `лв. 123,30`, 123);
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
it('sanitize typing minus', () => {
|
|
317
|
-
testSanitizePosition('-', 1, '-0,00', 2, 'n2', '');
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
it('sanitize replacing minus', () => {
|
|
321
|
-
testSanitizePosition('4', 1, '4', 1, 'n2', '-1');
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
it('sanitize typing minus in existing number', () => {
|
|
325
|
-
testSanitizePosition('-', 1, '-0,00', 2, 'n2', '');
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
it('sanitize typing minus in existing number with prefix format', () => {
|
|
329
|
-
testSanitizePosition(`12-3,00${fs}лв.`, 3, `(123,00${fs}лв.)`, 3, 'a2', `123,00${fs}лв.`);
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
it('sanitize typing minus in existing number with suffix format', () => {
|
|
333
|
-
testSanitizePosition(`12-3,00${fs}лв.`, 3, `-123,00${fs}лв.`, 3, 'c2', `123,00${fs}лв.`);
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
it('sanitize removing minus in existing number with suffix format', () => {
|
|
337
|
-
testSanitizePosition(`123,00${fs}лв.`, 3, `123,00${fs}лв.`, 3, 'c2', `-123,00${fs}лв.`);
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
it('sanitize typing minus in existing number with suffix format', () => {
|
|
341
|
-
testSanitizePosition(`-12-3,00${fs}лв.`, 4, `123,00${fs}лв.`, 2, 'c2', `-123,00${fs}лв.`);
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
it('sanitize typing dublicated decimal', () => {
|
|
345
|
-
testSanitizePosition(`1,,2${fs}лв.`, 3, `1,2${fs}лв.`, 3, 'c2', `1,2${fs}лв.`);
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
it('sanitize deleting decimal', () => {
|
|
349
|
-
testSanitizePosition(`12${fs}лв.`, 1, `1,2${fs}лв.`, 1, 'c2', `1,2${fs}лв.`);
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
it('sanitize adding decimal and group symbol', () => {
|
|
353
|
-
testSanitizePosition(`1111`, 4, `1${fs}111`, 5, undefined, `111`);
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
it('sanitize adding decimal and group symbol before the symbol', () => {
|
|
357
|
-
testSanitizePosition(`1111`, 1, `1${fs}111`, 1, undefined, `111`);
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
it('sanitize deleting decimal and group symbol', () => {
|
|
361
|
-
testSanitizePosition(`1 11`, 2, `111`, 1, undefined, `1 111`);
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
it('sanitize deleting decimal and group symbol before the symbol', () => {
|
|
365
|
-
testSanitizePosition(` 111`, 1, `111`, 0, undefined, `1 111`);
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
it('sanitize deleting decimal and group symbol before the symbol', () => {
|
|
369
|
-
testSanitizePosition(`1 11`, 4, `111`, 3, undefined, `1 111`);
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
it('sanitize deleting last number before decimal', () => {
|
|
373
|
-
testSanitizePosition(`,30${fs}лв.`, 0, `0,30${fs}лв.`, 1, 'a2', `0,30${fs}лв.`);
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
it('sanitize typing first number with suffix based format', () => {
|
|
377
|
-
testSanitizePosition(`1`, 1, `1,00${fs}лв.`, 1, 'a2', ``);
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
it('sanitize typing first number with prefix based format', () => {
|
|
381
|
-
testSanitizePosition(`1`, 1, `лв. 1,00`, 5, '$ #.00', ``);
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
it('sanitize next value have less numbers than previous', () => {
|
|
385
|
-
testSanitizePosition(`-00`, 3, `-0`, 2, undefined, `-0`);
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
it('sanitize deleting group symbol', () => {
|
|
389
|
-
testSanitizePosition(`12 323423`, 6, `12 323 423`, 6, undefined, `12 323 423`);
|
|
390
|
-
});
|
|
391
|
-
|
|
392
|
-
it('sanitize deleting decimal result', () => {
|
|
393
|
-
testSanitizePosition(`34,3${fs}лв.`, 4, `34,30${fs}лв.`, 4, 'a2', `34,30${fs}лв.`);
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
it('sanitize typing invalid symbols after number', () => {
|
|
397
|
-
testSanitizePosition(`34,30.${fs}лв.`, 6, `34,30${fs}лв.`, 5, 'a2', `34,30${fs}лв.`);
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
it('sanitize trying to delete prefix', () => {
|
|
401
|
-
testSanitizePosition(`34,30${fs}лв.)`, 0, `(34,30${fs}лв.)`, 1, 'a2', `(34,30${fs}лв.)`);
|
|
402
|
-
});
|
|
403
|
-
|
|
404
|
-
it('sanitize gap contains decimal separator', () => {
|
|
405
|
-
testSanitizePosition(`10, лв.`, 3, `10, лв.`, 3, '#.## $', `10 лв.`);
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
it('sanitize typing decimal', () => {
|
|
409
|
-
testSanitizePosition(`,`, 1, `0,00${fs}лв.`, 2, 'a2', `34,30${fs}лв.`);
|
|
410
|
-
});
|
|
411
|
-
|
|
412
|
-
it('sanitize typing more decimals than allowed', () => {
|
|
413
|
-
testSanitizePosition(`34,300${fs}лв.`, 6, `34,30${fs}лв.`, 5, 'a2', `34,30${fs}лв.`);
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
it('sanitize first digit type suffix', () => {
|
|
417
|
-
testSanitizePosition(`1`, 1, `1,00 лв.`, 1, '#.00 $', ``);
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
it('sanitize first digit type suffix with prefix zero and no decimal', () => {
|
|
421
|
-
testSanitizePosition(`1`, 1, `0001 лв.`, 4, '0000 $', ``);
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
it('sanitize first digit type prefix wo currency', () => {
|
|
425
|
-
testSanitizePosition(`1`, 1, `1,00`, 1, '#.00', ``);
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
it('sanitize first digit type suffix with prefix zero and no decimal wo currency', () => {
|
|
429
|
-
testSanitizePosition(`1`, 1, `0001`, 4, '0000', ``);
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
it('sanitize first digit type prefix', () => {
|
|
433
|
-
testSanitizePosition(`1`, 1, `лв. 1,00`, 5, '$ #.00', ``);
|
|
434
|
-
});
|
|
435
|
-
|
|
436
|
-
it('sanitize first digit type prefix with prefix zero and no decimal', () => {
|
|
437
|
-
testSanitizePosition(`1`, 1, `лв. 0001`, 8, '$ 0000', ``);
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
it('sanitize deleting calculate next selection out of range', () => {
|
|
441
|
-
testSanitizePosition(` 111,00${fs}лв.`, 0, `111,00${fs}лв.`, 0, 'a2', `1 111,00${fs}лв.`);
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
it('sanitize max number', () => {
|
|
445
|
-
testSanitizePosition(
|
|
446
|
-
`111 111 111 111 111 1141 752,00 лв.`,
|
|
447
|
-
1,
|
|
448
|
-
`11 111 111 111 111 114 752,00 лв.`,
|
|
449
|
-
1,
|
|
450
|
-
'a2',
|
|
451
|
-
`11 111 111 111 111 114 752,00 лв.`
|
|
452
|
-
);
|
|
453
|
-
});
|
|
454
|
-
|
|
455
|
-
it('sanitize toggle minus sign on zero', () => {
|
|
456
|
-
testSanitizePosition(`-0-,00${fs}лв.`, 3, `0,00${fs}лв.`, 1, 'c2', `-0,00${fs}лв.`);
|
|
457
|
-
});
|
|
458
|
-
|
|
459
|
-
it('sanitize delete last digit account format', () => {
|
|
460
|
-
testSanitizePosition(`(,00${fs}лв.)`, 1, `(0,00${fs}лв.)`, 2, 'a2', `(2,00${fs}лв.)`);
|
|
461
|
-
});
|
|
462
|
-
|
|
463
|
-
it('sanitize type more decimals than allowed in a2', () => {
|
|
464
|
-
testSanitizePosition(`(1,323${fs}лв.)`, 6, `(1,32${fs}лв.)`, 5, 'a2', `(1,32${fs}лв.)`);
|
|
465
|
-
});
|
|
466
|
-
|
|
467
|
-
// TODO: fix positioning in this case
|
|
468
|
-
it('sanitize works with 1 format add', () => {
|
|
469
|
-
testSanitizeEn(`12.00 euro`, 2, `12.00 euros`, 2, customCurrencyFormat, `1.00 euro`);
|
|
470
|
-
});
|
|
471
|
-
|
|
472
|
-
it('sanitize works with 1 format remove', () => {
|
|
473
|
-
testSanitizeEn(`1.00 euros`, 1, `1.00 euro`, 1, customCurrencyFormat, `12.00 euros`);
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
it('sanitize works with 0 format add', () => {
|
|
477
|
-
testSanitizeEn(`01.00 euros`, 2, `1.00 euro`, 1, customCurrencyFormat, `0.00 euros` );
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
it('sanitize works with 0 format remove', () => {
|
|
481
|
-
testSanitizeEn(`.00 euro`, 0, `0.00 euros`, 1, customCurrencyFormat, `1.00 euro`);
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
it('sanitize works with 12 format with decimal ending on one', () => {
|
|
485
|
-
testSanitizeEn(`12.01 euro`, 2, `12.01 euros`, 2, customCurrencyFormat, `1.01 euro`);
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
it('sanitize works with 12 format with decimal ending on one', () => {
|
|
489
|
-
testSanitizeEn(`1111.01 euro`, 4, `1,111.01 euros`, 5, customCurrencyFormat, `111.01 euro`);
|
|
490
|
-
});
|
|
491
|
-
|
|
492
|
-
it('sanitize works with 12 format with decimal ending on one', () => {
|
|
493
|
-
testSanitizeEn(`00000.01`, 0, `00000.01`, 1, '00000.##', `100000.01`);
|
|
494
|
-
});
|
|
495
|
-
});
|
|
496
|
-
|
|
497
|
-
describe('renders', () => {
|
|
498
|
-
it('should render a span', () => {
|
|
499
|
-
const type = shallow(<NumericTextBox />).type();
|
|
500
|
-
expect(type).toEqual('span');
|
|
501
|
-
});
|
|
502
|
-
|
|
503
|
-
it('should render correct class', () => {
|
|
504
|
-
const component = shallow(<NumericTextBox />);
|
|
505
|
-
|
|
506
|
-
expect(component.hasClass('k-numerictextbox')).toBe(true);
|
|
507
|
-
expect(component.hasClass('k-input')).toBe(true);
|
|
508
|
-
});
|
|
509
|
-
|
|
510
|
-
it('should have an Input with correct class', () => {
|
|
511
|
-
const inputClassName = shallow(<NumericTextBox />).find('input').hasClass('k-input-inner');
|
|
512
|
-
expect(inputClassName).toBe(true);
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
it('should render spinners', () => {
|
|
516
|
-
const spinners = mount(<NumericTextBox />).find('.k-input-spinner button');
|
|
517
|
-
expect(spinners.length).toEqual(2);
|
|
518
|
-
});
|
|
519
|
-
|
|
520
|
-
it('should not render spinners', () => {
|
|
521
|
-
const spinners = shallow(<NumericTextBox spinners={false} />).find('.k-input-spinner button');
|
|
522
|
-
expect(spinners.length).toEqual(0);
|
|
523
|
-
});
|
|
524
|
-
|
|
525
|
-
it('should render spinners title', () => {
|
|
526
|
-
const numeric = shallow(<NumericTextBox />);
|
|
527
|
-
const increaseSpinner = numeric.find('.k-spinner-increase');
|
|
528
|
-
const decreaseSpinner = numeric.find('.k-spinner-decrease');
|
|
529
|
-
|
|
530
|
-
expect(increaseSpinner.prop('title')).toEqual(messages[increaseValue]);
|
|
531
|
-
expect(decreaseSpinner.prop('title')).toEqual(messages[decreaseValue]);
|
|
532
|
-
});
|
|
533
|
-
|
|
534
|
-
it('should render spinners aria-label', () => {
|
|
535
|
-
const numeric = shallow(<NumericTextBox />);
|
|
536
|
-
const increaseSpinner = numeric.find('.k-spinner-increase');
|
|
537
|
-
const decreaseSpinner = numeric.find('.k-spinner-decrease');
|
|
538
|
-
|
|
539
|
-
expect(increaseSpinner.prop('aria-label')).toEqual(messages[increaseValue]);
|
|
540
|
-
expect(decreaseSpinner.prop('aria-label')).toEqual(messages[decreaseValue]);
|
|
541
|
-
});
|
|
542
|
-
|
|
543
|
-
// describe('language translations', () => {
|
|
544
|
-
// const bgMessages = { [increaseValue]: 'Увеличи', [decreaseValue]: 'Намали' };
|
|
545
|
-
|
|
546
|
-
// loadMessages(bgMessages, 'bg');
|
|
547
|
-
|
|
548
|
-
// const numeric = shallow(
|
|
549
|
-
// <NumericTextBox />,
|
|
550
|
-
// {
|
|
551
|
-
// context: { kendoLocalizationService: new LocalizationService('bg') }
|
|
552
|
-
// });
|
|
553
|
-
// const increaseSpinner = numeric.find('button.k-spinner-increase');
|
|
554
|
-
// const decreaseSpinner = numeric.find('button.k-spinner-decrease');
|
|
555
|
-
|
|
556
|
-
// it('should render spinners title', () => {
|
|
557
|
-
// expect(increaseSpinner.prop('title')).toEqual(bgMessages[increaseValue]);
|
|
558
|
-
// expect(decreaseSpinner.prop('title')).toEqual(bgMessages[decreaseValue]);
|
|
559
|
-
// });
|
|
560
|
-
|
|
561
|
-
// it('should render spinners aria-label', () => {
|
|
562
|
-
// expect(increaseSpinner.prop('aria-label')).toEqual(bgMessages[increaseValue]);
|
|
563
|
-
// expect(decreaseSpinner.prop('aria-label')).toEqual(bgMessages[decreaseValue]);
|
|
564
|
-
// });
|
|
565
|
-
// });
|
|
566
|
-
});
|
|
567
|
-
|
|
568
|
-
it('have null default value and renders empty input', () => {
|
|
569
|
-
const numeric = mount(<NumericTextBox />).find(NumericTextBox);
|
|
570
|
-
const input = numeric.find('input');
|
|
571
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
572
|
-
expect(el.value).toBe('');
|
|
573
|
-
});
|
|
574
|
-
|
|
575
|
-
it('have empty placeholder by default', () => {
|
|
576
|
-
const numeric = mount(<NumericTextBox />).find(NumericTextBox);
|
|
577
|
-
const input = numeric.find('input');
|
|
578
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
579
|
-
expect(el.placeholder).toBe('');
|
|
580
|
-
});
|
|
581
|
-
|
|
582
|
-
it('apply placeholder correctly', () => {
|
|
583
|
-
const numeric = mount(<NumericTextBox placeholder="please enter a number" />).find(NumericTextBox);
|
|
584
|
-
const input = numeric.find('input');
|
|
585
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
586
|
-
expect(el.placeholder).toBe('please enter a number');
|
|
587
|
-
});
|
|
588
|
-
|
|
589
|
-
it('formats defaultValue correctly for default culture', () => {
|
|
590
|
-
const numeric = mount(<NumericTextBox defaultValue={123456.12345} />).find(NumericTextBox);
|
|
591
|
-
const input = numeric.find('input');
|
|
592
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
593
|
-
expect(el.value).toBe('123,456.123');
|
|
594
|
-
});
|
|
595
|
-
|
|
596
|
-
it('should fire onChange event once and with correct value', () => {
|
|
597
|
-
let c = 0;
|
|
598
|
-
let val: number = 0;
|
|
599
|
-
const onChange = (e: any) => { c++; val = e.value; };
|
|
600
|
-
const wraped = mount(<NumericTextBox onChange={onChange} />);
|
|
601
|
-
const numeric = wraped.find(NumericTextBox);
|
|
602
|
-
const input = numeric.find('input');
|
|
603
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
604
|
-
el.value = '27';
|
|
605
|
-
el.selectionStart = 2;
|
|
606
|
-
el.selectionEnd = 2;
|
|
607
|
-
input.simulate('change');
|
|
608
|
-
expect(c).toBe(1);
|
|
609
|
-
expect(val).toBe(27);
|
|
610
|
-
});
|
|
611
|
-
|
|
612
|
-
it('should fire onChange based on element value, not based on the event', () => {
|
|
613
|
-
let c = 0;
|
|
614
|
-
let val: number = 0;
|
|
615
|
-
const onChange = (e: any) => { c++; val = e.value; };
|
|
616
|
-
const numeric = mount(<NumericTextBox onChange={onChange} />).find(NumericTextBox);
|
|
617
|
-
const input = numeric.find('input');
|
|
618
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
619
|
-
el.value = '27';
|
|
620
|
-
el.selectionStart = 2;
|
|
621
|
-
el.selectionEnd = 2;
|
|
622
|
-
input.simulate('change', { target: { value: '11' } }); // this value should be ignored
|
|
623
|
-
expect(c).toBe(1);
|
|
624
|
-
expect(val).toBe(27); // not 11
|
|
625
|
-
});
|
|
626
|
-
|
|
627
|
-
it('should handle consecutive typing and backspacing when uncontrolled', () => {
|
|
628
|
-
let c = 0;
|
|
629
|
-
let value;
|
|
630
|
-
const onChange = (e: any) => { c++; value = e.value; };
|
|
631
|
-
const numeric = mount(<NumericTextBox defaultValue={55} onChange={onChange} />).find(NumericTextBox);
|
|
632
|
-
const input = numeric.find('input');
|
|
633
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
634
|
-
input.simulate('focus');
|
|
635
|
-
el.value = '1';
|
|
636
|
-
// el.selectionStart = el.selectionEnd = el.value.length; selection goes at the end by default
|
|
637
|
-
input.simulate('change');
|
|
638
|
-
expect(c).toBe(1);
|
|
639
|
-
expect(value).toBe(1);
|
|
640
|
-
el.value = el.value + '2'; input.simulate('change');
|
|
641
|
-
el.value = el.value + '3'; input.simulate('change');
|
|
642
|
-
el.value = el.value + '.'; input.simulate('change');
|
|
643
|
-
el.value = el.value + '4'; input.simulate('change');
|
|
644
|
-
el.value = el.value + '5'; input.simulate('change');
|
|
645
|
-
expect(value).toBe(123.45);
|
|
646
|
-
el.value = el.value.slice(0, el.value.length - 1); input.simulate('change');
|
|
647
|
-
expect(value).toBe(123.4);
|
|
648
|
-
el.value = el.value.slice(0, el.value.length - 1); input.simulate('change');
|
|
649
|
-
el.value = el.value.slice(0, el.value.length - 1); input.simulate('change');
|
|
650
|
-
expect(value).toBe(123);
|
|
651
|
-
el.value = el.value.slice(0, el.value.length - 1); input.simulate('change');
|
|
652
|
-
expect(value).toBe(12);
|
|
653
|
-
el.value = el.value.slice(0, el.value.length - 1); input.simulate('change');
|
|
654
|
-
expect(value).toBe(1);
|
|
655
|
-
el.value = el.value.slice(0, el.value.length - 1); input.simulate('change');
|
|
656
|
-
expect(value).toBe(null);
|
|
657
|
-
});
|
|
658
|
-
|
|
659
|
-
it('should handle consecutive typing with zeros', () => {
|
|
660
|
-
let c = 0;
|
|
661
|
-
let value;
|
|
662
|
-
const onChange = (e: any) => { c++; value = e.value; };
|
|
663
|
-
const numeric = mount(<NumericTextBox defaultValue={55} onChange={onChange} />).find(NumericTextBox);
|
|
664
|
-
const input = numeric.find('input');
|
|
665
|
-
|
|
666
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
667
|
-
input.simulate('focus');
|
|
668
|
-
el.value = '0';
|
|
669
|
-
input.simulate('change');
|
|
670
|
-
expect(c).toBe(1);
|
|
671
|
-
expect(value).toBe(0);
|
|
672
|
-
el.value = el.value + '0'; input.simulate('change');
|
|
673
|
-
el.value = el.value + '0'; input.simulate('change');
|
|
674
|
-
el.value = el.value + '.'; input.simulate('change');
|
|
675
|
-
el.value = el.value + '0'; input.simulate('change');
|
|
676
|
-
el.value = el.value + '1'; input.simulate('change');
|
|
677
|
-
expect(c).toBe(6);
|
|
678
|
-
expect(value).toBe(0.01);
|
|
679
|
-
});
|
|
680
|
-
|
|
681
|
-
it('should correct invalid value on blur', () => {
|
|
682
|
-
let c = 0;
|
|
683
|
-
let value;
|
|
684
|
-
const onChange = (e: any) => { c++; value = e.value; };
|
|
685
|
-
const numeric = mount(<NumericTextBox defaultValue={1} format={'p'} min={0} max={1} />).find(NumericTextBox);
|
|
686
|
-
const input = numeric.find('input');
|
|
687
|
-
|
|
688
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
689
|
-
input.simulate('focus');
|
|
690
|
-
|
|
691
|
-
el.value = '1000%';
|
|
692
|
-
input.simulate('change');
|
|
693
|
-
input.simulate('blur');
|
|
694
|
-
expect(el.value).toBe('100%');
|
|
695
|
-
});
|
|
696
|
-
|
|
697
|
-
it('should handle consecutive typing', () => {
|
|
698
|
-
let c = 0;
|
|
699
|
-
let value;
|
|
700
|
-
const onChange = (e: any) => { c++; value = e.value; };
|
|
701
|
-
const numeric = mount(<NumericTextBox defaultValue={55} onChange={onChange} />).find(NumericTextBox);
|
|
702
|
-
const input = numeric.find('input');
|
|
703
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
704
|
-
el.value = '0';
|
|
705
|
-
input.simulate('change');
|
|
706
|
-
expect(c).toBe(1);
|
|
707
|
-
expect(value).toBe(0);
|
|
708
|
-
for (let i = 0; i <= 9; i++) {
|
|
709
|
-
el.value = el.value + '' + i.toString(); input.simulate('change');
|
|
710
|
-
}
|
|
711
|
-
expect(c).toBe(11);
|
|
712
|
-
expect(value).toBe(123456789);
|
|
713
|
-
});
|
|
714
|
-
|
|
715
|
-
it('increases its value or up spin button click', () => {
|
|
716
|
-
let c = 0;
|
|
717
|
-
let val = 0;
|
|
718
|
-
const onChange = (e: any) => { c++; val = e.value; };
|
|
719
|
-
const numeric = mount(<NumericTextBox defaultValue={1234.55} onChange={onChange} />).find(NumericTextBox);
|
|
720
|
-
const input = numeric.find('input');
|
|
721
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
722
|
-
const spinUpButton = numeric.find('.k-spinner-increase').first();
|
|
723
|
-
spinUpButton.simulate('click');
|
|
724
|
-
expect(c).toBe(1);
|
|
725
|
-
expect(el.value).toBe('1,235.55');
|
|
726
|
-
expect(val).toBe(1235.55);
|
|
727
|
-
});
|
|
728
|
-
|
|
729
|
-
it('decrease its value or down spin button click', () => {
|
|
730
|
-
let c = 0;
|
|
731
|
-
let val = 0;
|
|
732
|
-
const onChange = (e: any) => { c++; val = e.value; };
|
|
733
|
-
const numeric = mount(<NumericTextBox defaultValue={1234.55} onChange={onChange} />).find(NumericTextBox);
|
|
734
|
-
const input = numeric.find('input');
|
|
735
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
736
|
-
const spinDownButton = numeric.find('.k-spinner-decrease').first();
|
|
737
|
-
spinDownButton.simulate('click');
|
|
738
|
-
expect(c).toBe(1);
|
|
739
|
-
expect(el.value).toBe('1,233.55');
|
|
740
|
-
expect(val).toBe(1233.55);
|
|
741
|
-
});
|
|
742
|
-
|
|
743
|
-
it('increases and decreases its value using arrow key up and down', () => {
|
|
744
|
-
let c = 0;
|
|
745
|
-
let val = 0;
|
|
746
|
-
const onChange = (e: any) => { c++; val = e.value; };
|
|
747
|
-
const numeric = mount(<NumericTextBox defaultValue={1234.55} onChange={onChange} />).find(NumericTextBox);
|
|
748
|
-
const input = numeric.find('input');
|
|
749
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
750
|
-
expect(el.value).toBe('1,234.55');
|
|
751
|
-
input.simulate('keyDown', { keyCode: 38 });
|
|
752
|
-
expect(el.value).toBe('1,235.55');
|
|
753
|
-
expect(val).toBe(1235.55);
|
|
754
|
-
input.simulate('keyDown', { keyCode: 40 });
|
|
755
|
-
expect(el.value).toBe('1,234.55');
|
|
756
|
-
expect(val).toBe(1234.55);
|
|
757
|
-
expect(c).toBe(2);
|
|
758
|
-
});
|
|
759
|
-
|
|
760
|
-
it('parse and format a pasted values', () => {
|
|
761
|
-
let c = 0;
|
|
762
|
-
let val: number | null = 0;
|
|
763
|
-
const onChange = (e: any) => { c++; val = e.value; };
|
|
764
|
-
const numeric = mount(<NumericTextBox defaultValue={null} onChange={onChange} />).find(NumericTextBox);
|
|
765
|
-
const input = numeric.find('input');
|
|
766
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
767
|
-
expect(el.value).toBe('');
|
|
768
|
-
|
|
769
|
-
el.value = '12345.54321'; // paste over empty input
|
|
770
|
-
el.selectionStart = el.selectionStart = 11;
|
|
771
|
-
input.simulate('change');
|
|
772
|
-
expect(el.value).toBe('12,345.543');
|
|
773
|
-
expect(val).toBe(12345.543);
|
|
774
|
-
|
|
775
|
-
el.value = '.21'; // paste over the whole selection
|
|
776
|
-
el.selectionStart = el.selectionStart = 3;
|
|
777
|
-
input.simulate('change');
|
|
778
|
-
expect(el.value).toBe('0.21');
|
|
779
|
-
expect(val).toBe(0.21);
|
|
780
|
-
|
|
781
|
-
el.value = ''; // cut
|
|
782
|
-
el.selectionStart = el.selectionStart = 0;
|
|
783
|
-
input.simulate('change');
|
|
784
|
-
expect(el.value).toBe('');
|
|
785
|
-
expect(val).toBeNull();
|
|
786
|
-
|
|
787
|
-
el.value = '012,345.543'; // paste in empty input
|
|
788
|
-
el.selectionStart = el.selectionStart = 11;
|
|
789
|
-
input.simulate('change');
|
|
790
|
-
expect(el.value).toBe('12,345.543');
|
|
791
|
-
expect(val).toBe(12345.543);
|
|
792
|
-
|
|
793
|
-
el.value = '99' + el.value; // paste in front
|
|
794
|
-
el.selectionStart = el.selectionStart = 2;
|
|
795
|
-
input.simulate('change');
|
|
796
|
-
expect(el.value).toBe('9,912,345.543');
|
|
797
|
-
expect(val).toBe(9912345.543);
|
|
798
|
-
|
|
799
|
-
el.value = '9,5.543'; // paste empty value over selection
|
|
800
|
-
el.selectionStart = el.selectionStart = 2;
|
|
801
|
-
input.simulate('change');
|
|
802
|
-
expect(el.value).toBe('95.543');
|
|
803
|
-
expect(val).toBe(95.543);
|
|
804
|
-
expect(c).toBe(6);
|
|
805
|
-
});
|
|
806
|
-
|
|
807
|
-
it('should set name property to HTML input DOM element when name is passed as props', () => {
|
|
808
|
-
const name = 'myCustomName';
|
|
809
|
-
let result = mount(<NumericTextBox name={name} />);
|
|
810
|
-
|
|
811
|
-
expect(result.find(`input[name="${name}"]`).length).toEqual(1);
|
|
812
|
-
});
|
|
813
|
-
|
|
814
|
-
it('value is correct during change, and after change if controlled', () => {
|
|
815
|
-
let valueDuringOnChange: number | null = null;
|
|
816
|
-
let targetValueDuringOnChange: number | null = null;
|
|
817
|
-
|
|
818
|
-
const onChange = (e: NumericTextBoxChangeEvent) => {
|
|
819
|
-
valueDuringOnChange = e.value;
|
|
820
|
-
targetValueDuringOnChange = e.target.value;
|
|
821
|
-
};
|
|
822
|
-
let numericInstance;
|
|
823
|
-
const wrapper = mount(
|
|
824
|
-
<NumericTextBox
|
|
825
|
-
ref={ref => numericInstance = ref}
|
|
826
|
-
value={1}
|
|
827
|
-
onChange={onChange}
|
|
828
|
-
/>
|
|
829
|
-
);
|
|
830
|
-
const input = wrapper.find(NumericTextBox).find('input');
|
|
831
|
-
|
|
832
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
833
|
-
el.value = '12';
|
|
834
|
-
el.selectionStart = el.selectionEnd = 2;
|
|
835
|
-
input.simulate('change');
|
|
836
|
-
|
|
837
|
-
expect(valueDuringOnChange || 0).toBe(12);
|
|
838
|
-
expect(targetValueDuringOnChange || 0).toBe(12);
|
|
839
|
-
expect(numericInstance.value).toBe(1); // since it is controlled
|
|
840
|
-
});
|
|
841
|
-
|
|
842
|
-
it('value is correct during change, and after change if not controlled', () => {
|
|
843
|
-
let valueDuringOnChange: number | null = null;
|
|
844
|
-
let targetValueDuringOnChange: number | null = null;
|
|
845
|
-
|
|
846
|
-
const onChange = (e: NumericTextBoxChangeEvent) => {
|
|
847
|
-
valueDuringOnChange = e.value;
|
|
848
|
-
targetValueDuringOnChange = e.target.value;
|
|
849
|
-
};
|
|
850
|
-
let numericInstance;
|
|
851
|
-
const wrapper = mount(
|
|
852
|
-
<NumericTextBox
|
|
853
|
-
ref={ref => numericInstance = ref}
|
|
854
|
-
onChange={onChange}
|
|
855
|
-
/>
|
|
856
|
-
);
|
|
857
|
-
const input = wrapper.find(NumericTextBox).find('input');
|
|
858
|
-
|
|
859
|
-
const el = (input.getDOMNode() as HTMLInputElement);
|
|
860
|
-
el.value = '12';
|
|
861
|
-
el.selectionStart = el.selectionEnd = 2;
|
|
862
|
-
input.simulate('change');
|
|
863
|
-
|
|
864
|
-
expect(valueDuringOnChange || 0).toBe(12);
|
|
865
|
-
expect(targetValueDuringOnChange || 0).toBe(12);
|
|
866
|
-
expect(numericInstance.value).toBe(12); // since it is not controlled
|
|
867
|
-
});
|
|
868
|
-
|
|
869
|
-
describe('Floating Label functionality', () => {
|
|
870
|
-
it('should not initiate FloatingLabel if label is not passed as props', () => {
|
|
871
|
-
const result = shallow(<NumericTextBox />);
|
|
872
|
-
|
|
873
|
-
expect(result.find('FloatingLabel').length).toEqual(0);
|
|
874
|
-
});
|
|
875
|
-
it('should initiate FloatingLabel if label is passed as props', () => {
|
|
876
|
-
const result = shallow(<NumericTextBox label="foo" />);
|
|
877
|
-
|
|
878
|
-
expect(result.find('FloatingLabel').length).toEqual(1);
|
|
879
|
-
});
|
|
880
|
-
it('should pass NumericTextBox label to FloatingLabel', () => {
|
|
881
|
-
const result = shallow(<NumericTextBox label="foo" />);
|
|
882
|
-
|
|
883
|
-
expect(result.find('FloatingLabel').props().label).toEqual('foo');
|
|
884
|
-
});
|
|
885
|
-
it('should pass NumericTextBox value to FloatingLabel', () => {
|
|
886
|
-
const result = shallow(<NumericTextBox label="foo" value={42} />);
|
|
887
|
-
|
|
888
|
-
expect(result.find('FloatingLabel').props().editorValue).toEqual('42');
|
|
889
|
-
});
|
|
890
|
-
it('should pass NumericTextBox defaultValue as value to FloatingLabel', () => {
|
|
891
|
-
const result = shallow(<NumericTextBox label="foo" defaultValue={42} />);
|
|
892
|
-
|
|
893
|
-
expect(result.find('FloatingLabel').props().editorValue).toEqual('42');
|
|
894
|
-
});
|
|
895
|
-
it('should pass NumericTextBox placeholder to FloatingLabel', () => {
|
|
896
|
-
const result = shallow(<NumericTextBox label="foo" placeholder="foo" />);
|
|
897
|
-
|
|
898
|
-
expect(result.find('FloatingLabel').props().editorPlaceholder).toEqual('foo');
|
|
899
|
-
});
|
|
900
|
-
it('should set width to NumericTextBox if label is not passed as props', () => {
|
|
901
|
-
const result = shallow(<NumericTextBox width="210px" />);
|
|
902
|
-
|
|
903
|
-
expect(result.find('.k-numerictextbox').props().style.width).toEqual('210px');
|
|
904
|
-
});
|
|
905
|
-
it('should pass width to Floating Label if label is passed as props', () => {
|
|
906
|
-
const result = shallow(<NumericTextBox label="foo" width="210px" />);
|
|
907
|
-
|
|
908
|
-
const input = result.find('.k-numerictextbox');
|
|
909
|
-
const label = result.find('FloatingLabel');
|
|
910
|
-
|
|
911
|
-
expect(input.props().style).toEqual(undefined);
|
|
912
|
-
expect(label.props().style.width).toEqual('210px');
|
|
913
|
-
});
|
|
914
|
-
});
|
|
915
|
-
describe('form validation', () => {
|
|
916
|
-
let result;
|
|
917
|
-
it('should set required and be invalid when empty', () => {
|
|
918
|
-
let componentInstance;
|
|
919
|
-
result = mount(<NumericTextBox ref={(ref) => componentInstance = ref} required={true} />);
|
|
920
|
-
|
|
921
|
-
expect(result.props().required).toEqual(true);
|
|
922
|
-
expect(componentInstance.validity.valid).toEqual(false);
|
|
923
|
-
});
|
|
924
|
-
|
|
925
|
-
it('should be valid when required is true but value is not empty', () => {
|
|
926
|
-
let componentInstance;
|
|
927
|
-
const val = 42;
|
|
928
|
-
result = mount(<NumericTextBox ref={(ref) => componentInstance = ref} required={true} value={val} />);
|
|
929
|
-
|
|
930
|
-
expect(componentInstance.validity.valid).toEqual(true);
|
|
931
|
-
});
|
|
932
|
-
|
|
933
|
-
it('should be invalid when required is true but value is empty', () => {
|
|
934
|
-
let componentInstance;
|
|
935
|
-
result = mount(<NumericTextBox ref={(ref) => componentInstance = ref} required={true} value={null} />);
|
|
936
|
-
|
|
937
|
-
expect(componentInstance.validity.valid).toEqual(false);
|
|
938
|
-
});
|
|
939
|
-
|
|
940
|
-
it('should expose name getter', () => {
|
|
941
|
-
let componentInstance;
|
|
942
|
-
result = mount(<NumericTextBox ref={(ref) => componentInstance = ref} name="foo" />);
|
|
943
|
-
|
|
944
|
-
expect(componentInstance.name).toEqual('foo');
|
|
945
|
-
});
|
|
946
|
-
|
|
947
|
-
it('should override validity if valid is passed as props', () => {
|
|
948
|
-
let componentInstance;
|
|
949
|
-
result = mount(<NumericTextBox ref={(ref) => componentInstance = ref} required={true} valid={true} />);
|
|
950
|
-
|
|
951
|
-
expect(componentInstance.validity.valid).toEqual(true);
|
|
952
|
-
});
|
|
953
|
-
|
|
954
|
-
it('should be valid when value is invalid but valid is set to true', () => {
|
|
955
|
-
let componentInstance;
|
|
956
|
-
result = mount(<NumericTextBox ref={(ref) => componentInstance = ref} required={true} valid={true} value={0} />);
|
|
957
|
-
expect(componentInstance.validity.valid).toEqual(true);
|
|
958
|
-
});
|
|
959
|
-
|
|
960
|
-
it('should **not** apply k-invalid if validityStyles is set to false and value is invalid', () => {
|
|
961
|
-
result = mount(<NumericTextBox validityStyles={false} required={true} />);
|
|
962
|
-
|
|
963
|
-
expect(result.find('.k-invalid').length).toEqual(0);
|
|
964
|
-
});
|
|
965
|
-
|
|
966
|
-
it('should **not** pass invalid if validityStyles is set to false label is present', () => {
|
|
967
|
-
result = mount(<NumericTextBox label="foo" validityStyles={false} required={true} />);
|
|
968
|
-
|
|
969
|
-
expect(result.find('.k-invalid').length).toEqual(0);
|
|
970
|
-
});
|
|
971
|
-
|
|
972
|
-
it('should **not** apply k-invalid if validityStyles is set to false and override validity', () => {
|
|
973
|
-
result = mount(<NumericTextBox validityStyles={false} valid={false} />);
|
|
974
|
-
|
|
975
|
-
expect(result.find('.k-invalid').length).toEqual(0);
|
|
976
|
-
});
|
|
977
|
-
|
|
978
|
-
it('should **not** pass invalid if validityStyles is set to false and override validity with label', () => {
|
|
979
|
-
result = mount(<NumericTextBox label={'foo'} validityStyles={false} valid={false} />);
|
|
980
|
-
|
|
981
|
-
expect(result.find('.k-invalid').length).toEqual(0);
|
|
982
|
-
});
|
|
983
|
-
});
|
|
984
|
-
});
|