tp-react-elements-dev 1.12.20 → 1.12.22
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/components/DeleteComponent/DeleteField.js +24 -0
- package/dist/components/Form/Form.styles.js +111 -0
- package/dist/components/Form/FormActiveSwitch.js +27 -0
- package/dist/components/Form/FormConstants.d.ts +1 -1
- package/dist/components/Form/FormConstants.d.ts.map +1 -1
- package/dist/components/Form/FormConstants.js +336 -0
- package/dist/components/Form/FormRender.d.ts +1 -1
- package/dist/components/Form/FormRender.d.ts.map +1 -1
- package/dist/components/Form/FormRender.js +96 -0
- package/dist/components/Form/FormRenderWrapper.d.ts +1 -1
- package/dist/components/Form/FormRenderWrapper.d.ts.map +1 -1
- package/dist/components/Form/FormRenderWrapper.js +13 -0
- package/dist/components/FormComponents/DatePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/FormComponents/DatePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/FormComponents/DatePicker/DatepickerWrapperV2.d.ts +1 -1
- package/dist/components/FormComponents/DatePicker/DatepickerWrapperV2.d.ts.map +1 -1
- package/dist/components/FormComponents/DatePicker/DatepickerWrapperV2.js +58 -0
- package/dist/components/FormComponents/DatePicker/MonthPicker.d.ts.map +1 -1
- package/dist/components/FormComponents/DatePicker/MonthPicker.js +48 -0
- package/dist/components/FormComponents/DatePicker/Monthpickerrender.d.ts +1 -1
- package/dist/components/FormComponents/DatePicker/Monthpickerrender.d.ts.map +1 -1
- package/dist/components/FormComponents/DatePicker/Monthpickerrender.js +61 -0
- package/dist/components/FormComponents/FileUpload/FormRenderFileUpload.d.ts +1 -1
- package/dist/components/FormComponents/FileUpload/FormRenderFileUpload.d.ts.map +1 -1
- package/dist/components/FormComponents/FileUpload/FormRenderFileUpload.js +86 -0
- package/dist/components/FormComponents/FileUpload/FormRenderMultiFileUpload.d.ts +1 -1
- package/dist/components/FormComponents/FileUpload/FormRenderMultiFileUpload.d.ts.map +1 -1
- package/dist/components/FormComponents/FileUpload/FormRenderMultiFileUpload.js +96 -0
- package/dist/components/FormComponents/FormBottomField/FormBottomField.d.ts +1 -1
- package/dist/components/FormComponents/FormBottomField/FormBottomField.d.ts.map +1 -1
- package/dist/components/FormComponents/FormBottomField/FormBottomField.js +9 -0
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.d.ts +1 -1
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.d.ts.map +1 -1
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +10 -0
- package/dist/components/FormComponents/FormCheckBoxGroup/FormCheckBoxGroup.d.ts +1 -1
- package/dist/components/FormComponents/FormCheckBoxGroup/FormCheckBoxGroup.d.ts.map +1 -1
- package/dist/components/FormComponents/FormCheckBoxGroup/FormCheckBoxGroup.js +23 -0
- package/dist/components/FormComponents/FormErrorField/FormErrorField.d.ts +1 -1
- package/dist/components/FormComponents/FormErrorField/FormErrorField.d.ts.map +1 -1
- package/dist/components/FormComponents/FormErrorField/FormErrorField.js +9 -0
- package/dist/components/FormComponents/FormNumberField/FormNumberField.d.ts +1 -1
- package/dist/components/FormComponents/FormNumberField/FormNumberField.d.ts.map +1 -1
- package/dist/components/FormComponents/FormNumberField/FormNumberField.js +49 -0
- package/dist/components/FormComponents/FormNumberField/FormNumberFieldDecimal.d.ts +1 -1
- package/dist/components/FormComponents/FormNumberField/FormNumberFieldDecimal.d.ts.map +1 -1
- package/dist/components/FormComponents/FormNumberField/FormNumberFieldDecimal.js +45 -0
- package/dist/components/FormComponents/FormRadioGroup/FormRadioGroup.d.ts +1 -1
- package/dist/components/FormComponents/FormRadioGroup/FormRadioGroup.d.ts.map +1 -1
- package/dist/components/FormComponents/FormRadioGroup/FormRadioGroup.js +26 -0
- package/dist/components/FormComponents/FormTextAreaField/FormTextAreaField.d.ts +1 -1
- package/dist/components/FormComponents/FormTextAreaField/FormTextAreaField.d.ts.map +1 -1
- package/dist/components/FormComponents/FormTextAreaField/FormTextAreaField.js +31 -0
- package/dist/components/FormComponents/FormTextAreaField/FormTextAreaField.styles.js +35 -0
- package/dist/components/FormComponents/FormTextField/FormTextField.d.ts +1 -1
- package/dist/components/FormComponents/FormTextField/FormTextField.d.ts.map +1 -1
- package/dist/components/FormComponents/FormTextField/FormTextField.js +46 -0
- package/dist/components/FormComponents/FormTextField/FormTextField.styles.js +22 -0
- package/dist/components/FormComponents/HelperText/HelperText.d.ts +1 -1
- package/dist/components/FormComponents/HelperText/HelperText.d.ts.map +1 -1
- package/dist/components/FormComponents/HelperText/HelperText.js +10 -0
- package/dist/components/FormComponents/PasswordField/PasswordField.d.ts +1 -1
- package/dist/components/FormComponents/PasswordField/PasswordField.d.ts.map +1 -1
- package/dist/components/FormComponents/PasswordField/PasswordField.js +49 -0
- package/dist/components/FormComponents/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/components/FormComponents/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/FormComponents/RichTextEditor/RichTextEditor.js +95 -0
- package/dist/components/FormComponents/RichTextEditor/RichTextEditorWrapper.d.ts +1 -1
- package/dist/components/FormComponents/RichTextEditor/RichTextEditorWrapper.d.ts.map +1 -1
- package/dist/components/FormComponents/RichTextEditor/RichTextEditorWrapper.js +11 -0
- package/dist/components/FormComponents/RichTextEditor/jodit.index.js +27 -0
- package/dist/components/FormComponents/Select/MultiSelectv1.d.ts +1 -1
- package/dist/components/FormComponents/Select/MultiSelectv1.d.ts.map +1 -1
- package/dist/components/FormComponents/Select/MultiSelectv1.js +157 -0
- package/dist/components/FormComponents/Select/SingleSelect.d.ts +1 -1
- package/dist/components/FormComponents/Select/SingleSelect.d.ts.map +1 -1
- package/dist/components/FormComponents/Select/SingleSelect.js +51 -0
- package/dist/components/FormComponents/Select/SingleSelectNonAutoComplete.d.ts +1 -1
- package/dist/components/FormComponents/Select/SingleSelectNonAutoComplete.d.ts.map +1 -1
- package/dist/components/FormComponents/Select/SingleSelectNonAutoComplete.js +27 -0
- package/dist/components/FormComponents/Select/SingleSelectSearchApi.js +204 -0
- package/dist/components/FormComponents/TimePicker/TimePicker.d.ts +1 -1
- package/dist/components/FormComponents/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/FormComponents/TimePicker/TimePicker.js +55 -0
- package/dist/components/FormComponents/YearPickerField/YearPickerField.js +82 -0
- package/dist/components/FormComponents/index.js +26 -0
- package/dist/components/Global.styles.js +79 -0
- package/dist/components/ModalField/ConfirmationDialog.js +48 -0
- package/dist/components/ModalField/ModalField.js +32 -0
- package/dist/components/SelectField/MultiSelectFieldComponent.js +129 -0
- package/dist/components/SessionTimeOut/SessionTimeOut.js +63 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2673
- package/dist/lib/Constants/FormConstants.d.ts.map +1 -0
- package/dist/lib/Constants/FormConstants.js +54 -0
- package/dist/lib/Constants/FunctionConstants.d.ts.map +1 -0
- package/dist/lib/Constants/FunctionConstants.js +244 -0
- package/dist/{Utilities → lib}/Interface/FormInterface.d.ts +0 -1
- package/dist/lib/Interface/FormInterface.d.ts.map +1 -0
- package/dist/lib/index.d.ts +3 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +4 -0
- package/dist/theme/index.js +64 -0
- package/dist/validation/schemas.js +60 -0
- package/package.json +6 -5
- package/dist/Utilities/Constants/FormConstants.d.ts.map +0 -1
- package/dist/Utilities/Constants/FunctionConstants.d.ts.map +0 -1
- package/dist/Utilities/Interface/FormInterface.d.ts.map +0 -1
- package/dist/Utilities/index.d.ts +0 -4
- package/dist/Utilities/index.d.ts.map +0 -1
- package/dist/index.esm.css +0 -1
- package/dist/index.esm.js +0 -2632
- package/dist/lib/constants.d.ts +0 -2
- package/dist/lib/constants.d.ts.map +0 -1
- package/dist/lib/hook-form.d.ts +0 -4
- package/dist/lib/hook-form.d.ts.map +0 -1
- /package/dist/{Utilities → lib}/Constants/FormConstants.d.ts +0 -0
- /package/dist/{Utilities → lib}/Constants/FunctionConstants.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormConstants.d.ts","sourceRoot":"","sources":["../../../src/lib/Constants/FormConstants.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE3E,eAAO,MAAM,WAAW,GAAI,SAAS,YAAY,EAAE,OAAO,eAAe,EAAC,YAAU,OAAa,oDAM9F,CAAC;AACJ,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,GAAG,UAc/C;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,sBAYjD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,UAIrE;AAED,eAAO,MAAM,WAAW,GAAI,iBAAiB,MAAM,GAAG,GAAG,WAaxD,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
|
|
4
|
+
const renderLabel = (variant, props, showLabel = false) => (variant === "standard" || showLabel) && (jsxs("span", { className: "formInputlabel", style: { fontSize: "12px" }, children: [props.item.label, " ", props.item.required && jsx("span", { style: { color: "red" }, children: "*" })] }));
|
|
5
|
+
function formatDateMonthAndYear(date) {
|
|
6
|
+
// Check if date is a string
|
|
7
|
+
if (typeof date !== "string") {
|
|
8
|
+
throw new TypeError("Expected a string");
|
|
9
|
+
}
|
|
10
|
+
// Split the date string into month and year
|
|
11
|
+
const [month, year] = date.split("/");
|
|
12
|
+
// If the month has only one digit, prepend '0' to it
|
|
13
|
+
const formattedMonth = month.length === 1 ? "0" + month : month;
|
|
14
|
+
// Return the formatted date with day set to '01'
|
|
15
|
+
return `${formattedMonth}/01/${year}`;
|
|
16
|
+
}
|
|
17
|
+
function parseCustomTime(timeString) {
|
|
18
|
+
if (!timeString)
|
|
19
|
+
return null; // Return null if empty
|
|
20
|
+
const [timePart, msPart] = timeString.split(".");
|
|
21
|
+
const [hours, minutes, seconds] = timePart.split(":").map(Number);
|
|
22
|
+
const milliseconds = msPart
|
|
23
|
+
? Number(parseFloat(`0.${msPart}`).toFixed(3)) * 1000
|
|
24
|
+
: 0;
|
|
25
|
+
return dayjs()
|
|
26
|
+
.hour(hours)
|
|
27
|
+
.minute(minutes)
|
|
28
|
+
.second(seconds)
|
|
29
|
+
.millisecond(milliseconds);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Formats a Day.js object into "HH:mm:ss.SSSSSSS"
|
|
33
|
+
*/
|
|
34
|
+
function formatDayjsToCustomTime(date) {
|
|
35
|
+
if (!date || !date.isValid())
|
|
36
|
+
return "";
|
|
37
|
+
const milliseconds = date.millisecond().toString().padEnd(7, "0");
|
|
38
|
+
return `${date.format("HH:mm:ss")}.${milliseconds}`;
|
|
39
|
+
}
|
|
40
|
+
const extractDate = (inputDateString) => {
|
|
41
|
+
const inputDate = new Date(inputDateString);
|
|
42
|
+
if (!inputDateString) {
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
45
|
+
// Extract day, month, and year components
|
|
46
|
+
const day = inputDate.getDate();
|
|
47
|
+
const month = inputDate.getMonth() + 1; // Months are zero-based
|
|
48
|
+
const year = inputDate.getFullYear();
|
|
49
|
+
// Format the components as DD/MM/YYYY
|
|
50
|
+
const formattedDate = `${day}/${month}/${year}`;
|
|
51
|
+
return formattedDate;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { extractDate, formatDateMonthAndYear, formatDayjsToCustomTime, parseCustomTime, renderLabel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FunctionConstants.d.ts","sourceRoot":"","sources":["../../../src/lib/Constants/FunctionConstants.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,iCAAiC,GAC5C,UAAU,M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|
|
4
|
+
import 'crypto-js';
|
|
5
|
+
|
|
6
|
+
const toTitleCase = (str) => {
|
|
7
|
+
return str
|
|
8
|
+
.replace(/([A-Z])/g, " $1") // Insert space before capital letters
|
|
9
|
+
.replace(/^./, (match) => match.toUpperCase()) // Capitalize the first letter
|
|
10
|
+
.trim(); // Remove any leading or trailing spaces
|
|
11
|
+
};
|
|
12
|
+
const getMaxLength = (data, key) => {
|
|
13
|
+
const keyLength = key.length;
|
|
14
|
+
// Length of the key (column header)
|
|
15
|
+
const dataMaxLength = Math.max(...data.map((item) => (item[key] ? item[key].toString().length : 0)));
|
|
16
|
+
return Math.max(keyLength, dataMaxLength);
|
|
17
|
+
}; // Return the maximum of key length or data length };
|
|
18
|
+
const handleDownloadReactTableDataExcel = (fileName, rowData, columns = [], customColumns = [], HeaderBackGround = "FFF4694B", HeaderColor = "000000") => {
|
|
19
|
+
const EXCEL_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8";
|
|
20
|
+
const EXCEL_EXTENSION = ".xlsx";
|
|
21
|
+
// Exclude 'actions' column and columns with hideOnExcel: true
|
|
22
|
+
const visibleColumns1 = columns.filter((col) => col?.accessorKey !== "actions");
|
|
23
|
+
const visibleColumns = visibleColumns1.filter((col) => !col?.hideOnExcel || col?.hideOnExcel !== true);
|
|
24
|
+
const data = rowData;
|
|
25
|
+
// Map column headers and accessorKeys
|
|
26
|
+
const columnHeaders = visibleColumns.length > 0
|
|
27
|
+
? visibleColumns.map((col) => col.header)
|
|
28
|
+
: Object.keys(data[0]); // Use data keys as headers if columns are not provided
|
|
29
|
+
const accessorKeys = visibleColumns.length > 0
|
|
30
|
+
? visibleColumns.map((col) => col.accessorKey)
|
|
31
|
+
: Object.keys(data[0]); // Use data keys as accessor keys if columns are not provided
|
|
32
|
+
// Reformat data to include only visible columns
|
|
33
|
+
const formattedData = data.map((row) => {
|
|
34
|
+
const formattedRow = {};
|
|
35
|
+
accessorKeys.forEach((key) => {
|
|
36
|
+
formattedRow[key] = row[key] || "";
|
|
37
|
+
});
|
|
38
|
+
return formattedRow;
|
|
39
|
+
});
|
|
40
|
+
// Create worksheet
|
|
41
|
+
const ws = XLSX.utils.json_to_sheet(formattedData, { header: accessorKeys });
|
|
42
|
+
// Apply column headers styling dynamically
|
|
43
|
+
accessorKeys.forEach((key, index) => {
|
|
44
|
+
const colLetter = XLSX.utils.encode_col(index); // Excel column letter
|
|
45
|
+
const cellAddress = `${colLetter}1`; // Header row cell
|
|
46
|
+
const headerText = toTitleCase(columnHeaders[index]);
|
|
47
|
+
ws[cellAddress] = {
|
|
48
|
+
t: "s",
|
|
49
|
+
v: headerText,
|
|
50
|
+
s: {
|
|
51
|
+
fill: { patternType: "solid", fgColor: { rgb: HeaderBackGround } },
|
|
52
|
+
font: { bold: true, color: { rgb: HeaderColor }, sz: 12 },
|
|
53
|
+
alignment: { horizontal: "center" },
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
// Apply custom color to entire column based on excelColumnColor in the column definition
|
|
57
|
+
const col = visibleColumns.length > 0
|
|
58
|
+
? visibleColumns[index]
|
|
59
|
+
: customColumns.length > 0 &&
|
|
60
|
+
customColumns.find((item) => item.accessorKey === key);
|
|
61
|
+
if (col && col.excelColumnColor) {
|
|
62
|
+
const columnColor = col.excelColumnColor;
|
|
63
|
+
const textColor = col.excelTextColor;
|
|
64
|
+
// Apply color to all rows in that column (from row 2 onward)
|
|
65
|
+
for (let rowIndex = 2; rowIndex <= formattedData.length + 1; rowIndex++) {
|
|
66
|
+
const cell = `${colLetter}${rowIndex}`;
|
|
67
|
+
ws[cell] = ws[cell] || {}; // Ensure cell exists
|
|
68
|
+
ws[cell].s = ws[cell].s || {}; // Ensure style exists
|
|
69
|
+
ws[cell].s.fill = {
|
|
70
|
+
patternType: "solid",
|
|
71
|
+
fgColor: { rgb: columnColor },
|
|
72
|
+
font: { color: { rgb: textColor } },
|
|
73
|
+
};
|
|
74
|
+
ws[cell].s.border = {
|
|
75
|
+
top: { style: "thin", color: { rgb: "000000" } }, // Black thin border
|
|
76
|
+
bottom: { style: "thin", color: { rgb: "000000" } },
|
|
77
|
+
left: { style: "thin", color: { rgb: "000000" } },
|
|
78
|
+
right: { style: "thin", color: { rgb: "000000" } },
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
// Set column widths dynamically or with defaults
|
|
84
|
+
const colWidths = visibleColumns.length > 0
|
|
85
|
+
? accessorKeys.map((accessorKey) => {
|
|
86
|
+
// Find the corresponding column by accessorKey
|
|
87
|
+
const column = visibleColumns.find((col) => col.accessorKey === accessorKey);
|
|
88
|
+
// Check if `excelColumnSize` is defined for this column
|
|
89
|
+
if (column && column.excelColumnSize) {
|
|
90
|
+
return {
|
|
91
|
+
wch: parseInt(column.excelColumnSize.replace("px", "")) / 7,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return { wch: getMaxLength(data, accessorKey) + 5 }; // Default column width
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
: customColumns.length > 0
|
|
99
|
+
? accessorKeys.map((accessorKey) => {
|
|
100
|
+
// Find the corresponding column by accessorKey
|
|
101
|
+
const column = customColumns.find((col) => col.accessorKey === accessorKey);
|
|
102
|
+
// Check if `excelColumnSize` is defined for this column
|
|
103
|
+
if (column && column.excelColumnSize) {
|
|
104
|
+
return {
|
|
105
|
+
wch: parseInt(column.excelColumnSize.replace("px", "")) / 7,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
return { wch: getMaxLength(data, accessorKey) + 5 }; // Default column width
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
: accessorKeys.map((accessorKey) => {
|
|
113
|
+
// Find the corresponding column by accessorKey
|
|
114
|
+
const column = customColumns.find((col) => col.accessorKey === accessorKey);
|
|
115
|
+
// Check if `excelColumnSize` is defined for this column
|
|
116
|
+
if (column && column.excelColumnSize) {
|
|
117
|
+
return {
|
|
118
|
+
wch: parseInt(column.excelColumnSize.replace("px", "")) / 7,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
return { wch: getMaxLength(data, accessorKey) + 5 }; // Default column width
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
ws["!cols"] = colWidths;
|
|
126
|
+
// Create workbook and save it
|
|
127
|
+
const wb = XLSX.utils.book_new();
|
|
128
|
+
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
|
129
|
+
const eb = XLSX.write(wb, { bookType: "xlsx", type: "array" });
|
|
130
|
+
const blob = new Blob([eb], { type: EXCEL_TYPE });
|
|
131
|
+
saveAs(blob, fileName + EXCEL_EXTENSION);
|
|
132
|
+
};
|
|
133
|
+
function getUsernameFromEmail(email) {
|
|
134
|
+
return email.split("@")[0];
|
|
135
|
+
}
|
|
136
|
+
function getInitials(name) {
|
|
137
|
+
if (!name)
|
|
138
|
+
return "";
|
|
139
|
+
const words = name.trim().split(/\s+/); // split by any spaces
|
|
140
|
+
let initials = "";
|
|
141
|
+
for (let i = 0; i < words.length && initials.length < 2; i++) {
|
|
142
|
+
initials += words[i][0].toUpperCase();
|
|
143
|
+
}
|
|
144
|
+
return initials;
|
|
145
|
+
}
|
|
146
|
+
function findMenuHierarchy(menuData, currentUrl, URLProjectNameWithSlash) {
|
|
147
|
+
const url = currentUrl;
|
|
148
|
+
const pathname = url.pathname.replace(URLProjectNameWithSlash, "").toLowerCase() +
|
|
149
|
+
url.search.toLowerCase();
|
|
150
|
+
let result = [];
|
|
151
|
+
function traverse(menus, path = []) {
|
|
152
|
+
for (const menu of menus) {
|
|
153
|
+
const currentPath = [...path, menu];
|
|
154
|
+
const subMenusRaw = []
|
|
155
|
+
.concat(menu.SubMenu || [], menu.SubMenus || [])
|
|
156
|
+
.filter(Boolean);
|
|
157
|
+
// Match found
|
|
158
|
+
if (menu.Path && menu.Path.toLowerCase() === pathname) {
|
|
159
|
+
result = currentPath;
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
if (subMenusRaw.length > 0) {
|
|
163
|
+
if (traverse(subMenusRaw, currentPath)) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
traverse(menuData);
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Calculates a date by adding/subtracting days from today or a base date
|
|
175
|
+
* @param dayOffset - Days to add (positive) or subtract (negative) (default: 0)
|
|
176
|
+
* @param baseDate - Base date in DD/MM/YYYY format (default: today)
|
|
177
|
+
* @returns Formatted date string in DD/MM/YYYY format
|
|
178
|
+
*/
|
|
179
|
+
const getDesiredDate = (dayOffset = 0, baseDate = null) => {
|
|
180
|
+
const startDate = baseDate ? dayjs(baseDate, "DD/MM/YYYY") : dayjs();
|
|
181
|
+
if (!startDate.isValid()) {
|
|
182
|
+
throw new Error("Invalid date format. Please use DD/MM/YYYY.");
|
|
183
|
+
}
|
|
184
|
+
return startDate.add(dayOffset, "day").format("DD/MM/YYYY");
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Calculates sum of numeric values for a specific property across array objects
|
|
188
|
+
* @param array - Array of objects to sum
|
|
189
|
+
* @param key - Property name to sum
|
|
190
|
+
* @returns Total sum of numeric values
|
|
191
|
+
*/
|
|
192
|
+
function calculateTotalArrayValueTotal(array, key) {
|
|
193
|
+
if (!Array.isArray(array)) {
|
|
194
|
+
return 0;
|
|
195
|
+
}
|
|
196
|
+
return array.reduce((sum, item) => {
|
|
197
|
+
const value = Number(item[key]) || 0;
|
|
198
|
+
return sum + value;
|
|
199
|
+
}, 0);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Checks if first date comes before second date
|
|
203
|
+
* @param dateStr1 - First date in DD/MM/YYYY format
|
|
204
|
+
* @param dateStr2 - Second date in DD/MM/YYYY format
|
|
205
|
+
* @returns True if dateStr1 is before dateStr2
|
|
206
|
+
*/
|
|
207
|
+
function checkIsDateIsBefore(dateStr1, dateStr2) {
|
|
208
|
+
const date1 = dayjs(dateStr1.trim(), "DD/MM/YYYY");
|
|
209
|
+
const date2 = dayjs(dateStr2.trim(), "DD/MM/YYYY");
|
|
210
|
+
if (!date1.isValid() || !date2.isValid()) {
|
|
211
|
+
throw new Error("Invalid date format. Please use DD/MM/YYYY.");
|
|
212
|
+
}
|
|
213
|
+
return date1.isBefore(date2);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Lightens a hex color by a specified percentage
|
|
217
|
+
* @param color - Hex color string (with or without #)
|
|
218
|
+
* @param percent - Percentage to lighten (0-100)
|
|
219
|
+
* @returns Lightened hex color string
|
|
220
|
+
*/
|
|
221
|
+
function lightenColor(color, percent) {
|
|
222
|
+
const num = parseInt(color.replace("#", ""), 16);
|
|
223
|
+
const amt = Math.round(2.55 * percent);
|
|
224
|
+
const R = (num >> 16) + amt;
|
|
225
|
+
const G = ((num >> 8) & 0x00ff) + amt;
|
|
226
|
+
const B = (num & 0x0000ff) + amt;
|
|
227
|
+
return ("#" +
|
|
228
|
+
(0x1000000 +
|
|
229
|
+
(R < 255 ? (R < 1 ? 0 : R) : 255) * 0x10000 +
|
|
230
|
+
(G < 255 ? (G < 1 ? 0 : G) : 255) * 0x100 +
|
|
231
|
+
(B < 255 ? (B < 1 ? 0 : B) : 255))
|
|
232
|
+
.toString(16)
|
|
233
|
+
.slice(1));
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Gets formatted date with optional day offset
|
|
237
|
+
* @param dayOffset - Days to add (positive) or subtract (negative) from today (default: 0)
|
|
238
|
+
* @returns Date string in DD/MM/YYYY format
|
|
239
|
+
*/
|
|
240
|
+
function getFormattedDate(dayOffset = 0) {
|
|
241
|
+
return dayjs().add(dayOffset, "day").format("DD/MM/YYYY");
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export { calculateTotalArrayValueTotal, checkIsDateIsBefore, findMenuHierarchy, getDesiredDate, getFormattedDate, getInitials, getUsernameFromEmail, handleDownloadReactTableDataExcel, lightenColor };
|
|
@@ -54,7 +54,6 @@ export interface FormSectionPropsItem {
|
|
|
54
54
|
size?: "extrasmall" | '';
|
|
55
55
|
decimalFixedTo?: number;
|
|
56
56
|
customValidation?: (value: any) => void;
|
|
57
|
-
FormCell?: React.ReactNode;
|
|
58
57
|
}
|
|
59
58
|
export type VariantProps = "standard" | "outlined" | "";
|
|
60
59
|
export interface FormRenderProps {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormInterface.d.ts","sourceRoot":"","sources":["../../../src/lib/Interface/FormInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,cAAc,GAAG,KAAK,CAAC;CACtC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EACL,MAAM,GACN,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,WAAW,GACX,SAAS,GACT,iBAAiB,GACjB,YAAY,GACZ,iBAAiB,GACjB,aAAa,GACb,aAAa,GACb,MAAM,GACN,WAAW,GACX,UAAU,GACV,aAAa,GACb,SAAS,GACT,OAAO,GACP,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,aAAa,GACb,UAAU,GACV,QAAQ,GACR,EAAE,CAAC;IACP,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,QA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4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./
|
|
1
|
+
export { calculateTotalArrayValueTotal, checkIsDateIsBefore, findMenuHierarchy, getDesiredDate, getFormattedDate, getInitials, getUsernameFromEmail, handleDownloadReactTableDataExcel, lightenColor, } from "./Constants/FunctionConstants";
|
|
2
|
+
export * from "./Constants/FormConstants";
|
|
3
|
+
export * from "./Interface/FormInterface";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,iCAAiC,EACjC,YAAY,GACb,MAAM,+BAA+B,CAAC;AAGvC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { calculateTotalArrayValueTotal, checkIsDateIsBefore, findMenuHierarchy, getDesiredDate, getFormattedDate, getInitials, getUsernameFromEmail, handleDownloadReactTableDataExcel, lightenColor } from './Constants/FunctionConstants.js';
|
|
2
|
+
export { extractDate, formatDateMonthAndYear, formatDayjsToCustomTime, parseCustomTime, renderLabel } from './Constants/FormConstants.js';
|
|
3
|
+
|
|
4
|
+
// Utility Functions - Helper functions for form operations and data manipulation
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createTheme } from '@mui/material/styles';
|
|
2
|
+
|
|
3
|
+
const customTheme = createTheme({
|
|
4
|
+
breakpoints: {
|
|
5
|
+
values: {
|
|
6
|
+
xs: 0,
|
|
7
|
+
sm: 600,
|
|
8
|
+
md: 900,
|
|
9
|
+
lg: 1200,
|
|
10
|
+
xl: 1536,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
typography: {},
|
|
14
|
+
palette: {
|
|
15
|
+
// primary: {
|
|
16
|
+
// // main: 'linear-gradient(135deg, #6379c3 0%, #546ee5 60%)',
|
|
17
|
+
// },
|
|
18
|
+
// secondary: {
|
|
19
|
+
// main: 'linear-gradient(135deg, #6379c3 0%, #546ee5 60%)',
|
|
20
|
+
// },
|
|
21
|
+
},
|
|
22
|
+
components: {
|
|
23
|
+
MuiInputLabel: {
|
|
24
|
+
styleOverrides: {
|
|
25
|
+
root: {
|
|
26
|
+
fontSize: "12px",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
MuiInputBase: {
|
|
31
|
+
styleOverrides: {
|
|
32
|
+
root: {
|
|
33
|
+
fontSize: "12px",
|
|
34
|
+
input: {
|
|
35
|
+
padding: "6.38px 14px",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
MuiRadio: {
|
|
41
|
+
styleOverrides: {
|
|
42
|
+
root: {
|
|
43
|
+
padding: "4px 4px 0 8px",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
MuiSelect: {
|
|
48
|
+
styleOverrides: {
|
|
49
|
+
select: {
|
|
50
|
+
padding: "6.38px 32px 6.38px 14px",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
MuiButton: {
|
|
55
|
+
styleOverrides: {
|
|
56
|
+
root: {
|
|
57
|
+
textTransform: "none",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export { customTheme, customTheme as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as Yup from 'yup';
|
|
2
|
+
|
|
3
|
+
// Common validation schemas
|
|
4
|
+
const emailSchema = Yup
|
|
5
|
+
.string()
|
|
6
|
+
.email("Please enter a valid email address")
|
|
7
|
+
.required("Email is required");
|
|
8
|
+
const passwordSchema = Yup
|
|
9
|
+
.string()
|
|
10
|
+
.min(8, "Password must be at least 8 characters")
|
|
11
|
+
.matches(/[A-Z]/, "Password must contain at least one uppercase letter")
|
|
12
|
+
.matches(/[a-z]/, "Password must contain at least one lowercase letter")
|
|
13
|
+
.matches(/[0-9]/, "Password must contain at least one number")
|
|
14
|
+
.required("Password is required");
|
|
15
|
+
const phoneSchema = Yup
|
|
16
|
+
.string()
|
|
17
|
+
.matches(/^[+]?[1-9][\d]{0,15}$/, "Please enter a valid phone number")
|
|
18
|
+
.required("Phone number is required");
|
|
19
|
+
const requiredStringSchema = Yup
|
|
20
|
+
.string()
|
|
21
|
+
.required("This field is required");
|
|
22
|
+
const optionalStringSchema = Yup.string();
|
|
23
|
+
const numberSchema = Yup
|
|
24
|
+
.number()
|
|
25
|
+
.typeError("Please enter a valid number")
|
|
26
|
+
.required("This field is required");
|
|
27
|
+
const optionalNumberSchema = Yup
|
|
28
|
+
.number()
|
|
29
|
+
.typeError("Please enter a valid number");
|
|
30
|
+
const dateSchema = Yup
|
|
31
|
+
.date()
|
|
32
|
+
.typeError("Please enter a valid date")
|
|
33
|
+
.required("Date is required");
|
|
34
|
+
const urlSchema = Yup
|
|
35
|
+
.string()
|
|
36
|
+
.url("Please enter a valid URL")
|
|
37
|
+
.required("URL is required");
|
|
38
|
+
// Example form schemas
|
|
39
|
+
const loginSchema = Yup.object({
|
|
40
|
+
email: emailSchema,
|
|
41
|
+
password: Yup.string().required("Password is required"),
|
|
42
|
+
});
|
|
43
|
+
const registrationSchema = Yup.object({
|
|
44
|
+
firstName: requiredStringSchema,
|
|
45
|
+
lastName: requiredStringSchema,
|
|
46
|
+
email: emailSchema,
|
|
47
|
+
password: passwordSchema,
|
|
48
|
+
confirmPassword: Yup
|
|
49
|
+
.string()
|
|
50
|
+
.oneOf([Yup.ref("password")], "Passwords must match")
|
|
51
|
+
.required("Please confirm your password"),
|
|
52
|
+
});
|
|
53
|
+
const contactSchema = Yup.object({
|
|
54
|
+
name: requiredStringSchema,
|
|
55
|
+
email: emailSchema,
|
|
56
|
+
phone: phoneSchema.optional(),
|
|
57
|
+
message: requiredStringSchema,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export { contactSchema, dateSchema, emailSchema, loginSchema, numberSchema, optionalNumberSchema, optionalStringSchema, passwordSchema, phoneSchema, registrationSchema, requiredStringSchema, urlSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tp-react-elements-dev",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.22",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "React form components library built with React Hook Form and Yup",
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"import": "./dist/index.
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
13
|
"require": "./dist/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./lib/*": {
|
|
16
|
-
"import": "./dist/lib
|
|
17
|
-
"require": "./dist/lib
|
|
16
|
+
"import": "./dist/lib/*",
|
|
17
|
+
"require": "./dist/lib/*"
|
|
18
18
|
},
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"publish:beta": "npm publish --tag beta",
|
|
59
59
|
"publish:auto": "npm run build:publish && npm publish",
|
|
60
60
|
"install-peers": "npm install react-hook-form@^7.62.0 @mui/material@^7.3.1 @mui/icons-material@^7.3.1 @emotion/react@^11.14.0 @emotion/styled@^11.14.1 @mui/x-date-pickers@^8.10.2 @hookform/error-message@^2.0.1 @hookform/resolvers@^5.2.1 crypto-js@^4.2.0 date-fns@^4.1.0 dayjs@^1.11.13 file-saver@^2.0.5 jodit@^4.6.2 jodit-react@^5.2.19 react-idle-timer@^5.7.2 xlsx-js-style@^1.2.0 yup@^1.7.0",
|
|
61
|
-
"// install-peers": "Note: React and React-DOM are not included as they're typically already installed by the consuming project (Vite, CRA, etc.)"
|
|
61
|
+
"// install-peers": "Note: React and React-DOM are not included as they're typically already installed by the consuming project (Vite, CRA, etc.)",
|
|
62
|
+
"package-build": "rollup -c --bundleConfigAsCjs"
|
|
62
63
|
},
|
|
63
64
|
"peerDependencies": {
|
|
64
65
|
"@emotion/react": ">=11.14.0 <13.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormConstants.d.ts","sourceRoot":"","sources":["../../../src/Utilities/Constants/FormConstants.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE3E,eAAO,MAAM,WAAW,GAAI,SAAS,YAAY,EAAE,OAAO,eAAe,EAAC,YAAU,OAAa,oDAM9F,CAAC;AACJ,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,GAAG,UAc/C;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,sBAYjD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,UAIrE;AAED,eAAO,MAAM,WAAW,GAAI,iBAAiB,MAAM,GAAG,GAAG,WAaxD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionConstants.d.ts","sourceRoot":"","sources":["../../../src/Utilities/Constants/FunctionConstants.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,iCAAiC,GAC5C,UAAU,MAAM,EAChB,SAAS,GAAG,EAAE,EACd,UAAS,GAAG,EAAO,EACnB,gBAAe,GAAG,EAAO,EACzB,mBAAkB,MAAmB,EACrC,cAAa,MAAiB,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QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,IAAI,CAAC,EAAC,YAAY,GAAG,EAAE,CAAC;IACxB,cAAc,CAAC,EAAC,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAC,CAAC,KAAK,EAAC,GAAG,KAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAC,KAAK,CAAC,SAAS,CAAC;CAC3B;AACD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,EAAE,CAAC;AACxD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,EAAE,GAAG,CAAC;IACf,WAAW,EAAE,GAAG,CAAC;IACjB,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { calculateTotalArrayValueTotal, checkIsDateIsBefore, findMenuHierarchy, getDesiredDate, getFormattedDate, getInitials, getUsernameFromEmail, handleDownloadReactTableDataExcel, lightenColor, } from "./Constants/FunctionConstants";
|
|
2
|
-
export * from "./Constants/FormConstants";
|
|
3
|
-
export * from "./Interface/FormInterface";
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Utilities/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,iCAAiC,EACjC,YAAY,GACb,MAAM,+BAA+B,CAAC;AAGvC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,2BAA2B,CAAC"}
|
package/dist/index.esm.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*{box-sizing:border-box}.m-form__input .prestashop-switch.switch{display:block;height:30px;position:relative;width:160px}.m-form__input .prestashop-switch.switch.stactv{display:block;height:30px;position:relative;width:162px}.prestashop-switch.switch{background-color:#eee;border:1px solid #ccc;border-radius:50px;-webkit-box-shadow:inset 0 1px 4px 1px rgba(0,0,0,.15);-moz-box-shadow:inset 0 1px 4px 1px rgba(0,0,0,.15);box-shadow:inset 0 1px 4px 1px rgba(0,0,0,.15);color:#333;text-align:center}.prestashop-switch.switch *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.m-form__input .prestashop-switch.switch *{outline:0!important}.m-form__input .prestashop-switch.switch input[type=radio]{line-height:normal;margin:4px 0 0;opacity:0;position:absolute}.m-form__input .prestashop-switch.switch label,.m-form__input .prestashop-switch.switch>span{display:inline-block;line-height:30px;max-width:100%;vertical-align:middle}.m-form__input .prestashop-switch.switch label{color:#bbb;cursor:pointer;float:left;font-size:11px;font-weight:400;height:100%;margin:0;position:relative;text-align:center;text-transform:uppercase;-webkit-transition:color .2s ease-out;-o-transition:color .2s ease-out;transition:color .2s ease-out;width:50%;z-index:2}.m-form__input .prestashop-switch.switch input:checked+label{color:#fff}.m-form__input .prestashop-switch.switch a,.m-form__input .prestashop-switch.switch span span{display:none}.m-form__input .prestashop-switch.switch a{background-color:green;border:1px solid green;border-radius:50px;-webkit-box-shadow:inset -1px 0 green;-moz-box-shadow:inset 0 -1px 0 green;box-shadow:inset 0 -1px 0 green;color:#fff;display:block;height:100%;left:0;padding:0;position:absolute;top:0;-webkit-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;width:50%;z-index:1}.m-form__input{align-items:center;display:flex}.m-form__input .prestashop-switch.switch input:last-of-type:checked~a{background-color:#ec5c29;border:1px solid #fb561c;-webkit-box-shadow:inset 0 -1px 0 #fb561c;-moz-box-shadow:inset 0 -1px 0 #fb561c;box-shadow:inset 0 -1px 0 #fb561c;left:50%}#list-component{background-color:#fff;max-height:200px;overflow:auto!important}#list-component #MuiScrol-listbox{max-height:none!important;overflow:visible}.css-k2lwa0,.css-svpvcz-MuiFormLabel-root-MuiInputLabel-root{background:#fff;font-size:14px!important}
|