tp-react-elements 1.1.20 → 1.2.3

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.
Files changed (23) hide show
  1. package/dist/_virtual/index.esm10.js +2 -2
  2. package/dist/_virtual/index.esm11.js +2 -2
  3. package/dist/_virtual/index.esm13.js +2 -2
  4. package/dist/_virtual/index.esm4.js +2 -2
  5. package/dist/_virtual/index.esm5.js +2 -2
  6. package/dist/_virtual/index.esm6.js +2 -2
  7. package/dist/_virtual/index.esm7.js +2 -2
  8. package/dist/_virtual/index.esm9.js +2 -2
  9. package/dist/components/DateRangePicker/DateRangePicker.esm.js +1 -1
  10. package/dist/components/FormComponents/FormTextAreaField/FormTextAreaField.esm.js +32 -31
  11. package/dist/components/FormComponents/FormTextField/FormTextField.esm.js +19 -18
  12. package/dist/components/FormComponents/Select/MultiSelectv1.esm.js +1 -1
  13. package/dist/components/FormComponents/Select/SingleSelect.esm.js +44 -44
  14. package/dist/node_modules/prop-types/index.esm.js +1 -1
  15. package/dist/node_modules/react-date-range/dist/accessibility/index.esm.js +1 -1
  16. package/dist/node_modules/react-date-range/dist/components/Calendar/index.esm.js +1 -1
  17. package/dist/node_modules/react-date-range/dist/components/DateInput/index.esm.js +1 -1
  18. package/dist/node_modules/react-date-range/dist/components/DateRange/index.esm.js +1 -1
  19. package/dist/node_modules/react-date-range/dist/components/DateRangePicker/index.esm.js +1 -1
  20. package/dist/node_modules/react-date-range/dist/components/DayCell/index.esm.js +1 -1
  21. package/dist/node_modules/react-date-range/dist/components/DefinedRange/index.esm.js +1 -1
  22. package/dist/utils/Interface/FormInterface.d.ts +1 -0
  23. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- var accessibility = {};
1
+ var propTypes = {exports: {}};
2
2
 
3
- export { accessibility as __exports };
3
+ export { propTypes as __module };
@@ -1,3 +1,3 @@
1
- var DayCell = {};
1
+ var DateInput = {};
2
2
 
3
- export { DayCell as __exports };
3
+ export { DateInput as __exports };
@@ -1,3 +1,3 @@
1
- var DateInput = {};
1
+ var DayCell = {};
2
2
 
3
- export { DateInput as __exports };
3
+ export { DayCell as __exports };
@@ -1,3 +1,3 @@
1
- var DateRangePicker = {};
1
+ var Calendar = {};
2
2
 
3
- export { DateRangePicker as __exports };
3
+ export { Calendar as __exports };
@@ -1,3 +1,3 @@
1
- var DateRange = {};
1
+ var DateRangePicker = {};
2
2
 
3
- export { DateRange as __exports };
3
+ export { DateRangePicker as __exports };
@@ -1,3 +1,3 @@
1
- var Calendar = {};
1
+ var DefinedRange = {};
2
2
 
3
- export { Calendar as __exports };
3
+ export { DefinedRange as __exports };
@@ -1,3 +1,3 @@
1
- var DefinedRange = {};
1
+ var DateRange = {};
2
2
 
3
- export { DefinedRange as __exports };
3
+ export { DateRange as __exports };
@@ -1,3 +1,3 @@
1
- var propTypes = {exports: {}};
1
+ var accessibility = {};
2
2
 
