@tellescope/react-components 1.185.2 → 1.187.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/react-components",
3
- "version": "1.185.2",
3
+ "version": "1.187.0",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -47,13 +47,13 @@
47
47
  "@reduxjs/toolkit": "^1.6.2",
48
48
  "@stripe/react-stripe-js": "^2.9.0",
49
49
  "@stripe/stripe-js": "^1.52.1",
50
- "@tellescope/constants": "^1.185.2",
51
- "@tellescope/sdk": "^1.185.2",
52
- "@tellescope/types-client": "^1.185.2",
53
- "@tellescope/types-models": "^1.185.2",
54
- "@tellescope/types-utilities": "^1.185.2",
55
- "@tellescope/utilities": "^1.185.2",
56
- "@tellescope/validation": "^1.185.2",
50
+ "@tellescope/constants": "^1.187.0",
51
+ "@tellescope/sdk": "^1.187.0",
52
+ "@tellescope/types-client": "^1.187.0",
53
+ "@tellescope/types-models": "^1.187.0",
54
+ "@tellescope/types-utilities": "^1.187.0",
55
+ "@tellescope/utilities": "^1.187.0",
56
+ "@tellescope/validation": "^1.187.0",
57
57
  "@typescript-eslint/eslint-plugin": "^4.33.0",
58
58
  "@typescript-eslint/parser": "^4.33.0",
59
59
  "css-to-react-native": "^3.0.0",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
85
85
  "react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
86
86
  },
87
- "gitHead": "f295e385c155897b5252d36d6c1cede51c8ae30f",
87
+ "gitHead": "fbb905922b74dd70b690751a272ede269ef9fcb1",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
@@ -485,26 +485,49 @@ export const EmailInput = ({ field, value, onChange, form, ...props }: FormInput
485
485
  />
486
486
  )
487
487
 
488
- export const NumberInput = ({ field, value, onChange, form, ...props }: FormInputProps<'number'>) => (
489
- <AutoFocusTextField {...props} required={!field.isOptional} fullWidth type="number" value={value}
490
- onChange={e => onChange(parseInt(e.target.value), field.id)}
491
- label={(!field.title && field.placeholder) ? field.placeholder : props.label}
492
- placeholder={field.placeholder || form_display_text_for_language(form, "Enter a number...", '')}
493
- sx={{
494
- '& input[type=number]': {
495
- '-moz-appearance': 'textfield'
496
- },
497
- '& input[type=number]::-webkit-outer-spin-button': {
498
- '-webkit-appearance': 'none',
499
- margin: 0
500
- },
501
- '& input[type=number]::-webkit-inner-spin-button': {
502
- '-webkit-appearance': 'none',
503
- margin: 0
504
- }
505
- }}
506
- />
507
- )
488
+ export const NumberInput = ({ field, value, onChange, form, ...props }: FormInputProps<'number'>) => {
489
+ // Prevent the default scroll behavior when focused on this input
490
+ const inputRef = useRef<HTMLInputElement>(null);
491
+ useEffect(() => {
492
+ const handleWheel = (e: any) => {
493
+ e?.preventDefault?.();
494
+ };
495
+
496
+ // Get the actual input element inside the TextField
497
+ const inputElement = inputRef.current?.querySelector('input');
498
+
499
+ if (inputElement) {
500
+ inputElement.addEventListener('wheel', handleWheel, { passive: false });
501
+
502
+ // Clean up event listener when component unmounts
503
+ return () => {
504
+ inputElement.removeEventListener('wheel', handleWheel);
505
+ };
506
+ }
507
+ }, []);
508
+
509
+ return (
510
+ <TextField ref={inputRef} autoFocus InputProps={defaultInputProps} {...props} required={!field.isOptional} fullWidth type="number" value={value}
511
+ onChange={e => onChange(parseInt(e.target.value), field.id)}
512
+ label={(!field.title && field.placeholder) ? field.placeholder : props.label}
513
+ placeholder={field.placeholder || form_display_text_for_language(form, "Enter a number...", '')}
514
+ onScroll={e => e.preventDefault()} // prevent scroll on number input
515
+ sx={{
516
+ '& input[type=number]': {
517
+ '-moz-appearance': 'textfield'
518
+ },
519
+ '& input[type=number]::-webkit-outer-spin-button': {
520
+ '-webkit-appearance': 'none',
521
+ margin: 0
522
+ },
523
+ '& input[type=number]::-webkit-inner-spin-button': {
524
+ '-webkit-appearance': 'none',
525
+ margin: 0
526
+ }
527
+ }}
528
+ />
529
+ )
530
+ }
508
531
 
509
532
  export const InsuranceInput = ({ field, value, onChange, form, responses, enduser, ...props }: FormInputProps<'Insurance'>) => {
510
533
  const session = useResolvedSession()