tp-react-elements 3.0.21 → 3.0.23
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.esm12.js +2 -2
- package/dist/_virtual/index.esm14.js +2 -2
- package/dist/_virtual/index.esm5.js +2 -2
- package/dist/_virtual/index.esm6.js +2 -2
- package/dist/components/Form/FormActiveSwitch.esm.js +7 -2
- package/dist/components/Form/FormRender.esm.js +8 -8
- package/dist/components/FormComponents/index.esm.js +29 -12
- package/dist/components/PaginatedGrid/GenericPaginatedGrid.esm.js +11 -1
- 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/DefinedRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/Month/index.esm.js +1 -1
- package/package.json +1 -1
|
@@ -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 Month = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Month 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 };
|
|
@@ -59,15 +59,20 @@ const FormActiveSwitch = ({ props }) => {
|
|
|
59
59
|
const { control, item } = props;
|
|
60
60
|
const valueActive = item.value1 ?? 'A';
|
|
61
61
|
const valueInactive = item.value2 ?? 'I';
|
|
62
|
+
const disable = Boolean(item.disable);
|
|
62
63
|
const toggleConfig = useOptionalProjectTheme()?.Styles?.Component?.TPToggleSwitch;
|
|
63
64
|
if (!toggleConfig) {
|
|
64
|
-
return (jsxs("fieldset", { className: "m-form__input", style: FIELDSET_STYLE, children: [item.label && (jsx("legend", { id: `${item.name}-label`, style: LEGEND_STYLE, children: item.label })), jsx(Controller, { name: item.name, control: control, render: ({ field }) => (jsxs("span", { className: "switch prestashop-switch fixed-width-lg", role: "radiogroup", "aria-labelledby": `${item.name}-label`, children: [jsx("input", { id: `${item.name}_on`, name: item.name, type: "radio", value: valueActive, checked: field.value === valueActive, onChange: () => field.onChange(valueActive), "aria-checked": field.value === valueActive }), jsx("label", { htmlFor: `${item.name}_on`, style: LABEL_STYLE, children: item.label1 ?? 'Active' }), jsx("input", { id: `${item.name}_off`, name: item.name, type: "radio", value: valueInactive, checked: field.value === valueInactive, onChange: () => field.onChange(valueInactive), "aria-checked": field.value === valueInactive }), jsx("label", { htmlFor: `${item.name}_off`, style: LABEL_STYLE, children: item.label2 ?? 'In Active' }), jsx("span", { className: "slide-button btn", "aria-hidden": "true" })] })) })] }));
|
|
65
|
+
return (jsxs("fieldset", { className: "m-form__input", style: FIELDSET_STYLE, children: [item.label && (jsx("legend", { id: `${item.name}-label`, style: LEGEND_STYLE, children: item.label })), jsx(Controller, { name: item.name, control: control, render: ({ field }) => (jsxs("span", { className: "switch prestashop-switch fixed-width-lg", role: "radiogroup", "aria-labelledby": `${item.name}-label`, "aria-disabled": disable, style: { opacity: disable ? 0.5 : 1, cursor: disable ? 'not-allowed' : undefined }, children: [jsx("input", { id: `${item.name}_on`, name: item.name, type: "radio", value: valueActive, checked: field.value === valueActive, onChange: () => !disable && field.onChange(valueActive), disabled: disable, "aria-checked": field.value === valueActive }), jsx("label", { htmlFor: `${item.name}_on`, style: LABEL_STYLE, children: item.label1 ?? 'Active' }), jsx("input", { id: `${item.name}_off`, name: item.name, type: "radio", value: valueInactive, checked: field.value === valueInactive, onChange: () => !disable && field.onChange(valueInactive), disabled: disable, "aria-checked": field.value === valueInactive }), jsx("label", { htmlFor: `${item.name}_off`, style: LABEL_STYLE, children: item.label2 ?? 'In Active' }), jsx("span", { className: "slide-button btn", "aria-hidden": "true" })] })) })] }));
|
|
65
66
|
}
|
|
66
67
|
const onColor = toggleConfig.onColor ?? '#00A86B';
|
|
67
68
|
const offColor = toggleConfig.offColor ?? '#D5DCE6';
|
|
68
69
|
return (jsx(Controller, { name: item.name, control: control, render: ({ field }) => {
|
|
69
70
|
const on = field.value === valueActive;
|
|
70
|
-
return (jsxs("div", { style: CARD_STYLE, children: [jsx("button", { type: "button", role: "switch", "aria-checked": on, "aria-labelledby": `${item.name}-label`,
|
|
71
|
+
return (jsxs("div", { style: { ...CARD_STYLE, opacity: disable ? 0.5 : 1 }, children: [jsx("button", { type: "button", role: "switch", "aria-checked": on, "aria-labelledby": `${item.name}-label`, "aria-disabled": disable, disabled: disable, onClick: () => !disable && field.onChange(on ? valueInactive : valueActive), style: {
|
|
72
|
+
...TRACK_BASE,
|
|
73
|
+
background: on ? onColor : offColor,
|
|
74
|
+
cursor: disable ? 'not-allowed' : 'pointer',
|
|
75
|
+
}, children: jsx("span", { style: { ...KNOB_BASE, left: on ? 17 : 2 } }) }), jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }, children: [jsx("span", { id: `${item.name}-label`, style: { fontSize: 12.5, fontWeight: 700, whiteSpace: 'nowrap' }, children: item.label }), jsx("span", { style: {
|
|
71
76
|
...BADGE_BASE,
|
|
72
77
|
background: on ? '#EEF7F2' : '#F2F5F9',
|
|
73
78
|
color: on ? '#00764A' : '#8A97A8',
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import require$$0__default, { lazy, Suspense } from 'react';
|
|
3
|
+
import FormCheckBox from '../FormComponents/FormCheckBox/FormCheckBox.esm.js';
|
|
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';
|
|
3
11
|
import SingleSelect from '../FormComponents/Select/SingleSelect.esm.js';
|
|
4
12
|
import MultiSelectAutocomplete from '../FormComponents/Select/MultiSelectAutocomplete.esm.js';
|
|
5
13
|
import SingleSelectNonAutoComplete from '../FormComponents/Select/SingleSelectNonAutoComplete.esm.js';
|
|
@@ -11,14 +19,6 @@ import RichTextEditorWrapper from '../FormComponents/RichTextEditor/RichTextEdit
|
|
|
11
19
|
import SingleSelectSearchApi from '../FormComponents/Select/SingleSelectSearchApi.esm.js';
|
|
12
20
|
import MultiSelectSearchApi from '../FormComponents/Select/MultiSelectSearchApi.esm.js';
|
|
13
21
|
import DatetimepickerWrapper from '../FormComponents/DatePicker/DatetimepickerWrapper.esm.js';
|
|
14
|
-
import FormTextAreaField from '../FormComponents/FormTextAreaField/FormTextAreaField.esm.js';
|
|
15
|
-
import FormCheckBox from '../FormComponents/FormCheckBox/FormCheckBox.esm.js';
|
|
16
|
-
import FormRadioGroup from '../FormComponents/FormRadioGroup/FormRadioGroup.esm.js';
|
|
17
|
-
import FormCheckBoxGroup from '../FormComponents/FormCheckBoxGroup/FormCheckBoxGroup.esm.js';
|
|
18
|
-
import FormNumberFieldDecimal from '../FormComponents/FormNumberField/FormNumberFieldDecimal.esm.js';
|
|
19
|
-
import FormNumberField from '../FormComponents/FormNumberField/FormNumberField.esm.js';
|
|
20
|
-
import PasswordField from '../FormComponents/PasswordField/PasswordField.esm.js';
|
|
21
|
-
import FormTextField from '../FormComponents/FormTextField/FormTextField.esm.js';
|
|
22
22
|
|
|
23
23
|
// Lazy-loaded heavy components
|
|
24
24
|
// const RichTextEditorWrapper = lazy(() =>
|
|
@@ -1,3 +1,9 @@
|
|
|
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';
|
|
6
|
+
export { default as FormCheckBox } from './FormCheckBox/FormCheckBox.esm.js';
|
|
1
7
|
export { default as SingleSelect } from './Select/SingleSelect.esm.js';
|
|
2
8
|
export { default as SingleSelectNonAutoComplete } from './Select/SingleSelectNonAutoComplete.esm.js';
|
|
3
9
|
export { default as SingleSelectSearchApi } from './Select/SingleSelectSearchApi.esm.js';
|
|
@@ -5,22 +11,33 @@ export { default as MultiSelectSearchApi } from './Select/MultiSelectSearchApi.e
|
|
|
5
11
|
export { default as MultiSelectV1 } from './Select/MultiSelectv1.esm.js';
|
|
6
12
|
export { default as MultiSelectTable } from './Select/MultiSelectTable.esm.js';
|
|
7
13
|
export { default as SearchableSelect } from './Select/SearchableSelect.esm.js';
|
|
8
|
-
export { default as DatepickerWrapperV2 } from './DatePicker/DatepickerWrapperV2.esm.js';
|
|
9
|
-
export { default as FormBottomField } from './FormBottomField/FormBottomField.esm.js';
|
|
10
|
-
export { default as FormCheckBox } from './FormCheckBox/FormCheckBox.esm.js';
|
|
11
14
|
export { default as FormCheckBoxGroup } from './FormCheckBoxGroup/FormCheckBoxGroup.esm.js';
|
|
12
|
-
export { default as FormErrorField } from './FormErrorField/FormErrorField.esm.js';
|
|
13
|
-
export { default as FormNumberField } from './FormNumberField/FormNumberField.esm.js';
|
|
14
|
-
export { default as FormNumberFieldDecimal } from './FormNumberField/FormNumberFieldDecimal.esm.js';
|
|
15
15
|
export { default as FormRadioGroup } from './FormRadioGroup/FormRadioGroup.esm.js';
|
|
16
|
+
export { default as DatepickerWrapperV2 } from './DatePicker/DatepickerWrapperV2.esm.js';
|
|
17
|
+
export { default as Monthpickerrender } from './DatePicker/Monthpickerrender.esm.js';
|
|
18
|
+
import 'react/jsx-runtime';
|
|
19
|
+
import 'react';
|
|
20
|
+
import '@mui/material';
|
|
21
|
+
import '@mui/icons-material/CalendarToday';
|
|
22
|
+
import '@mui/icons-material/ChevronLeft';
|
|
23
|
+
import '@mui/icons-material/ChevronRight';
|
|
24
|
+
import 'react-hook-form';
|
|
25
|
+
export { default as FormBottomField } from './FormBottomField/FormBottomField.esm.js';
|
|
26
|
+
import 'dayjs';
|
|
27
|
+
export { default as YearPickerField } from './YearPickerField/YearPickerField.esm.js';
|
|
28
|
+
export { default as TimePicker } from './TimePicker/TimePicker.esm.js';
|
|
16
29
|
export { default as FormRenderFileUpload } from './FileUpload/FormRenderFileUpload.esm.js';
|
|
17
30
|
export { default as FormRenderMultiFileUpload } from './FileUpload/FormRenderMultiFileUpload.esm.js';
|
|
18
|
-
|
|
19
|
-
|
|
31
|
+
import '@mui/icons-material/Visibility';
|
|
32
|
+
import '@mui/icons-material/Close';
|
|
33
|
+
import '@mui/icons-material/NavigateBefore';
|
|
34
|
+
import '@mui/icons-material/NavigateNext';
|
|
35
|
+
import '@mui/icons-material/Delete';
|
|
36
|
+
import '@mui/icons-material/UploadFile';
|
|
37
|
+
import '@mui/icons-material/PictureAsPdf';
|
|
38
|
+
import '@mui/icons-material/TableChart';
|
|
39
|
+
import '@mui/icons-material/Description';
|
|
40
|
+
export { default as FormErrorField } from './FormErrorField/FormErrorField.esm.js';
|
|
20
41
|
export { default as HelperText } from './HelperText/HelperText.esm.js';
|
|
21
|
-
export { default as Monthpickerrender } from './DatePicker/Monthpickerrender.esm.js';
|
|
22
|
-
export { default as PasswordField } from './PasswordField/PasswordField.esm.js';
|
|
23
42
|
export { default as RichTextEditor } from './RichTextEditor/RichTextEditor.esm.js';
|
|
24
43
|
export { default as RichTextEditorWrapper } from './RichTextEditor/RichTextEditorWrapper.esm.js';
|
|
25
|
-
export { default as TimePicker } from './TimePicker/TimePicker.esm.js';
|
|
26
|
-
export { default as YearPickerField } from './YearPickerField/YearPickerField.esm.js';
|
|
@@ -205,7 +205,17 @@ const buildHeaderCellSx = (align, headerMin, headerMax, headerFont, headerBgColo
|
|
|
205
205
|
};
|
|
206
206
|
return {
|
|
207
207
|
...(headerBgColor
|
|
208
|
-
? {
|
|
208
|
+
? {
|
|
209
|
+
backgroundColor: `${headerBgColor} !important`,
|
|
210
|
+
backgroundImage: 'none',
|
|
211
|
+
// MRT paints pinned header cells with an absolutely-positioned
|
|
212
|
+
// `::before` backdrop (see `getCommonPinnedCellStyles` in
|
|
213
|
+
// material-react-table) using its own theme background, layered on
|
|
214
|
+
// top of this cell's own background-color — otherwise invisible,
|
|
215
|
+
// but it silently masks any custom headerBgColor on pinned columns
|
|
216
|
+
// while unpinned header cells (no such overlay) show it correctly.
|
|
217
|
+
'&[data-pinned="true"]:before': { backgroundColor: `${headerBgColor} !important` },
|
|
218
|
+
}
|
|
209
219
|
: {}),
|
|
210
220
|
...(headerTextColor ? { color: `${headerTextColor} !important` } : {}),
|
|
211
221
|
height: `${headerMax} !important`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as Calendar } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as Calendar } 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 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.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.esm5.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 Month } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as Month } from '../../../../../_virtual/index.esm14.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';
|