3
- export { propTypes as __module };
3
+ export { accessibility as __exports };
@@ -94,7 +94,7 @@ const DateRangePickerComponent = ({ item, control, watch, setValue, getValues, c
94
94
  item.onChangeFn && item.onChangeFn(dateObject || null);
95
95
  handleClose();
96
96
  }
97
- }, moveRangeOnFirstSelection: false, ranges: state, months: 2, direction: "horizontal", showDateDisplay: false, dateDisplayFormat: "dd/MM/yyyy", rangeColors: ['#4d73b1ff'], minDate: getValidDate(item?.minDate), maxDate: getValidDate(item?.maxDate) }) }), jsx(FormBottomField, { item,
97
+ }, moveRangeOnFirstSelection: false, ranges: state, months: 2, direction: "horizontal", showDateDisplay: false, dateDisplayFormat: "dd/MM/yyyy", rangeColors: ['#4d73b1ff'] }) }), jsx(FormBottomField, { item,
98
98
  control,
99
99
  errors,
100
100
  getValues,
@@ -1,5 +1,6 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { Controller } from 'react-hook-form';
3
+ import { Tooltip, Box } from '@mui/material';
3
4
  import FormBottomField from '../FormBottomField/FormBottomField.esm.js';
4
5
  import { TextAreaField } from './FormTextAreaField.styles.esm.js';
5
6
  import 'dayjs';
@@ -29,37 +30,37 @@ const FormTextAreaField = ({ props, variant, }) => {
29
30
  /**
30
31
  * Renders the textarea component with validation support
31
32
  */
32
- return (jsx(Fragment, { children: jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => (jsxs(Fragment, { children: [renderLabel(variant, props), jsx(TextAreaField, { multiline: true, size: "small", InputProps: {
33
- style: {
34
- border: 'none',
35
- },
36
- }, sx: {
37
- ...props.item.sx,
38
- }, minRows: props.item.minRows || 1, maxRows: props.item.maxRows || 100, placeholder: props.item.placeholder || 'Type Something...', ...field, label: variant !== 'standard'
39
- ? `${props.item.label}${props.item.required ? ' *' : ''}`
40
- : '', error: isShowBorderError, value: field.value || '', disabled: props.item.disable, inputProps: {
41
- /**
42
- * Handles input events with text restrictions
43
- *
44
- * @param {any} e - The input event object
45
- *
46
- * @remarks
47
- * - Removes special characters if allowSpecialChars is false
48
- * - Prevents input that starts with a space
49
- */
50
- onInput: (e) => {
51
- if (!props?.item?.allowSpecialChars) {
52
- const value = e.target.value;
53
- e.target.value = value.replace(/[^a-zA-Z0-9 ]/g, '');
54
- } // Allow only alphanumeric and space
55
- if (e.target.value.length === 1 && e.target.value === ' ') {
56
- e.target.value = '';
57
- }
58
- },
59
- 'aria-labelledby': `${props.item.name}-label`,
60
- 'aria-describedby': `${props.item.name}-helper ${props.item.name}-error`,
61
- 'aria-required': props.item.required ? true : undefined,
62
- } }), jsx(FormBottomField, { ...props })] })) }, props.item.name) }));
33
+ return (jsx(Fragment, { children: jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => (jsxs(Fragment, { children: [renderLabel(variant, props), jsx(Tooltip, { title: props.item.isTooltipEnable ? (field.value || '') : '', placement: "bottom-start", children: jsxs(Box, { sx: { width: '100%', position: 'relative' }, children: [jsx(TextAreaField, { multiline: true, size: "small", InputProps: {
34
+ style: {
35
+ border: 'none',
36
+ },
37
+ }, sx: {
38
+ ...props.item.sx,
39
+ }, minRows: props.item.minRows || 1, maxRows: props.item.maxRows || 100, placeholder: props.item.placeholder || 'Type Something...', ...field, label: variant !== 'standard'
40
+ ? `${props.item.label}${props.item.required ? ' *' : ''}`
41
+ : '', error: isShowBorderError, value: field.value || '', disabled: props.item.disable, inputProps: {
42
+ /**
43
+ * Handles input events with text restrictions
44
+ *
45
+ * @param {any} e - The input event object
46
+ *
47
+ * @remarks
48
+ * - Removes special characters if allowSpecialChars is false
49
+ * - Prevents input that starts with a space
50
+ */
51
+ onInput: (e) => {
52
+ if (!props?.item?.allowSpecialChars) {
53
+ const value = e.target.value;
54
+ e.target.value = value.replace(/[^a-zA-Z0-9 ]/g, '');
55
+ } // Allow only alphanumeric and space
56
+ if (e.target.value.length === 1 && e.target.value === ' ') {
57
+ e.target.value = '';
58
+ }
59
+ },
60
+ 'aria-labelledby': `${props.item.name}-label`,
61
+ 'aria-describedby': `${props.item.name}-helper ${props.item.name}-error`,
62
+ 'aria-required': props.item.required ? true : undefined,
63
+ } }), props.item.disable && props.item.isTooltipEnable && (jsx(Box, { sx: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', zIndex: 1 } }))] }) }), jsx(FormBottomField, { ...props })] })) }, props.item.name) }));
63
64
  };
64
65
 
65
66
  export { FormTextAreaField as default };
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { Controller } from 'react-hook-form';
3
+ import { Tooltip, Box } from '@mui/material';
3
4
  import { FormTextFieldComponent } from './FormTextField.styles.esm.js';
4
5
  import FormBottomField from '../FormBottomField/FormBottomField.esm.js';
5
6
  import 'dayjs';
@@ -88,24 +89,24 @@ const FormTextField = ({ props, variant }) => {
88
89
  * Renders the text field component using react-hook-form's Controller
89
90
  * for controlled form state management
90
91
  */
91
- return (jsx(Controller, { control: props.control, name: props.item.name, render: ({ field, fieldState }) => (jsxs(Fragment, { children: [renderLabel(variant, props), jsx(FormTextFieldComponent, { ...field, fullWidth: true, autoFocus: props.item.autoFocus, error: !!fieldState.error, label: label, placeholder: props.item.placeholder || '', autoComplete: "off", sx: {
92
- ...props.item.sx,
93
- }, value: field.value || '', size: "small", disabled: props.item.disable, onBlur: (e) => {
94
- // Call custom onBlur handler if provided
95
- props?.item?.onBlurFn && props?.item?.onBlurFn(e);
96
- }, inputProps: {
97
- ...{
98
- maxLength: props.item.maxLength || 100,
99
- onInput: onInput,
100
- onPaste: (e) => {
101
- if (props.item.doNotAllowPaste)
102
- e.preventDefault();
103
- },
104
- },
105
- 'aria-labelledby': `${props.item.name}-label`,
106
- 'aria-describedby': `${props.item.name}-helper ${props.item.name}-error`,
107
- 'aria-required': props.item.required ? true : undefined,
108
- } }), jsx(FormBottomField, { ...props })] })) }, props.item.name));
92
+ return (jsx(Controller, { control: props.control, name: props.item.name, render: ({ field, fieldState }) => (jsxs(Fragment, { children: [renderLabel(variant, props), jsx(Tooltip, { title: props.item.isTooltipEnable ? (field.value || '') : '', placement: "bottom-start", children: jsxs(Box, { sx: { width: '100%', position: 'relative' }, children: [jsx(FormTextFieldComponent, { ...field, fullWidth: true, autoFocus: props.item.autoFocus, error: !!fieldState.error, label: label, placeholder: props.item.placeholder || '', autoComplete: "off", sx: {
93
+ ...props.item.sx,
94
+ }, value: field.value || '', size: "small", disabled: props.item.disable, onBlur: (e) => {
95
+ // Call custom onBlur handler if provided
96
+ props?.item?.onBlurFn && props?.item?.onBlurFn(e);
97
+ }, inputProps: {
98
+ ...{
99
+ maxLength: props.item.maxLength || 100,
100
+ onInput: onInput,
101
+ onPaste: (e) => {
102
+ if (props.item.doNotAllowPaste)
103
+ e.preventDefault();
104
+ },
105
+ },
106
+ 'aria-labelledby': `${props.item.name}-label`,
107
+ 'aria-describedby': `${props.item.name}-helper ${props.item.name}-error`,
108
+ 'aria-required': props.item.required ? true : undefined,
109
+ } }), props.item.disable && props.item.isTooltipEnable && (jsx(Box, { sx: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', zIndex: 1 } }))] }) }), jsx(FormBottomField, { ...props })] })) }, props.item.name));
109
110
  };
110
111
 
111
112
  export { FormTextField as default };
@@ -118,7 +118,7 @@ function MultiSelectV1({ props, variant, }) {
118
118
  lineHeight: '1.2'
119
119
  }
120
120
  } })] }, option.value));
121
- })) : (jsx(MenuItem, { className: 'multiselect-datanotfound', sx: { marginLeft: '30px', fontSize: '12px' }, disabled: true, children: "No data Found" }))] }), jsx(FormBottomField, { ...props })] }) }, props.item.name));
121
+ })) : (jsx(MenuItem, { disabled: true, children: "No data Found" }))] }), jsx(FormBottomField, { ...props })] }) }, props.item.name));
122
122
  }
