tp-react-elements-dev 0.1.0 → 0.3.0
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/Form/FormConstants.d.ts +17 -0
- package/dist/components/Form/FormRender.d.ts +2 -2
- package/dist/components/Form/FormRenderWrapper.d.ts +3 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +139 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +139 -13
- package/dist/index.js.map +1 -1
- package/dist/styles/theme.d.ts +9 -0
- package/dist/theme.d.ts +10 -0
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormSectionPropsItem } from "./FormRender";
|
|
2
|
+
import * as Yup from "yup";
|
|
3
|
+
export interface InitialValues {
|
|
4
|
+
[key: string]: string | number | null;
|
|
5
|
+
}
|
|
6
|
+
export interface ValidationShape {
|
|
7
|
+
[key: string]: Yup.Schema<any>;
|
|
8
|
+
}
|
|
9
|
+
declare const useFormValidatingContext: (formArray: FormSectionPropsItem[]) => {
|
|
10
|
+
validationSchema: Yup.ObjectSchema<{
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
}, Yup.AnyObject, {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
}, "">;
|
|
15
|
+
initialValues: InitialValues;
|
|
16
|
+
};
|
|
17
|
+
export default useFormValidatingContext;
|
|
@@ -7,7 +7,7 @@ interface OptionsProps {
|
|
|
7
7
|
export interface FormSectionPropsItem {
|
|
8
8
|
name: string;
|
|
9
9
|
label: string;
|
|
10
|
-
inputType:
|
|
10
|
+
inputType: "text" | "password" | "number" | "select" | "datepicker" | "multiselect" | "select-v2" | "register-number" | "decimal" | "alpha-numerical" | "datepicker" | "yearpicker" | "dateRangePicker" | "monthpicker" | "multiselect" | "file" | "textarea";
|
|
11
11
|
options?: OptionsProps[];
|
|
12
12
|
required?: boolean;
|
|
13
13
|
errorMessage?: string;
|
|
@@ -30,5 +30,5 @@ export interface FormRenderProps {
|
|
|
30
30
|
clearErrors: any;
|
|
31
31
|
setValue: any;
|
|
32
32
|
}
|
|
33
|
-
declare const RenderForm: (props: FormRenderProps) => import("react/jsx-runtime").JSX.Element
|
|
33
|
+
declare const RenderForm: (props: FormRenderProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
export default RenderForm;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FormSectionPropsItem } from "./FormRender";
|
|
2
|
+
import { FieldValues, UseFormReturn } from "react-hook-form";
|
|
2
3
|
export interface FormRenderWrapperProps {
|
|
3
4
|
formArray: FormSectionPropsItem[];
|
|
4
5
|
name: string;
|
|
5
|
-
setFormFunctions: any;
|
|
6
6
|
numberOfColumns?: number;
|
|
7
|
+
form: UseFormReturn<FieldValues, any, undefined>;
|
|
7
8
|
}
|
|
8
|
-
declare const FormRenderWrapper: ({ formArray, name,
|
|
9
|
+
declare const FormRenderWrapper: ({ formArray, name, numberOfColumns, form, }: FormRenderWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default FormRenderWrapper;
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rs-picker-default .rs-picker-toggle.rs-btn{padding-bottom:7px;padding-top:7px;width:282px}.rs-picker-default .rs-picker-toggle{border:1px solid #e5e5ea;color:#575757;cursor:pointer;display:inline-block;outline:none;padding-left:44px;padding-right:67px;position:relative;z-index:5}.rs-picker-toggle-caret{color:#8e8e93;display:inline-block;font-weight:400;margin-right:240px;position:absolute;right:12px;top:8px}.rs-picker-toolbar-right-btn-ok{background-color:#3498ff;border:none;border-radius:30px;color:#fff;cursor:pointer;font-size:14px;outline:0;padding:8px 12px;text-align:center;width:100px}.rs-picker-menu .rs-calendar .rs-calendar-table-cell-content{border-radius:21px;display:inline-block;padding-left:0;padding-right:0}.css-1xisk3n{background:#ebf4f8!important}.css-xpa0r5-MuiButtonBase-root-MuiIconButton-root{border-radius:4px!important}.calender h6,.calender p{font-size:11px!important}.calender .css-1fre31j,.calender .css-1j13ek9-MuiGrid-root{padding:0}
|
|
1
|
+
.rs-picker-default .rs-picker-toggle.rs-btn{padding-bottom:7px;padding-top:7px;width:282px}.rs-picker-default .rs-picker-toggle{border:1px solid #e5e5ea;color:#575757;cursor:pointer;display:inline-block;outline:none;padding-left:44px;padding-right:67px;position:relative;z-index:5}.rs-picker-toggle-caret{color:#8e8e93;display:inline-block;font-weight:400;margin-right:240px;position:absolute;right:12px;top:8px}.rs-picker-toolbar-right-btn-ok{background-color:#3498ff;border:none;border-radius:30px;color:#fff;cursor:pointer;font-size:14px;outline:0;padding:8px 12px;text-align:center;width:100px}.rs-picker-menu .rs-calendar .rs-calendar-table-cell-content{border-radius:21px;display:inline-block;padding-left:0;padding-right:0}.css-1xisk3n{background:#ebf4f8!important}.css-xpa0r5-MuiButtonBase-root-MuiIconButton-root{border-radius:4px!important}.calender h6,.calender p{font-size:11px!important}@import "../assets/fonts/icon/flaticon_hvc.css";@font-face{font-display:swap;font-family:Roboto-Reg;src:url(../../assets/fonts/roboto-regular-webfont.woff) format("woff")}@font-face{font-display:swap;font-family:Roboto-Med;src:url(../../assets/fonts/roboto-medium-webfont.woff) format("woff")}@font-face{font-display:swap;font-family:Roboto;src:url(../../assets/fonts/roboto-bold-webfont.woff) format("woff")}*,.calender .css-1fre31j,.calender .css-1j13ek9-MuiGrid-root{padding:0}*{box-sizing:border-box;margin:0}html{background:#f8f8f8;height:100vh}body{background:#f8f8f8!important;font-family:Roboto;overflow-x:hidden}.MuiAccordionSummary-expandIconWrapper{color:#fff!important}.MuiAccordionSummary-root.Mui-expanded{min-height:40px!important}.MuiAccordionSummary-content.Mui-expanded{margin:0!important}.MuiAccordionSummary-content.Mui-expanded div{margin:12px 0!important}.action_icons{display:none}.list_action:hover .action_icons{background:#fff;border-radius:10px;box-shadow:0 0 10px #7f7f7f;-moz-column-count:2;column-count:2;display:block;left:60px;list-style-type:none;margin-top:-20px;padding:10px;position:absolute;top:auto 12px;z-index:110}.action_icons:hover{display:flex;flex-direction:column}.action_icons li{align-items:center;color:#0a8fdc;cursor:pointer;display:flex;line-height:1;padding:5px 0}.action_icons li:hover{color:#266c9a;text-decoration:underline}.action_icons li svg{font-size:16px;margin-right:10px}.product-table thead tr{background:#edf3f7}.product-table thead tr th:nth-child(4){width:120px}.product-table thead tr th:nth-child(7){width:50px}.product-table thead tr th:nth-child(6){width:100px}.product-table thead tr th:nth-child(2){width:60px}.product-table thead tr th:nth-child(3){width:100px}.product-table thead tr th:nth-child(5){width:125px}.product-table thead tr th:nth-child(10),.product-table thead tr th:nth-child(8),.product-table thead tr th:nth-child(9){width:100px}.product-table thead tr th:nth-child(11){width:90px}.product-table thead tr th:nth-child(12){width:80px}.product-table thead tr th:nth-child(13){width:100px}.product-table thead tr th:nth-child(14){width:50px}.product-table thead tr th:nth-child(16){width:120px}.product-table thead tr th:nth-child(15){width:60px}.product-table thead tr th:nth-child(17){width:130px}.product-table thead tr th:first-child{width:50px}.product-table thead tr th:last-child{width:60px}.MuiButton-root{box-shadow:none!important}.description-card{height:100%}.danger-badge{color:#dc3545}.danger-badge,.success-badge{border-radius:10px;display:inline-block;padding:2px 14px}.success-badge{color:#198754}.menu-wrapper p{color:#fff!important}.menu-item-wrapper:hover h6,.menu-item-wrapper:hover p,.menu-item-wrapper:hover svg,.menu-wrapper .second-level-wrapper p{color:#000!important}.css-12qr4rk-MuiTableCell-root{font-size:11px;padding:16px 0 16px 14px!important}@keyframes loader__wrapper{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}.loader__wrapper{backface-visibility:hidden;height:100%;position:relative;transform:translateZ(0) scale(.64);transform-origin:0 0;width:100%}.loader__wrapper div{animation:loader__wrapper 1s linear infinite;border:10px solid #00adff;border-radius:50%;border-top-color:#0000;box-sizing:initial;height:60px;left:50px;position:absolute;top:50px;width:60px}.loader{background:#0000;display:block;height:64px;margin:0 auto;overflow:hidden;width:64px}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Button } from "./components/Button/Button";
|
|
2
|
-
export { default as RenderForm } from "./components/Form/
|
|
2
|
+
export { default as RenderForm } from "./components/Form/FormRenderWrapper";
|
package/dist/index.esm.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rs-picker-default .rs-picker-toggle.rs-btn{padding-bottom:7px;padding-top:7px;width:282px}.rs-picker-default .rs-picker-toggle{border:1px solid #e5e5ea;color:#575757;cursor:pointer;display:inline-block;outline:none;padding-left:44px;padding-right:67px;position:relative;z-index:5}.rs-picker-toggle-caret{color:#8e8e93;display:inline-block;font-weight:400;margin-right:240px;position:absolute;right:12px;top:8px}.rs-picker-toolbar-right-btn-ok{background-color:#3498ff;border:none;border-radius:30px;color:#fff;cursor:pointer;font-size:14px;outline:0;padding:8px 12px;text-align:center;width:100px}.rs-picker-menu .rs-calendar .rs-calendar-table-cell-content{border-radius:21px;display:inline-block;padding-left:0;padding-right:0}.css-1xisk3n{background:#ebf4f8!important}.css-xpa0r5-MuiButtonBase-root-MuiIconButton-root{border-radius:4px!important}.calender h6,.calender p{font-size:11px!important}.calender .css-1fre31j,.calender .css-1j13ek9-MuiGrid-root{padding:0}
|
|
1
|
+
.rs-picker-default .rs-picker-toggle.rs-btn{padding-bottom:7px;padding-top:7px;width:282px}.rs-picker-default .rs-picker-toggle{border:1px solid #e5e5ea;color:#575757;cursor:pointer;display:inline-block;outline:none;padding-left:44px;padding-right:67px;position:relative;z-index:5}.rs-picker-toggle-caret{color:#8e8e93;display:inline-block;font-weight:400;margin-right:240px;position:absolute;right:12px;top:8px}.rs-picker-toolbar-right-btn-ok{background-color:#3498ff;border:none;border-radius:30px;color:#fff;cursor:pointer;font-size:14px;outline:0;padding:8px 12px;text-align:center;width:100px}.rs-picker-menu .rs-calendar .rs-calendar-table-cell-content{border-radius:21px;display:inline-block;padding-left:0;padding-right:0}.css-1xisk3n{background:#ebf4f8!important}.css-xpa0r5-MuiButtonBase-root-MuiIconButton-root{border-radius:4px!important}.calender h6,.calender p{font-size:11px!important}@import "../assets/fonts/icon/flaticon_hvc.css";@font-face{font-display:swap;font-family:Roboto-Reg;src:url(../../assets/fonts/roboto-regular-webfont.woff) format("woff")}@font-face{font-display:swap;font-family:Roboto-Med;src:url(../../assets/fonts/roboto-medium-webfont.woff) format("woff")}@font-face{font-display:swap;font-family:Roboto;src:url(../../assets/fonts/roboto-bold-webfont.woff) format("woff")}*,.calender .css-1fre31j,.calender .css-1j13ek9-MuiGrid-root{padding:0}*{box-sizing:border-box;margin:0}html{background:#f8f8f8;height:100vh}body{background:#f8f8f8!important;font-family:Roboto;overflow-x:hidden}.MuiAccordionSummary-expandIconWrapper{color:#fff!important}.MuiAccordionSummary-root.Mui-expanded{min-height:40px!important}.MuiAccordionSummary-content.Mui-expanded{margin:0!important}.MuiAccordionSummary-content.Mui-expanded div{margin:12px 0!important}.action_icons{display:none}.list_action:hover .action_icons{background:#fff;border-radius:10px;box-shadow:0 0 10px #7f7f7f;-moz-column-count:2;column-count:2;display:block;left:60px;list-style-type:none;margin-top:-20px;padding:10px;position:absolute;top:auto 12px;z-index:110}.action_icons:hover{display:flex;flex-direction:column}.action_icons li{align-items:center;color:#0a8fdc;cursor:pointer;display:flex;line-height:1;padding:5px 0}.action_icons li:hover{color:#266c9a;text-decoration:underline}.action_icons li svg{font-size:16px;margin-right:10px}.product-table thead tr{background:#edf3f7}.product-table thead tr th:nth-child(4){width:120px}.product-table thead tr th:nth-child(7){width:50px}.product-table thead tr th:nth-child(6){width:100px}.product-table thead tr th:nth-child(2){width:60px}.product-table thead tr th:nth-child(3){width:100px}.product-table thead tr th:nth-child(5){width:125px}.product-table thead tr th:nth-child(10),.product-table thead tr th:nth-child(8),.product-table thead tr th:nth-child(9){width:100px}.product-table thead tr th:nth-child(11){width:90px}.product-table thead tr th:nth-child(12){width:80px}.product-table thead tr th:nth-child(13){width:100px}.product-table thead tr th:nth-child(14){width:50px}.product-table thead tr th:nth-child(16){width:120px}.product-table thead tr th:nth-child(15){width:60px}.product-table thead tr th:nth-child(17){width:130px}.product-table thead tr th:first-child{width:50px}.product-table thead tr th:last-child{width:60px}.MuiButton-root{box-shadow:none!important}.description-card{height:100%}.danger-badge{color:#dc3545}.danger-badge,.success-badge{border-radius:10px;display:inline-block;padding:2px 14px}.success-badge{color:#198754}.menu-wrapper p{color:#fff!important}.menu-item-wrapper:hover h6,.menu-item-wrapper:hover p,.menu-item-wrapper:hover svg,.menu-wrapper .second-level-wrapper p{color:#000!important}.css-12qr4rk-MuiTableCell-root{font-size:11px;padding:16px 0 16px 14px!important}@keyframes loader__wrapper{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}.loader__wrapper{backface-visibility:hidden;height:100%;position:relative;transform:translateZ(0) scale(.64);transform-origin:0 0;width:100%}.loader__wrapper div{animation:loader__wrapper 1s linear infinite;border:10px solid #00adff;border-radius:50%;border-top-color:#0000;box-sizing:initial;height:60px;left:50px;position:absolute;top:50px;width:60px}.loader{background:#0000;display:block;height:64px;margin:0 auto;overflow:hidden;width:64px}
|
package/dist/index.esm.js
CHANGED
|
@@ -4935,6 +4935,41 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
4935
4935
|
ThemeContext$1.displayName = 'EmotionThemeContext';
|
|
4936
4936
|
}
|
|
4937
4937
|
|
|
4938
|
+
var getTheme = function getTheme(outerTheme, theme) {
|
|
4939
|
+
if (typeof theme === 'function') {
|
|
4940
|
+
var mergedTheme = theme(outerTheme);
|
|
4941
|
+
|
|
4942
|
+
if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {
|
|
4943
|
+
throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
|
|
4944
|
+
}
|
|
4945
|
+
|
|
4946
|
+
return mergedTheme;
|
|
4947
|
+
}
|
|
4948
|
+
|
|
4949
|
+
if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {
|
|
4950
|
+
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
|
|
4951
|
+
}
|
|
4952
|
+
|
|
4953
|
+
return _extends$1({}, outerTheme, theme);
|
|
4954
|
+
};
|
|
4955
|
+
|
|
4956
|
+
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
|
|
4957
|
+
return weakMemoize(function (theme) {
|
|
4958
|
+
return getTheme(outerTheme, theme);
|
|
4959
|
+
});
|
|
4960
|
+
});
|
|
4961
|
+
var ThemeProvider = function ThemeProvider(props) {
|
|
4962
|
+
var theme = React$1.useContext(ThemeContext$1);
|
|
4963
|
+
|
|
4964
|
+
if (props.theme !== theme) {
|
|
4965
|
+
theme = createCacheWithTheme(theme)(props.theme);
|
|
4966
|
+
}
|
|
4967
|
+
|
|
4968
|
+
return /*#__PURE__*/React$1.createElement(ThemeContext$1.Provider, {
|
|
4969
|
+
value: theme
|
|
4970
|
+
}, props.children);
|
|
4971
|
+
};
|
|
4972
|
+
|
|
4938
4973
|
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
|
4939
4974
|
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
|
|
4940
4975
|
|
|
@@ -40568,7 +40603,7 @@ default_1$3 = ArrowDropDownSharp.default = (0, _createSvgIcon$3.default)( /*#__P
|
|
|
40568
40603
|
d: "m7 10 5 5 5-5z"
|
|
40569
40604
|
}), 'ArrowDropDownSharp');
|
|
40570
40605
|
|
|
40571
|
-
styled$1(Grid)(({ theme }) => ({
|
|
40606
|
+
const FormComponent = styled$1(Grid)(({ theme }) => ({
|
|
40572
40607
|
alignItems: 'flex-start',
|
|
40573
40608
|
flexWrap: 'wrap',
|
|
40574
40609
|
[theme.breakpoints.down('md')]: {
|
|
@@ -40584,7 +40619,7 @@ styled$1(Box)(({ theme }) => ({
|
|
|
40584
40619
|
boxShadow: '0 1px 15px rgba(0,0,0,.04), 0 1px 6px rgba(0,0,0,.04)',
|
|
40585
40620
|
borderRadius: '0.75rem'
|
|
40586
40621
|
}));
|
|
40587
|
-
styled$1(Grid, {
|
|
40622
|
+
const Formitem = styled$1(Grid, {
|
|
40588
40623
|
shouldForwardProp: prop => prop !== 'isActive' && prop !== 'noOfColumn'
|
|
40589
40624
|
})(({ theme, noOfColumn }) => ({
|
|
40590
40625
|
width: `calc(100%/${noOfColumn})`,
|
|
@@ -45703,6 +45738,7 @@ const DateRangePickerComponent = ({ props }) => {
|
|
|
45703
45738
|
setOpen(false);
|
|
45704
45739
|
}
|
|
45705
45740
|
}, [props.getValues('ToDate')]);
|
|
45741
|
+
console.log(props.getValues('ToDate'), 'props.getValues');
|
|
45706
45742
|
console.log(props.getValues('FromDate'), props.getValues('FromDate'), 'from date range picker');
|
|
45707
45743
|
const value = props.getValues('FromDate') && props.getValues('ToDate')
|
|
45708
45744
|
? `${props.getValues('FromDate')} - ${props.getValues('ToDate')}`
|
|
@@ -45713,7 +45749,7 @@ const DateRangePickerComponent = ({ props }) => {
|
|
|
45713
45749
|
"& .css-1holvmy, .css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
|
|
45714
45750
|
top: "-10px",
|
|
45715
45751
|
},
|
|
45716
|
-
} }, { children: [jsxRuntimeExports.jsx(TextField, { label: props.item.label, value: value, className: "read-only", inputRef: textRef, sx: { width: '100%', '& input': { cursor: 'pointer' } }, onClick: () => {
|
|
45752
|
+
} }, { children: [jsxRuntimeExports.jsx(TextField, { label: props.item.label, value: value || null, className: "read-only", inputRef: textRef, sx: { width: '100%', '& input': { cursor: 'pointer' } }, onClick: () => {
|
|
45717
45753
|
setOpen(true);
|
|
45718
45754
|
} }), open && (jsxRuntimeExports.jsx(Box, Object.assign({ sx: {
|
|
45719
45755
|
position: "absolute",
|
|
@@ -49975,7 +50011,7 @@ const PasswordField = ({ props }) => {
|
|
|
49975
50011
|
const handleTogglePasswordVisibility = () => {
|
|
49976
50012
|
setShowPassword((prevShowPassword) => !prevShowPassword);
|
|
49977
50013
|
};
|
|
49978
|
-
return (jsxRuntimeExports.jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [" ", jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Box, Object.assign({ sx: { position:
|
|
50014
|
+
return (jsxRuntimeExports.jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [" ", jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Box, Object.assign({ sx: { position: "relative" } }, { children: [" ", jsxRuntimeExports.jsx(TextField, Object.assign({ size: "small", type: showPassword ? "text" : "password" }, field, { label: props.item.label, sx: {
|
|
49979
50015
|
width: "100%",
|
|
49980
50016
|
"& .css-kichxs-MuiFormLabel-root-MuiInputLabel-root,.css-1holvmy": {
|
|
49981
50017
|
top: "-8px",
|
|
@@ -49985,7 +50021,17 @@ const PasswordField = ({ props }) => {
|
|
|
49985
50021
|
right: "14px",
|
|
49986
50022
|
top: "50%",
|
|
49987
50023
|
transform: "translateY(-50%)",
|
|
49988
|
-
}, "aria-label": "toggle password visibility", onClick: handleTogglePasswordVisibility, edge: "end" }, { children: showPassword ? (jsxRuntimeExports.jsx(Visibility, { sx: {
|
|
50024
|
+
}, "aria-label": "toggle password visibility", onClick: handleTogglePasswordVisibility, edge: "end" }, { children: showPassword ? (jsxRuntimeExports.jsx(Visibility, { sx: {
|
|
50025
|
+
fontSize: "12px",
|
|
50026
|
+
position: "absolute",
|
|
50027
|
+
top: "22%",
|
|
50028
|
+
right: 10,
|
|
50029
|
+
} })) : (jsxRuntimeExports.jsx(VisibilityOff, { sx: {
|
|
50030
|
+
fontSize: "12px",
|
|
50031
|
+
position: "absolute",
|
|
50032
|
+
top: "22%",
|
|
50033
|
+
right: 10,
|
|
50034
|
+
} })) }))] })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) })] })));
|
|
49989
50035
|
};
|
|
49990
50036
|
|
|
49991
50037
|
const Monthpickerrender = ({ props }) => {
|
|
@@ -50084,7 +50130,7 @@ const DatepickerWrapperV2 = ({ props }) => {
|
|
|
50084
50130
|
// onFocus: () => inputTextRef.current?.blur(),
|
|
50085
50131
|
},
|
|
50086
50132
|
}, sx: {
|
|
50087
|
-
"& .css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root,.css-zy8vme,.css-1holvmy": {
|
|
50133
|
+
"& .css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root,.css-zy8vme,.css-1holvmy,.css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
|
|
50088
50134
|
top: "-10px !important",
|
|
50089
50135
|
},
|
|
50090
50136
|
"& input:hover": {
|
|
@@ -50185,7 +50231,7 @@ const RenderForm = (props) => {
|
|
|
50185
50231
|
},
|
|
50186
50232
|
},
|
|
50187
50233
|
// classes={{ option: { color: "red !important" } }}
|
|
50188
|
-
value: field.value || "", disabled: props.item.disable })), ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.helperText) && (jsxRuntimeExports.jsxs("span", Object.assign({ style: {
|
|
50234
|
+
value: field.value || "", size: "small", disabled: props.item.disable })), ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.helperText) && (jsxRuntimeExports.jsxs("span", Object.assign({ style: {
|
|
50189
50235
|
fontFamily: "Roboto-Reg",
|
|
50190
50236
|
fontSize: "11px",
|
|
50191
50237
|
color: "#3651d3",
|
|
@@ -50200,7 +50246,9 @@ const RenderForm = (props) => {
|
|
|
50200
50246
|
border: "none",
|
|
50201
50247
|
},
|
|
50202
50248
|
}, onInput: (e) => {
|
|
50203
|
-
e.target.value = e.target.value
|
|
50249
|
+
e.target.value = e.target.value
|
|
50250
|
+
.replace(/\s/g, "")
|
|
50251
|
+
.replace(/[^a-zA-Z0-9!@#$%^&*()_+{}\[\]:;<>,.?/~`|\\-]/g, "");
|
|
50204
50252
|
}, sx: {
|
|
50205
50253
|
fontFamily: "Roboto-Reg",
|
|
50206
50254
|
"& .css-1holvmy,.css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root, .css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
|
|
@@ -50244,10 +50292,11 @@ const RenderForm = (props) => {
|
|
|
50244
50292
|
// );
|
|
50245
50293
|
case "number":
|
|
50246
50294
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => {
|
|
50247
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({}, field, { label: props.item.label, value: props.getValues(props.item.name) || "", defaultValue: props.getValues(props.item.name) || null, onInput: (e) => {
|
|
50295
|
+
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({}, field, { size: "small", label: props.item.label, value: props.getValues(props.item.name) || "", defaultValue: props.getValues(props.item.name) || null, onInput: (e) => {
|
|
50248
50296
|
var _a, _b;
|
|
50249
50297
|
e.target.value = e.target.value.replace(/[^0-9]/g, "");
|
|
50250
|
-
((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.onChangeFn) &&
|
|
50298
|
+
((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.onChangeFn) &&
|
|
50299
|
+
((_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.onChangeFn(e.target.value));
|
|
50251
50300
|
(props === null || props === void 0 ? void 0 : props.clearErrors) && (props === null || props === void 0 ? void 0 : props.clearErrors(props.item.name));
|
|
50252
50301
|
}, sx: {
|
|
50253
50302
|
"& .css-1holvmy,.css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root,.css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
|
|
@@ -50493,11 +50542,11 @@ const RenderForm = (props) => {
|
|
|
50493
50542
|
},
|
|
50494
50543
|
}, label: props.item.label, views: ["year"], value: dayjs(field.value), onChange: (date) => field.onChange(date), slots: {
|
|
50495
50544
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50496
|
-
textField: (textFieldProps) => jsxRuntimeExports.jsx(TextField, Object.assign({}, textFieldProps, { fullWidth: true, disabled: props.item.disable || false, InputLabelProps: {
|
|
50545
|
+
textField: (textFieldProps) => (jsxRuntimeExports.jsx(TextField, Object.assign({}, textFieldProps, { fullWidth: true, disabled: props.item.disable || false, InputLabelProps: {
|
|
50497
50546
|
shrink: true,
|
|
50498
50547
|
}, error: props.errors, inputProps: {
|
|
50499
50548
|
min: props.item.minDate,
|
|
50500
|
-
} }))
|
|
50549
|
+
} }))),
|
|
50501
50550
|
} }) })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }) }));
|
|
50502
50551
|
case "dateRangePicker":
|
|
50503
50552
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(DateRangePickerComponent, { props: props }) }));
|
|
@@ -50616,8 +50665,85 @@ const RenderForm = (props) => {
|
|
|
50616
50665
|
// </ErrorMessageComponent>
|
|
50617
50666
|
// </>
|
|
50618
50667
|
// );
|
|
50668
|
+
default:
|
|
50669
|
+
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
50670
|
+
}
|
|
50671
|
+
};
|
|
50672
|
+
|
|
50673
|
+
const customTheme = createTheme({
|
|
50674
|
+
breakpoints: {
|
|
50675
|
+
values: {
|
|
50676
|
+
xs: 0,
|
|
50677
|
+
sm: 600,
|
|
50678
|
+
md: 900,
|
|
50679
|
+
lg: 1200,
|
|
50680
|
+
xl: 1536,
|
|
50681
|
+
},
|
|
50682
|
+
},
|
|
50683
|
+
typography: {
|
|
50684
|
+
fontFamily: 'Roboto-Reg'
|
|
50685
|
+
},
|
|
50686
|
+
palette: {
|
|
50687
|
+
// primary: {
|
|
50688
|
+
// // main: 'linear-gradient(135deg, #6379c3 0%, #546ee5 60%)',
|
|
50689
|
+
// },
|
|
50690
|
+
// secondary: {
|
|
50691
|
+
// main: 'linear-gradient(135deg, #6379c3 0%, #546ee5 60%)',
|
|
50692
|
+
// },
|
|
50693
|
+
},
|
|
50694
|
+
components: {
|
|
50695
|
+
MuiInputLabel: {
|
|
50696
|
+
styleOverrides: {
|
|
50697
|
+
root: {
|
|
50698
|
+
fontSize: '12px',
|
|
50699
|
+
},
|
|
50700
|
+
},
|
|
50701
|
+
},
|
|
50702
|
+
MuiInputBase: {
|
|
50703
|
+
styleOverrides: {
|
|
50704
|
+
root: {
|
|
50705
|
+
fontSize: '12px',
|
|
50706
|
+
input: {
|
|
50707
|
+
padding: '6.38px 14px',
|
|
50708
|
+
}
|
|
50709
|
+
}
|
|
50710
|
+
}
|
|
50711
|
+
},
|
|
50712
|
+
MuiRadio: {
|
|
50713
|
+
styleOverrides: {
|
|
50714
|
+
root: {
|
|
50715
|
+
padding: '4px 4px 0 8px'
|
|
50716
|
+
}
|
|
50717
|
+
}
|
|
50718
|
+
},
|
|
50719
|
+
MuiSelect: {
|
|
50720
|
+
styleOverrides: {
|
|
50721
|
+
select: {
|
|
50722
|
+
padding: '6.38px 32px 6.38px 14px'
|
|
50723
|
+
}
|
|
50724
|
+
}
|
|
50725
|
+
},
|
|
50726
|
+
MuiButton: {
|
|
50727
|
+
styleOverrides: {
|
|
50728
|
+
root: {
|
|
50729
|
+
fontFamily: 'Roboto-Reg',
|
|
50730
|
+
textTransform: 'none'
|
|
50731
|
+
}
|
|
50732
|
+
}
|
|
50733
|
+
}
|
|
50619
50734
|
}
|
|
50735
|
+
});
|
|
50736
|
+
|
|
50737
|
+
const FormRenderWrapper = ({ formArray, name, numberOfColumns = 3, form, }) => {
|
|
50738
|
+
// const formContext=useFormControl({
|
|
50739
|
+
// })
|
|
50740
|
+
// useEffect(() => {
|
|
50741
|
+
// // form.reset(initialValues, { resolver: yupResolver(validationSchema) });
|
|
50742
|
+
// }, [formArray, validationSchema, initialValues]);
|
|
50743
|
+
return (jsxRuntimeExports.jsx(ThemeProvider, Object.assign({ theme: customTheme }, { children: jsxRuntimeExports.jsx(FormComponent, Object.assign({ container: true, margin: "auto" }, { children: formArray.map((item, i) => {
|
|
50744
|
+
return (jsxRuntimeExports.jsx(Formitem, Object.assign({ container: true, sx: item.CustomProps, noOfColumn: item.numberOfColumns || numberOfColumns }, { children: jsxRuntimeExports.jsx(RenderForm, { item: item, register: form.register, control: form.control, errors: form.formState.errors, getValues: form.getValues, clearErrors: form.clearErrors, setValue: form.setValue }) }), i));
|
|
50745
|
+
}) })) })));
|
|
50620
50746
|
};
|
|
50621
50747
|
|
|
50622
|
-
export { Button$1 as Button, RenderForm };
|
|
50748
|
+
export { Button$1 as Button, FormRenderWrapper as RenderForm };
|
|
50623
50749
|
//# sourceMappingURL=index.esm.js.map
|