tp-react-elements 1.2.3 → 1.2.5
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/dist/_virtual/index.esm11.js +2 -2
- package/dist/_virtual/index.esm12.js +2 -2
- package/dist/_virtual/index.esm13.js +2 -2
- package/dist/_virtual/index.esm14.js +2 -2
- package/dist/_virtual/index.esm4.js +2 -2
- package/dist/_virtual/index.esm5.js +2 -2
- package/dist/_virtual/index.esm7.js +2 -2
- package/dist/components/FormComponents/FormNumberField/FormNumberFieldDecimal.esm.js +3 -0
- package/dist/components/FormComponents/Select/MultiSelectAutocomplete.esm.js +1 -1
- package/dist/components/FormComponents/Select/MultiSelectTable.esm.js +15 -8
- package/dist/components/FormComponents/Select/MultiSelectv1.esm.js +7 -3
- package/dist/components/FormComponents/Select/SingleSelect.esm.js +4 -1
- package/dist/components/FormComponents/Select/SingleSelectNonAutoComplete.esm.js +1 -1
- package/dist/components/SelectField/MultiSelectFieldComponent.d.ts +2 -1
- package/dist/components/SelectField/MultiSelectFieldComponent.esm.js +7 -3
- package/dist/node_modules/react-date-range/dist/components/Calendar/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateInput/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRangePicker/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DayCell/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/InputRangeField/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/Month/index.esm.js +1 -1
- package/dist/utils/Interface/FormInterface.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DayCell = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DayCell as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var InputRangeField = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { InputRangeField as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Month = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Month as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateInput = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateInput as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateRangePicker = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateRangePicker as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateRange = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateRange as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Calendar = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Calendar as __exports };
|
|
@@ -37,6 +37,9 @@ const FormNumberFieldDecimal = ({ props, variant, }) => {
|
|
|
37
37
|
props?.item?.onBlurFn && props?.item?.onBlurFn(e);
|
|
38
38
|
}, InputProps: {
|
|
39
39
|
inputProps: {
|
|
40
|
+
onInput: (e) => {
|
|
41
|
+
props.item.onInputProps && props.item.onInputProps(e);
|
|
42
|
+
},
|
|
40
43
|
// allow digits, one dot and optional leading minus
|
|
41
44
|
inputMode: 'decimal',
|
|
42
45
|
maxLength: 20,
|
|
@@ -185,7 +185,7 @@ const MultiSelectAutocomplete = ({ props, variant, }) => {
|
|
|
185
185
|
const handleBlur = useCallback((e) => {
|
|
186
186
|
props?.item?.onBlurFn && props?.item?.onBlurFn(e);
|
|
187
187
|
}, [props]);
|
|
188
|
-
return (jsx(Controller, { control: props.control, name: props.item.name, render: ({ field: { ref, onBlur: fieldOnBlur } }) => (jsxs(Fragment, { children: [renderLabel(variant, props), jsx(Autocomplete, { ref: ref, open: open, onOpen: () => setOpen(true), onClose: () => setOpen(false), multiple: true, disableCloseOnSelect: true, id: `${props.item.name}-autocomplete-multi`, options: options, value: selectedOptions, getOptionLabel: getOptionLabelCb, isOptionEqualToValue: isOptionEqualCb, onChange: handleChange, onBlur: (e) => {
|
|
188
|
+
return (jsx(Controller, { control: props.control, name: props.item.name, render: ({ field: { ref, onBlur: fieldOnBlur } }) => (jsxs(Fragment, { children: [renderLabel(variant, props), jsx(Autocomplete, { ref: ref, open: open, onOpen: () => setOpen(true), onClose: () => setOpen(false), multiple: true, disableCloseOnSelect: true, id: `${props.item.name}-autocomplete-multi`, options: options, value: selectedOptions, getOptionLabel: getOptionLabelCb, isOptionEqualToValue: isOptionEqualCb, getOptionDisabled: (option) => option.disable, onChange: handleChange, onBlur: (e) => {
|
|
189
189
|
fieldOnBlur();
|
|
190
190
|
handleBlur(e);
|
|
191
191
|
}, size: "small", disablePortal: false, autoHighlight: true, selectOnFocus: true, clearOnBlur: false, renderTags: (tagValue, getTagProps) => (jsx(Box, { ref: tagsContainerRef, sx: {
|
|
@@ -304,15 +304,22 @@ const MultiSelectTable = ({ props, variant, }) => {
|
|
|
304
304
|
overflow: 'visible',
|
|
305
305
|
},
|
|
306
306
|
},
|
|
307
|
-
muiTableBodyRowProps: {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
307
|
+
muiTableBodyRowProps: ({ row }) => {
|
|
308
|
+
const rowId = String(row.original[valueField]);
|
|
309
|
+
const isSelected = selectedValues.includes(rowId);
|
|
310
|
+
return {
|
|
311
|
+
onClick: () => handleRowSelect(rowId), // 👈 row click selection
|
|
312
|
+
sx: {
|
|
313
|
+
borderBottom: '1px solid #e0e0e0',
|
|
314
|
+
height: 'auto',
|
|
315
|
+
minHeight: '32px',
|
|
316
|
+
cursor: 'pointer',
|
|
317
|
+
backgroundColor: isSelected ? '#b2dfdb' : 'inherit', // optional highlight
|
|
318
|
+
'&:hover': {
|
|
319
|
+
backgroundColor: '#e0f2f1',
|
|
320
|
+
},
|
|
314
321
|
},
|
|
315
|
-
}
|
|
322
|
+
};
|
|
316
323
|
},
|
|
317
324
|
initialState: {
|
|
318
325
|
density: 'compact',
|
|
@@ -57,11 +57,15 @@ function MultiSelectV1({ props, variant, }) {
|
|
|
57
57
|
const selectedValuesString = selectedOptions.map((item) => item.label).join(' , ');
|
|
58
58
|
const isShowBorderError = !!props.errors?.[props.item.name];
|
|
59
59
|
return (jsx(Box, { children: jsxs(FormControl, { fullWidth: true, ref: containerRef, sx: { '& .MuiFormLabel-root': { top: -10 }, '& .MuiInputLabel-shrink': { top: 0 } }, children: [renderLabel(variant, props), variant !== 'standard' && (jsxs(InputLabel, { error: isShowBorderError, id: `${props.item.name}-ms-labelId`, children: [props.item.label, props.item.required ? ' *' : ''] })), jsxs(Select, { labelId: `${props.item.name}-ms-labelId`, id: `${props.item.name}-ms-select`, multiple: true, displayEmpty: true, error: isShowBorderError, disabled: props.item.disable, value: fieldValue ? extractValuesToArray(fieldValue) : [], onChange: handleChange, onOpen: () => {
|
|
60
|
-
|
|
60
|
+
if (!props.item.doNotEnableMultiselectOrder) {
|
|
61
|
+
setSavedSortValue(fieldValue);
|
|
62
|
+
}
|
|
61
63
|
setTimeout(() => textfieldRef.current?.focus(), 0);
|
|
62
64
|
}, onClose: () => {
|
|
63
65
|
setSearchText('');
|
|
64
|
-
|
|
66
|
+
if (!props.item.doNotEnableMultiselectOrder) {
|
|
67
|
+
setSavedSortValue(fieldValue);
|
|
68
|
+
}
|
|
65
69
|
props?.item?.onCloseMenu && props?.item?.onCloseMenu();
|
|
66
70
|
}, input: jsx(OutlinedInput, { label: variant !== 'standard' ? props.item.label : '' }), renderValue: () => (jsx(Tooltip, { title: selectedValuesString, children: jsx("span", { style: { display: 'block', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, children: props.item.placeholder && selectedOptions.length === 0 ? (jsx("span", { style: { color: '#0009' }, children: props.item.placeholder })) : (selectedOptions.length > (props.item.multiSelectLabelLength || 3)
|
|
67
71
|
? `${selectedOptions.length} Selected`
|
|
@@ -103,7 +107,7 @@ function MultiSelectV1({ props, variant, }) {
|
|
|
103
107
|
} }) }), filterOptions.length !== 0 ? (filterOptions.map((option) => {
|
|
104
108
|
const selectedArray = fieldValue ? extractValuesToArray(fieldValue) : [];
|
|
105
109
|
const isChecked = selectedArray.includes(String(option.value));
|
|
106
|
-
return (jsxs(MenuItem, { value: `${option.value}`, sx: {
|
|
110
|
+
return (jsxs(MenuItem, { value: `${option.value}`, disabled: option.disable, sx: {
|
|
107
111
|
whiteSpace: 'normal',
|
|
108
112
|
wordBreak: 'break-all',
|
|
109
113
|
alignItems: 'center',
|
|
@@ -49,7 +49,10 @@ const SingleSelect = ({ props, variant }) => {
|
|
|
49
49
|
fontSize: '11px',
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
|
-
}, renderOption: (props, option) => (createElement("li", { ...props, value: option.value,
|
|
52
|
+
}, renderOption: (props, option) => (createElement("li", { ...props, value: option.value, style: {
|
|
53
|
+
opacity: option.disable ? 0.5 : 1,
|
|
54
|
+
pointerEvents: option.disable ? 'none' : 'auto',
|
|
55
|
+
}, key: option.value }, option.label)), renderInput: (params) => (jsx(TextField, { ...params, placeholder: props.item.placeholder, error: isShowBorderError, label: variant !== 'standard'
|
|
53
56
|
? `${props.item.label}${props.item.required ? ' *' : ''}`
|
|
54
57
|
: '', inputProps: {
|
|
55
58
|
...params.inputProps,
|
|
@@ -23,7 +23,7 @@ const SingleSelectNonAutoComplete = ({ props, variant, }) => {
|
|
|
23
23
|
'aria-labelledby': `${props.item.name}-label`,
|
|
24
24
|
'aria-describedby': `${props.item.name}-helper ${props.item.name}-error`,
|
|
25
25
|
'aria-required': props.item.required ? true : undefined,
|
|
26
|
-
}, children: (props.item.options || []).map((item) => (jsx(MenuItem, { sx: {
|
|
26
|
+
}, children: (props.item.options || []).map((item) => (jsx(MenuItem, { disabled: item.disable, sx: {
|
|
27
27
|
fontSize: '11px', // Adjust the font size as needed
|
|
28
28
|
zIndex: 2000,
|
|
29
29
|
}, value: item.value, children: item.label }, item.value))) }), jsx(FormBottomField, { ...props })] }, props.item.name));
|
|
@@ -7,6 +7,7 @@ interface MultiSelectProps {
|
|
|
7
7
|
onChangeFn: (e: any) => void;
|
|
8
8
|
disable?: boolean;
|
|
9
9
|
optionFontSize?: string;
|
|
10
|
+
donotEnableMultiselectOrder?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export default function MultiSelectFieldComponent({ value, options, onChangeFn, disable, optionFontSize, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default function MultiSelectFieldComponent({ value, options, onChangeFn, disable, optionFontSize, donotEnableMultiselectOrder }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -15,7 +15,7 @@ const extractValuesToArray = (inputString) => {
|
|
|
15
15
|
const trimmedArray = valuesArray?.map((value) => value.trim());
|
|
16
16
|
return trimmedArray;
|
|
17
17
|
};
|
|
18
|
-
function MultiSelectFieldComponent({ value, options, onChangeFn, disable = false, optionFontSize = '13px', }) {
|
|
18
|
+
function MultiSelectFieldComponent({ value, options, onChangeFn, disable = false, optionFontSize = '13px', donotEnableMultiselectOrder = false }) {
|
|
19
19
|
const [personName, setPersonName] = React.useState(value ? extractValuesToArray(value) : []);
|
|
20
20
|
const [searchText, setSearchText] = useState('');
|
|
21
21
|
const [selectAll, setSelectAll] = useState(false);
|
|
@@ -68,7 +68,9 @@ function MultiSelectFieldComponent({ value, options, onChangeFn, disable = false
|
|
|
68
68
|
fontSize: '5px !important',
|
|
69
69
|
},
|
|
70
70
|
}, disabled: disable, value: value ? extractValuesToArray(value) : [], onChange: handleChange, onOpen: () => {
|
|
71
|
-
|
|
71
|
+
if (!donotEnableMultiselectOrder) {
|
|
72
|
+
setSavedSortValue(fieldValue);
|
|
73
|
+
}
|
|
72
74
|
setTimeout(() => {
|
|
73
75
|
if (textfieldRef.current) {
|
|
74
76
|
textfieldRef.current?.focus();
|
|
@@ -76,7 +78,9 @@ function MultiSelectFieldComponent({ value, options, onChangeFn, disable = false
|
|
|
76
78
|
}, 0);
|
|
77
79
|
}, onClose: () => {
|
|
78
80
|
setSearchText('');
|
|
79
|
-
|
|
81
|
+
if (!donotEnableMultiselectOrder) {
|
|
82
|
+
setSavedSortValue(fieldValue);
|
|
83
|
+
}
|
|
80
84
|
}, renderValue: () => (jsx(Tooltip, { title: selectedValues, children: jsx("span", { children: selectedOptions.length > 3 ? `${selectedOptions.length} Selected` : selectedValues }) })), MenuProps: {
|
|
81
85
|
PaperProps: {
|
|
82
86
|
style: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as Calendar } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as Calendar } 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 requireDayCell } from '../DayCell/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DateInput } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DateInput } from '../../../../../_virtual/index.esm14.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.
|
|
1
|
+
import { __exports as DateRange } 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 requireCalendar } from '../Calendar/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DateRangePicker } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DateRangePicker } 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 requireDateRange } from '../DateRange/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DayCell } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DayCell } 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 InputRangeField } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as InputRangeField } from '../../../../../_virtual/index.esm12.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as Month } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as Month } 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 requireDayCell } from '../DayCell/index.esm.js';
|
|
@@ -3,6 +3,7 @@ import { SxProps } from '@mui/material';
|
|
|
3
3
|
export interface OptionsProps {
|
|
4
4
|
label: string | boolean | number;
|
|
5
5
|
value: string | number;
|
|
6
|
+
disable?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export interface TextFieldInputProps {
|
|
8
9
|
autoComplete: 'new-password' | 'off';
|
|
@@ -40,7 +41,7 @@ export interface FormSectionPropsItem {
|
|
|
40
41
|
customErrorMessage?: string | null;
|
|
41
42
|
sx?: SxProps<Theme>;
|
|
42
43
|
donotAllowSpace?: boolean;
|
|
43
|
-
onInputProps?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
44
|
+
onInputProps?: (e: React.FocusEvent<HTMLInputElement> | any) => void;
|
|
44
45
|
fileType?: 'excel' | 'pdf' | 'all' | 'zip' | 'image' | 'document' | '' | string[];
|
|
45
46
|
handleFileError?: (message: string) => void;
|
|
46
47
|
onCloseMenu?: () => void;
|
|
@@ -82,6 +83,7 @@ export interface FormSectionPropsItem {
|
|
|
82
83
|
headerColor?: string;
|
|
83
84
|
optionFontSize?: string;
|
|
84
85
|
isTooltipEnable?: boolean;
|
|
86
|
+
doNotEnableMultiselectOrder?: boolean;
|
|
85
87
|
}
|
|
86
88
|
export type VariantProps = 'standard' | 'outlined' | '';
|
|
87
89
|
export interface FormRenderProps {
|