123
123
 
124
124
  export { MultiSelectV1 as default };
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { createElement } from 'react';
3
- import { Autocomplete, TextField } from '@mui/material';
3
+ import { Tooltip, Box, Autocomplete, TextField } from '@mui/material';
4
4
  import { useWatch, Controller } from 'react-hook-form';
5
5
  import FormBottomField from '../FormBottomField/FormBottomField.esm.js';
6
6
  import 'dayjs';
@@ -14,49 +14,49 @@ const SingleSelect = ({ props, variant }) => {
14
14
  const value = currentValue
15
15
  ? props.item.options?.find((item) => item.value === currentValue)
16
16
  : null;
17
- return (jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => (jsxs(Fragment, { children: [renderLabel(variant, props), jsx(Autocomplete, { ...field, id: `${props.item.name}-autocomplete`, value: value, onChange: (_, newValue) => {
18
- props.setValue(props?.item?.name, newValue?.value);
19
- props?.item?.onChangeFn && props?.item?.onChangeFn(newValue?.value, newValue);
20
- props?.clearErrors && props?.clearErrors(props?.item?.name);
21
- }, onBlur: (e) => {
22
- props?.item?.onBlurFn && props?.item?.onBlurFn(e);
23
- }, size: "small", sx: {
24
- '& .MuiAutocomplete-input': {
25
- padding: '0px 0px 0px 5px !important',
26
- },
27
- '& .css-erkti9-MuiFormLabel-root-MuiInputLabel-root,.css-8edmr2-MuiFormLabel-root-MuiInputLabel-root': {
28
- top: '-3px',
29
- },
30
- // Note: Options are rendered in a portal; keep this as a fallback only
31
- '& .MuiAutocomplete-option': {
32
- fontSize: '11px',
33
- zIndex: 2000,
34
- },
35
- ...props.item.sx,
36
- }, ListboxProps: {
37
- onScroll: (event) => {
38
- const listboxNode = event.currentTarget;
39
- if (listboxNode.scrollTop + listboxNode.clientHeight === listboxNode.scrollHeight) ;
40
- },
41
- }, disabled: props.item.disable, options: props.item.options || [], slotProps: {
42
- popper: {
43
- sx: {
44
- zIndex: 1401,
45
- },
46
- },
47
- listbox: {
48
- sx: {
49
- fontSize: '11px',
50
- },
51
- },
52
- }, renderOption: (props, option) => (createElement("li", { ...props, value: option.value, key: option.value }, option.label)), renderInput: (params) => (jsx(TextField, { ...params, placeholder: props.item.placeholder, error: isShowBorderError, label: variant !== 'standard'
53
- ? `${props.item.label}${props.item.required ? ' *' : ''}`
54
- : '', inputProps: {
55
- ...params.inputProps,
56
- 'aria-labelledby': `${props.item.name}-label`,
57
- 'aria-describedby': `${props.item.name}-helper ${props.item.name}-error`,
58
- 'aria-required': props.item.required ? true : undefined,
59
- } })) }), jsx(FormBottomField, { ...props })] })) }, props.item.name));
17
+ return (jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => (jsxs(Fragment, { children: [renderLabel(variant, props), jsx(Tooltip, { title: props.item.isTooltipEnable ? (value?.label || '') : '', placement: "bottom-start", children: jsxs(Box, { sx: { width: '100%', position: 'relative' }, children: [jsx(Autocomplete, { ...field, id: `${props.item.name}-autocomplete`, value: value, onChange: (_, newValue) => {
18
+ props.setValue(props?.item?.name, newValue?.value);
19
+ props?.item?.onChangeFn && props?.item?.onChangeFn(newValue?.value, newValue);
20
+ props?.clearErrors && props?.clearErrors(props?.item?.name);
21
+ }, onBlur: (e) => {
22
+ props?.item?.onBlurFn && props?.item?.onBlurFn(e);
23
+ }, size: "small", sx: {
24
+ '& .MuiAutocomplete-input': {
25
+ padding: '0px 0px 0px 5px !important',
26
+ },
27
+ '& .css-erkti9-MuiFormLabel-root-MuiInputLabel-root,.css-8edmr2-MuiFormLabel-root-MuiInputLabel-root': {
28
+ top: '-3px',
29
+ },
30
+ // Note: Options are rendered in a portal; keep this as a fallback only
31
+ '& .MuiAutocomplete-option': {
32
+ fontSize: '11px',
33
+ zIndex: 2000,
34
+ },
35
+ ...props.item.sx,
36
+ }, ListboxProps: {
37
+ onScroll: (event) => {
38
+ const listboxNode = event.currentTarget;
39
+ if (listboxNode.scrollTop + listboxNode.clientHeight === listboxNode.scrollHeight) ;
40
+ },
41
+ }, disabled: props.item.disable, options: props.item.options || [], slotProps: {
42
+ popper: {
43
+ sx: {
44
+ zIndex: 1401,
45
+ },
46
+ },
47
+ listbox: {
48
+ sx: {
49
+ fontSize: '11px',
50
+ },
51
+ },
52
+ }, renderOption: (props, option) => (createElement("li", { ...props, value: option.value, key: option.value }, option.label)), renderInput: (params) => (jsx(TextField, { ...params, placeholder: props.item.placeholder, error: isShowBorderError, label: variant !== 'standard'
53
+ ? `${props.item.label}${props.item.required ? ' *' : ''}`
54
+ : '', inputProps: {
55
+ ...params.inputProps,
56
+ 'aria-labelledby': `${props.item.name}-label`,
57
+ 'aria-describedby': `${props.item.name}-helper ${props.item.name}-error`,
58
+ 'aria-required': props.item.required ? true : undefined,
59
+ } })) }), props.item.disable && props.item.isTooltipEnable && (jsx(Box, { sx: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', zIndex: 1 } }))] }) }), jsx(FormBottomField, { ...props })] })) }, props.item.name));
60
60
  };
61
61
 
62
62
  export { SingleSelect as default };
@@ -1,4 +1,4 @@
1
- import { __module as propTypes } from '../../_virtual/index.esm9.js';
1
+ import { __module as propTypes } from '../../_virtual/index.esm10.js';
2
2
  import { __require as requireReactIs } from './node_modules/react-is/index.esm.js';
3
3
  import { __require as requireFactoryWithTypeCheckers } from './factoryWithTypeCheckers.esm.js';
4
4
  import { __require as requireFactoryWithThrowingShims } from './factoryWithThrowingShims.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as accessibility } from '../../../../_virtual/index.esm10.js';
1
+ import { __exports as accessibility } from '../../../../_virtual/index.esm9.js';
2
2
  import { __require as requirePropTypes } from '../../../prop-types/index.esm.js';
3
3
 
4
4
  var hasRequiredAccessibility;
@@ -1,4 +1,4 @@
1
- import { __exports as Calendar } from '../../../../../_virtual/index.esm6.js';
1
+ import { __exports as Calendar } from '../../../../../_virtual/index.esm4.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireDayCell } from '../DayCell/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DateInput } from '../../../../../_virtual/index.esm13.js';
1
+ import { __exports as DateInput } from '../../../../../_virtual/index.esm11.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireClassnames } from '../../../../classnames/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DateRange } from '../../../../../_virtual/index.esm5.js';
1
+ import { __exports as DateRange } from '../../../../../_virtual/index.esm7.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireCalendar } from '../Calendar/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DateRangePicker } from '../../../../../_virtual/index.esm4.js';
1
+ import { __exports as DateRangePicker } from '../../../../../_virtual/index.esm5.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireDateRange } from '../DateRange/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DayCell } from '../../../../../_virtual/index.esm11.js';
1
+ import { __exports as DayCell } from '../../../../../_virtual/index.esm13.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireClassnames } from '../../../../classnames/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DefinedRange } from '../../../../../_virtual/index.esm7.js';
1
+ import { __exports as DefinedRange } from '../../../../../_virtual/index.esm6.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireStyles } from '../../styles.esm.js';
@@ -81,6 +81,7 @@ export interface FormSectionPropsItem {
81
81
  labelField?: string;
82
82
  headerColor?: string;
83
83
  optionFontSize?: string;
84
+ isTooltipEnable?: boolean;
84
85
  }
85
86
  export type VariantProps = 'standard' | 'outlined' | '';
86
87
  export interface FormRenderProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tp-react-elements",
3
- "version": "1.1.20",
3
+ "version": "1.2.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "React form components library built with React Hook Form and Yup",