tp-react-elements 3.0.10 → 3.0.11
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.esm6.js +2 -2
- package/dist/_virtual/index.esm7.js +2 -2
- package/dist/components/Form/FormRender.esm.js +6 -6
- package/dist/components/FormComponents/Select/MultiSelectv1.esm.js +41 -5
- package/dist/components/FormComponents/index.esm.js +27 -10
- package/dist/node_modules/react-date-range/dist/components/Calendar/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/DefinedRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/InputRangeField/index.esm.js +1 -1
- package/dist/utils/Interface/MainInterface.d.ts +13 -0
- package/package.json +1 -1
|
@@ -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 DayCell = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DayCell as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DefinedRange = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DefinedRange as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Calendar = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Calendar as __exports };
|
|
@@ -2,6 +2,12 @@ import { jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import require$$0__default, { lazy, Suspense } from 'react';
|
|
3
3
|
import FormCheckBox from '../FormComponents/FormCheckBox/FormCheckBox.esm.js';
|
|
4
4
|
import FormCheckBoxGroup from '../FormComponents/FormCheckBoxGroup/FormCheckBoxGroup.esm.js';
|
|
5
|
+
import FormNumberField from '../FormComponents/FormNumberField/FormNumberField.esm.js';
|
|
6
|
+
import FormNumberFieldDecimal from '../FormComponents/FormNumberField/FormNumberFieldDecimal.esm.js';
|
|
7
|
+
import FormRadioGroup from '../FormComponents/FormRadioGroup/FormRadioGroup.esm.js';
|
|
8
|
+
import FormTextAreaField from '../FormComponents/FormTextAreaField/FormTextAreaField.esm.js';
|
|
9
|
+
import FormTextField from '../FormComponents/FormTextField/FormTextField.esm.js';
|
|
10
|
+
import PasswordField from '../FormComponents/PasswordField/PasswordField.esm.js';
|
|
5
11
|
import SingleSelect from '../FormComponents/Select/SingleSelect.esm.js';
|
|
6
12
|
import MultiSelectAutocomplete from '../FormComponents/Select/MultiSelectAutocomplete.esm.js';
|
|
7
13
|
import SingleSelectNonAutoComplete from '../FormComponents/Select/SingleSelectNonAutoComplete.esm.js';
|
|
@@ -12,12 +18,6 @@ import DateRangePickerComponent from '../DateRangePicker/DateRangePicker.esm.js'
|
|
|
12
18
|
import RichTextEditorWrapper from '../FormComponents/RichTextEditor/RichTextEditorWrapper.esm.js';
|
|
13
19
|
import SingleSelectSearchApi from '../FormComponents/Select/SingleSelectSearchApi.esm.js';
|
|
14
20
|
import DatetimepickerWrapper from '../FormComponents/DatePicker/DatetimepickerWrapper.esm.js';
|
|
15
|
-
import FormTextAreaField from '../FormComponents/FormTextAreaField/FormTextAreaField.esm.js';
|
|
16
|
-
import FormRadioGroup from '../FormComponents/FormRadioGroup/FormRadioGroup.esm.js';
|
|
17
|
-
import FormNumberFieldDecimal from '../FormComponents/FormNumberField/FormNumberFieldDecimal.esm.js';
|
|
18
|
-
import FormNumberField from '../FormComponents/FormNumberField/FormNumberField.esm.js';
|
|
19
|
-
import PasswordField from '../FormComponents/PasswordField/PasswordField.esm.js';
|
|
20
|
-
import FormTextField from '../FormComponents/FormTextField/FormTextField.esm.js';
|
|
21
21
|
|
|
22
22
|
// Lazy-loaded heavy components
|
|
23
23
|
// const RichTextEditorWrapper = lazy(() =>
|
|
@@ -11,9 +11,30 @@ import { useWatch } from 'react-hook-form';
|
|
|
11
11
|
import FormBottomField from '../FormBottomField/FormBottomField.esm.js';
|
|
12
12
|
import 'dayjs';
|
|
13
13
|
import { renderLabel } from '../../../utils/Constants/FormConstants.esm.js';
|
|
14
|
+
import { useOptionalProjectTheme } from '../../../auth/authContext.esm.js';
|
|
14
15
|
|
|
15
16
|
const ITEM_HEIGHT = 36;
|
|
16
17
|
const ITEM_PADDING_TOP = 2;
|
|
18
|
+
/**
|
|
19
|
+
* Base shape shared by both states of the themed option glyph — only the border/background
|
|
20
|
+
* (checked vs unchecked) differ, passed in by the caller via `Checkbox`'s own `icon` and
|
|
21
|
+
* `checkedIcon` props. Kept as plain style objects (not a component) so the existing
|
|
22
|
+
* `<Checkbox>` stays the single source of truth for check state/interaction; this only
|
|
23
|
+
* reskins what it renders.
|
|
24
|
+
*/
|
|
25
|
+
const themedGlyphSx = {
|
|
26
|
+
width: 15,
|
|
27
|
+
height: 15,
|
|
28
|
+
borderRadius: '4px',
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
fontSize: 10,
|
|
33
|
+
fontWeight: 800,
|
|
34
|
+
color: '#fff',
|
|
35
|
+
border: '1.5px solid',
|
|
36
|
+
lineHeight: 1,
|
|
37
|
+
};
|
|
17
38
|
const extractValuesToArray = (inputString) => {
|
|
18
39
|
if (!inputString)
|
|
19
40
|
return [];
|
|
@@ -23,6 +44,7 @@ function MultiSelectV1({ props, variant, }) {
|
|
|
23
44
|
const [searchText, setSearchText] = useState('');
|
|
24
45
|
const options = props.item?.options || [];
|
|
25
46
|
const textfieldRef = useRef(null);
|
|
47
|
+
const multiSelectTheme = useOptionalProjectTheme()?.Styles?.Component?.TPMultiSelect;
|
|
26
48
|
// Ref to capture the width of the Select container
|
|
27
49
|
const containerRef = useRef(null);
|
|
28
50
|
const fieldValue = useWatch({ control: props.control, name: props.item.name });
|
|
@@ -111,15 +133,29 @@ function MultiSelectV1({ props, variant, }) {
|
|
|
111
133
|
whiteSpace: 'normal',
|
|
112
134
|
wordBreak: 'break-all',
|
|
113
135
|
alignItems: 'center',
|
|
114
|
-
py: 0.5,
|
|
115
|
-
px: 2,
|
|
136
|
+
py: multiSelectTheme ? 1 : 0.5,
|
|
137
|
+
px: multiSelectTheme ? 1.25 : 2,
|
|
116
138
|
minHeight: ITEM_HEIGHT,
|
|
117
|
-
|
|
118
|
-
|
|
139
|
+
...(multiSelectTheme && {
|
|
140
|
+
mx: 0.5,
|
|
141
|
+
borderRadius: '6px',
|
|
142
|
+
'&.Mui-selected, &.Mui-selected:hover': {
|
|
143
|
+
backgroundColor: multiSelectTheme.selectedRowBg ?? '#F4F8FC',
|
|
144
|
+
},
|
|
145
|
+
}),
|
|
146
|
+
}, children: [jsx(Checkbox, { checked: isChecked, size: "small", sx: multiSelectTheme ? { p: 0, mr: 1.25, pointerEvents: 'none' } : { p: 1, mr: 1, pointerEvents: 'none' }, ...(multiSelectTheme && {
|
|
147
|
+
icon: (jsx(Box, { component: "span", sx: { ...themedGlyphSx, borderColor: multiSelectTheme.uncheckedBorderColor ?? '#C9D3E0', background: '#fff' } })),
|
|
148
|
+
checkedIcon: (jsx(Box, { component: "span", sx: { ...themedGlyphSx, borderColor: multiSelectTheme.checkedColor ?? '#073B6D', background: multiSelectTheme.checkedColor ?? '#073B6D' }, children: "\u2713" })),
|
|
149
|
+
}) }), jsx(ListItemText, { className: 'Mui-multi-select-option', primary: option.label, primaryTypographyProps: {
|
|
150
|
+
fontSize: multiSelectTheme ? 12.5 : (props.item?.optionFontSize || '13px'),
|
|
119
151
|
sx: {
|
|
120
152
|
whiteSpace: 'normal',
|
|
121
153
|
wordBreak: 'break-all',
|
|
122
|
-
lineHeight: '1.2'
|
|
154
|
+
lineHeight: multiSelectTheme ? 1.35 : '1.2',
|
|
155
|
+
...(multiSelectTheme && {
|
|
156
|
+
fontWeight: 600,
|
|
157
|
+
color: isChecked ? (multiSelectTheme.checkedColor ?? '#073B6D') : '#42536B',
|
|
158
|
+
}),
|
|
123
159
|
}
|
|
124
160
|
} })] }, option.value));
|
|
125
161
|
})) : (jsx(MenuItem, { disabled: true, children: "No data Found" }))] }), jsx(FormBottomField, { ...props })] }) }, props.item.name));
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export { default as FormNumberField } from './FormNumberField/FormNumberField.esm.js';
|
|
2
|
+
export { default as FormNumberFieldDecimal } from './FormNumberField/FormNumberFieldDecimal.esm.js';
|
|
3
|
+
export { default as FormTextAreaField } from './FormTextAreaField/FormTextAreaField.esm.js';
|
|
4
|
+
export { default as FormTextField } from './FormTextField/FormTextField.esm.js';
|
|
5
|
+
export { default as PasswordField } from './PasswordField/PasswordField.esm.js';
|
|
1
6
|
export { default as FormCheckBox } from './FormCheckBox/FormCheckBox.esm.js';
|
|
2
7
|
export { default as SingleSelect } from './Select/SingleSelect.esm.js';
|
|
3
8
|
export { default as SingleSelectNonAutoComplete } from './Select/SingleSelectNonAutoComplete.esm.js';
|
|
@@ -6,20 +11,32 @@ export { default as MultiSelectV1 } from './Select/MultiSelectv1.esm.js';
|
|
|
6
11
|
export { default as MultiSelectTable } from './Select/MultiSelectTable.esm.js';
|
|
7
12
|
export { default as SearchableSelect } from './Select/SearchableSelect.esm.js';
|
|
8
13
|
export { default as FormCheckBoxGroup } from './FormCheckBoxGroup/FormCheckBoxGroup.esm.js';
|
|
14
|
+
export { default as FormRadioGroup } from './FormRadioGroup/FormRadioGroup.esm.js';
|
|
9
15
|
export { default as DatepickerWrapperV2 } from './DatePicker/DatepickerWrapperV2.esm.js';
|
|
16
|
+
export { default as Monthpickerrender } from './DatePicker/Monthpickerrender.esm.js';
|
|
17
|
+
import 'react/jsx-runtime';
|
|
18
|
+
import 'react';
|
|
19
|
+
import '@mui/material';
|
|
20
|
+
import '@mui/icons-material/CalendarToday';
|
|
21
|
+
import '@mui/icons-material/ChevronLeft';
|
|
22
|
+
import '@mui/icons-material/ChevronRight';
|
|
23
|
+
import 'react-hook-form';
|
|
10
24
|
export { default as FormBottomField } from './FormBottomField/FormBottomField.esm.js';
|
|
11
|
-
|
|
12
|
-
export { default as
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as FormRadioGroup } from './FormRadioGroup/FormRadioGroup.esm.js';
|
|
25
|
+
import 'dayjs';
|
|
26
|
+
export { default as YearPickerField } from './YearPickerField/YearPickerField.esm.js';
|
|
27
|
+
export { default as TimePicker } from './TimePicker/TimePicker.esm.js';
|
|
15
28
|
export { default as FormRenderFileUpload } from './FileUpload/FormRenderFileUpload.esm.js';
|
|
16
29
|
export { default as FormRenderMultiFileUpload } from './FileUpload/FormRenderMultiFileUpload.esm.js';
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
import '@mui/icons-material/Visibility';
|
|
31
|
+
import '@mui/icons-material/Close';
|
|
32
|
+
import '@mui/icons-material/NavigateBefore';
|
|
33
|
+
import '@mui/icons-material/NavigateNext';
|
|
34
|
+
import '@mui/icons-material/Delete';
|
|
35
|
+
import '@mui/icons-material/UploadFile';
|
|
36
|
+
import '@mui/icons-material/PictureAsPdf';
|
|
37
|
+
import '@mui/icons-material/TableChart';
|
|
38
|
+
import '@mui/icons-material/Description';
|
|
39
|
+
export { default as FormErrorField } from './FormErrorField/FormErrorField.esm.js';
|
|
19
40
|
export { default as HelperText } from './HelperText/HelperText.esm.js';
|
|
20
|
-
export { default as Monthpickerrender } from './DatePicker/Monthpickerrender.esm.js';
|
|
21
|
-
export { default as PasswordField } from './PasswordField/PasswordField.esm.js';
|
|
22
41
|
export { default as RichTextEditor } from './RichTextEditor/RichTextEditor.esm.js';
|
|
23
42
|
export { default as RichTextEditorWrapper } from './RichTextEditor/RichTextEditorWrapper.esm.js';
|
|
24
|
-
export { default as TimePicker } from './TimePicker/TimePicker.esm.js';
|
|
25
|
-
export { default as YearPickerField } from './YearPickerField/YearPickerField.esm.js';
|
|
@@ -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 require$$0__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 DayCell } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DayCell } from '../../../../../_virtual/index.esm12.js';
|
|
2
2
|
import require$$0__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.
|
|
1
|
+
import { __exports as DefinedRange } from '../../../../../_virtual/index.esm6.js';
|
|
2
2
|
import require$$0__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';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as InputRangeField } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as InputRangeField } from '../../../../../_virtual/index.esm11.js';
|
|
2
2
|
import require$$0__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
|
|
@@ -21,11 +21,24 @@ export interface ProjectComponentTPToggleSwitch {
|
|
|
21
21
|
export interface ProjectComponentTPRadioGroup {
|
|
22
22
|
checkedColor?: string;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Optional row/checkbox styling for `multiselect` (`MultiSelectV1`)'s dropdown options. Omitted
|
|
26
|
+
* entirely = the existing stock MUI `Checkbox` + default `MenuItem` selected-row tint are
|
|
27
|
+
* unchanged for every current consumer. Providing this swaps the checkbox for a compact
|
|
28
|
+
* rounded-square box and restyles the option row (padding/radius/selected background/text
|
|
29
|
+
* weight) to match a flatter, more custom design language.
|
|
30
|
+
*/
|
|
31
|
+
export interface ProjectComponentTPMultiSelect {
|
|
32
|
+
checkedColor?: string;
|
|
33
|
+
uncheckedBorderColor?: string;
|
|
34
|
+
selectedRowBg?: string;
|
|
35
|
+
}
|
|
24
36
|
export interface ProjectComponentStyles {
|
|
25
37
|
TPButton: ProjectComponentTPButton[];
|
|
26
38
|
TPButtonCommonSx: SxProps<Theme>;
|
|
27
39
|
TPToggleSwitch?: ProjectComponentTPToggleSwitch;
|
|
28
40
|
TPRadioGroup?: ProjectComponentTPRadioGroup;
|
|
41
|
+
TPMultiSelect?: ProjectComponentTPMultiSelect;
|
|
29
42
|
}
|
|
30
43
|
export interface ProjectThemeStyles {
|
|
31
44
|
Component: ProjectComponentStyles;
|