drf-react-by-schema 0.20.1 → 0.20.2
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/api.d.ts.map +1 -1
- package/dist/api.js +1 -2
- package/dist/components/Image.d.ts +10 -0
- package/dist/components/Image.d.ts.map +1 -0
- package/dist/components/Image.js +109 -0
- package/dist/components/details/DetailFieldBySchema.d.ts.map +1 -1
- package/dist/components/details/DetailFieldBySchema.js +3 -1
- package/dist/components/forms/DialogFormBySchema.d.ts +4 -2
- package/dist/components/forms/DialogFormBySchema.d.ts.map +1 -1
- package/dist/components/forms/DialogFormBySchema.js +1 -1
- package/dist/components/forms/FormBySchema.d.ts +1 -1
- package/dist/components/forms/FormBySchema.d.ts.map +1 -1
- package/dist/components/forms/FormBySchema.js +15 -18
- package/dist/context/APIWrapper.d.ts.map +1 -1
- package/dist/context/APIWrapper.js +3 -3
- package/dist/styles/layout.d.ts +21 -114
- package/dist/styles/layout.d.ts.map +1 -1
- package/dist/styles/layout.js +8 -6
- package/package.json +1 -1
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAEL,IAAI,EACJ,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EAErB,EAAE,EAGF,eAAe,EAEf,mBAAmB,EACnB,wBAAwB,EAEzB,MAAM,UAAU,CAAC;AAMlB,UAAU,yBAAyB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,IAAI,EAAE,IAAI,CAAC;IACX,EAAE,CAAC,EAAE,EAAE,CAAC;IACR,WAAW,CAAC,EAAE,kBAAkB,GAAG,qBAAqB,CAAC;CAC1D;AAyFD,eAAO,MAAM,UAAU,GAAU,2BAG9B;IACD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AgB,cAAc,GAAG,IAAI,iBA+C7E,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAU,oNAkBvC,wBAAwB,2CA2H1B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,8DAMnC;IACD,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,EAAE,CAAC,EAAE,EAAE,CAAC;IACR,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,2CA8BA,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,gBAAgB,cAAc,GAAG,IAAI,iBASvE,CAAC"}
|
package/dist/api.js
CHANGED
|
@@ -479,7 +479,6 @@ const prepareDataBySchemaRecursive = ({ data, schema }) => {
|
|
|
479
479
|
};
|
|
480
480
|
const prepareDataBySchema = ({ data, schema }) => {
|
|
481
481
|
const { data: preparedData, requiresMultipart } = prepareDataBySchemaRecursive({ data, schema });
|
|
482
|
-
console.log({ preparedData, formData: (0, utils_1.convertToFormData)(preparedData) });
|
|
483
482
|
return {
|
|
484
483
|
data: requiresMultipart ? (0, utils_1.convertToFormData)(preparedData) : preparedData,
|
|
485
484
|
contentType: requiresMultipart
|
|
@@ -833,7 +832,7 @@ const getGenericModel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ mod
|
|
|
833
832
|
return false;
|
|
834
833
|
}
|
|
835
834
|
let data = {};
|
|
836
|
-
if (id && (!relatedModel || (relatedModel && relatedModelId))) {
|
|
835
|
+
if (!(0, utils_1.isTmpId)(id) && (!relatedModel || (relatedModel && relatedModelId))) {
|
|
837
836
|
const response = yield getData({ path, serverEndPoint });
|
|
838
837
|
if (!('isAxiosError' in response)) {
|
|
839
838
|
data = response;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
interface ImageModalProps {
|
|
4
|
+
src: string;
|
|
5
|
+
alt: string;
|
|
6
|
+
sx?: SxProps<Theme>;
|
|
7
|
+
}
|
|
8
|
+
declare const Image: React.FC<ImageModalProps>;
|
|
9
|
+
export default Image;
|
|
10
|
+
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAOL,OAAO,EACP,KAAK,EACN,MAAM,eAAe,CAAC;AAGvB,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACrB;AAED,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4GpC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const material_1 = require("@mui/material");
|
|
41
|
+
const Expand_1 = __importDefault(require("@mui/icons-material/Expand"));
|
|
42
|
+
const Image = ({ src, alt, sx = {} }) => {
|
|
43
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
44
|
+
const theme = (0, material_1.useTheme)();
|
|
45
|
+
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('sm'));
|
|
46
|
+
const handleOpen = () => setOpen(true);
|
|
47
|
+
const handleClose = () => setOpen(false);
|
|
48
|
+
// Styled component for the image container
|
|
49
|
+
const ImageContainer = (0, material_1.styled)(material_1.Box)(() => ({
|
|
50
|
+
position: 'relative',
|
|
51
|
+
display: 'inline-block',
|
|
52
|
+
'&:hover .expand-button': {
|
|
53
|
+
opacity: 1,
|
|
54
|
+
},
|
|
55
|
+
}));
|
|
56
|
+
// Styled component for the expand button
|
|
57
|
+
const ExpandButton = (0, material_1.styled)(material_1.IconButton)(({ theme }) => (Object.assign({ position: 'absolute', bottom: theme.spacing(1), right: theme.spacing(1), backgroundColor: theme.palette.background.paper, opacity: 0.7, transition: 'opacity 0.3s', '&:hover': {
|
|
58
|
+
backgroundColor: theme.palette.background.paper,
|
|
59
|
+
opacity: 1,
|
|
60
|
+
} }, (isMobile && {
|
|
61
|
+
opacity: 1,
|
|
62
|
+
backgroundColor: theme.palette.background.paper + '!important',
|
|
63
|
+
}))));
|
|
64
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
65
|
+
react_1.default.createElement(ImageContainer, { onClick: handleOpen, sx: sx },
|
|
66
|
+
react_1.default.createElement("img", { src: src, alt: alt, style: {
|
|
67
|
+
width: '100%',
|
|
68
|
+
height: 'auto',
|
|
69
|
+
display: 'block',
|
|
70
|
+
cursor: 'pointer',
|
|
71
|
+
borderRadius: theme.shape.borderRadius,
|
|
72
|
+
} }),
|
|
73
|
+
react_1.default.createElement(ExpandButton, { className: "expand-button", "aria-label": "expand image", size: "small", onClick: (e) => {
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
handleOpen();
|
|
76
|
+
} },
|
|
77
|
+
react_1.default.createElement(Expand_1.default, { fontSize: isMobile ? 'medium' : 'small' }))),
|
|
78
|
+
react_1.default.createElement(material_1.Modal, { open: open, onClose: handleClose, sx: {
|
|
79
|
+
display: 'flex',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'center',
|
|
82
|
+
p: isMobile ? 1 : 2,
|
|
83
|
+
} },
|
|
84
|
+
react_1.default.createElement(material_1.Box, { sx: {
|
|
85
|
+
position: 'relative',
|
|
86
|
+
maxWidth: isMobile ? '100%' : '90vw',
|
|
87
|
+
maxHeight: isMobile ? '100%' : '90vh',
|
|
88
|
+
outline: 'none',
|
|
89
|
+
} },
|
|
90
|
+
react_1.default.createElement("img", { src: src, alt: alt, style: {
|
|
91
|
+
maxWidth: '100%',
|
|
92
|
+
maxHeight: isMobile ? 'calc(100vh - 32px)' : 'calc(90vh - 32px)',
|
|
93
|
+
display: 'block',
|
|
94
|
+
borderRadius: theme.shape.borderRadius,
|
|
95
|
+
} }),
|
|
96
|
+
react_1.default.createElement(material_1.IconButton, { onClick: handleClose, sx: {
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
top: theme.spacing(1),
|
|
99
|
+
right: theme.spacing(1),
|
|
100
|
+
backgroundColor: theme.palette.background.paper,
|
|
101
|
+
opacity: 0.7,
|
|
102
|
+
'&:hover': {
|
|
103
|
+
backgroundColor: theme.palette.background.paper,
|
|
104
|
+
opacity: 1,
|
|
105
|
+
},
|
|
106
|
+
}, size: isMobile ? 'medium' : 'small' },
|
|
107
|
+
react_1.default.createElement(Expand_1.default, { sx: { transform: 'rotate(45deg)' } }))))));
|
|
108
|
+
};
|
|
109
|
+
exports.default = Image;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailFieldBySchema.d.ts","sourceRoot":"","sources":["../../../src/components/details/DetailFieldBySchema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DetailFieldBySchema.d.ts","sourceRoot":"","sources":["../../../src/components/details/DetailFieldBySchema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAMxD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,KAAK,EACL,WAAW,EACX,OAAO,EACP,OAAO,EACP,OAAO,EACP,WAAW,EACX,eAAe,EACf,mBAAmB,GACpB,EAAE,wBAAwB,qBAgI1B"}
|
|
@@ -13,6 +13,8 @@ const ListItemText_1 = __importDefault(require("@mui/material/ListItemText"));
|
|
|
13
13
|
const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
14
14
|
const Download_1 = __importDefault(require("@mui/icons-material/Download"));
|
|
15
15
|
const DRFReactBySchemaContext_1 = require("../../context/DRFReactBySchemaContext");
|
|
16
|
+
const styles_1 = require("../../styles");
|
|
17
|
+
const Image_1 = __importDefault(require("../Image"));
|
|
16
18
|
function DetailFieldBySchema({ value, fieldSchema, sxField, sxLabel, sxValue, sxValueList, sxValueListItem, sxValueListItemText, }) {
|
|
17
19
|
const { serverEndPoint } = (0, DRFReactBySchemaContext_1.useDRFReactBySchema)();
|
|
18
20
|
switch (fieldSchema.type) {
|
|
@@ -51,7 +53,7 @@ function DetailFieldBySchema({ value, fieldSchema, sxField, sxLabel, sxValue, sx
|
|
|
51
53
|
case 'image upload':
|
|
52
54
|
return (react_1.default.createElement(Box_1.default, { sx: sxField },
|
|
53
55
|
react_1.default.createElement(Typography_1.default, { variant: "h5", sx: sxLabel }, value.title),
|
|
54
|
-
react_1.default.createElement(
|
|
56
|
+
react_1.default.createElement(Image_1.default, { sx: styles_1.Layout.detailFieldImg, src: `${serverEndPoint === null || serverEndPoint === void 0 ? void 0 : serverEndPoint.url}${value.value.url}`, alt: value.valueStr }),
|
|
55
57
|
react_1.default.createElement(Typography_1.default, { variant: "body2", sx: sxValue },
|
|
56
58
|
react_1.default.createElement(Button_1.default, { href: `${serverEndPoint === null || serverEndPoint === void 0 ? void 0 : serverEndPoint.url}${value.value.url}`, target: "_blank", variant: "contained", startIcon: react_1.default.createElement(Download_1.default, null) }, value.valueStr))));
|
|
57
59
|
default:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnyObjectSchema } from 'yup';
|
|
3
|
-
import { FormFieldLayout, Item, SchemaType } from '../../@types';
|
|
3
|
+
import { FormFieldLayout, Item, OptionsAC, SchemaType } from '../../@types';
|
|
4
4
|
import { DialogType } from '../../context/APIWrapperContext';
|
|
5
5
|
interface DialogFormBySchemaProps {
|
|
6
6
|
schema: SchemaType;
|
|
@@ -12,7 +12,9 @@ interface DialogFormBySchemaProps {
|
|
|
12
12
|
fieldsLayout?: FormFieldLayout[];
|
|
13
13
|
isCancelDisabled?: boolean;
|
|
14
14
|
forceSaveEnabled?: boolean;
|
|
15
|
+
optionsAC: OptionsAC | null;
|
|
16
|
+
setOptionsAC: (x: Partial<OptionsAC>) => void;
|
|
15
17
|
}
|
|
16
|
-
export default function DialogFormBySchema({ schema, validationSchema, initialValues, onEditModelSave, setDialog, getAutoComplete, fieldsLayout, isCancelDisabled, forceSaveEnabled, }: DialogFormBySchemaProps): React.JSX.Element;
|
|
18
|
+
export default function DialogFormBySchema({ schema, validationSchema, initialValues, onEditModelSave, setDialog, getAutoComplete, fieldsLayout, isCancelDisabled, forceSaveEnabled, optionsAC, setOptionsAC, }: DialogFormBySchemaProps): React.JSX.Element;
|
|
17
19
|
export {};
|
|
18
20
|
//# sourceMappingURL=DialogFormBySchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogFormBySchema.d.ts","sourceRoot":"","sources":["../../../src/components/forms/DialogFormBySchema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAKtC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DialogFormBySchema.d.ts","sourceRoot":"","sources":["../../../src/components/forms/DialogFormBySchema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAKtC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,UAAU,uBAAuB;IAC/B,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,eAAe,CAAC;IAClC,aAAa,EAAE,IAAI,CAAC;IACpB,eAAe,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC5C,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;IAC5D,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;CAC/C;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,SAAS,EACT,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,YAAY,GACb,EAAE,uBAAuB,qBAmEzB"}
|
|
@@ -44,7 +44,7 @@ const Box_1 = __importDefault(require("@mui/material/Box"));
|
|
|
44
44
|
const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
45
45
|
const styles_1 = require("../../styles");
|
|
46
46
|
const FormBySchema_1 = __importDefault(require("./FormBySchema"));
|
|
47
|
-
function DialogFormBySchema({ schema, validationSchema, initialValues, onEditModelSave, setDialog, getAutoComplete, fieldsLayout, isCancelDisabled, forceSaveEnabled, }) {
|
|
47
|
+
function DialogFormBySchema({ schema, validationSchema, initialValues, onEditModelSave, setDialog, getAutoComplete, fieldsLayout, isCancelDisabled, forceSaveEnabled, optionsAC, setOptionsAC, }) {
|
|
48
48
|
const { control, handleSubmit, reset, getValues, setValue, formState: { errors, isDirty }, } = (0, react_hook_form_1.useForm)({
|
|
49
49
|
mode: 'onBlur',
|
|
50
50
|
resolver: (0, yup_1.yupResolver)(validationSchema),
|
|
@@ -13,6 +13,6 @@ interface FormBySchemaProps extends Omit<FieldBySchemaProps, 'name'> {
|
|
|
13
13
|
relatedEditable?: boolean;
|
|
14
14
|
autoFocusField?: string;
|
|
15
15
|
}
|
|
16
|
-
export default function FormBySchema({ schema, control, errors, register, multiline, setValue, getValues, fieldKey, labelKey, index, optionsAC, setOptionsAC, forceReload, optionsModel, getOptionLabel, renderOption, onEditModel, options, isSemaphoric, label, decimalScale, fieldsLayout: fieldsLayoutInitial, customFieldFormLayouts, fieldsProps, hiddenFields, isolatedGetAutoComplete, relatedEditable, autoFocusField, }: FormBySchemaProps): React.JSX.Element;
|
|
16
|
+
export default function FormBySchema({ schema, control, errors, register, multiline, setValue, getValues, fieldKey, labelKey, index, optionsAC, setOptionsAC, forceReload, optionsModel, getOptionLabel, renderOption, onEditModel: customOnEditModel, options, isSemaphoric, label, decimalScale, fieldsLayout: fieldsLayoutInitial, customFieldFormLayouts, fieldsProps, hiddenFields, isolatedGetAutoComplete, relatedEditable, autoFocusField, }: FormBySchemaProps): React.JSX.Element;
|
|
17
17
|
export {};
|
|
18
18
|
//# sourceMappingURL=FormBySchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBySchema.d.ts","sourceRoot":"","sources":["../../../src/components/forms/FormBySchema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AASlD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,IAAI,EACJ,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,UAAU,iBAAkB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAClE,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IAC3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,IAAI,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAiB,EACjB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,QAAiB,EACjB,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EACP,YAAoB,EACpB,KAAK,EACL,YAAgB,EAEhB,YAAY,EAAE,mBAAmB,EACjC,sBAAsB,EAEtB,WAAW,EACX,YAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,cAAc,GACf,EAAE,iBAAiB,qBAwQnB"}
|
|
@@ -55,11 +55,10 @@ const CircularProgress_1 = __importDefault(require("@mui/material/CircularProgre
|
|
|
55
55
|
const FieldBySchema_1 = __importDefault(require("./FieldBySchema"));
|
|
56
56
|
const styles_1 = require("../../styles");
|
|
57
57
|
const APIWrapperContext_1 = require("../../context/APIWrapperContext");
|
|
58
|
-
function FormBySchema({ schema, control, errors, register, multiline = false, setValue, getValues, fieldKey, labelKey = 'nome', index, optionsAC, setOptionsAC, forceReload, optionsModel, getOptionLabel, renderOption, onEditModel, options, isSemaphoric = false, label, decimalScale = 2, fieldsLayout: fieldsLayoutInitial, customFieldFormLayouts, fieldsProps, hiddenFields = [], isolatedGetAutoComplete, relatedEditable, autoFocusField, }) {
|
|
59
|
-
const { getAutoComplete, onEditModel: defaultOnEditModel } = (0, APIWrapperContext_1.useAPIWrapper)();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
58
|
+
function FormBySchema({ schema, control, errors, register, multiline = false, setValue, getValues, fieldKey, labelKey = 'nome', index, optionsAC, setOptionsAC, forceReload, optionsModel, getOptionLabel, renderOption, onEditModel: customOnEditModel, options, isSemaphoric = false, label, decimalScale = 2, fieldsLayout: fieldsLayoutInitial, customFieldFormLayouts, fieldsProps, hiddenFields = [], isolatedGetAutoComplete, relatedEditable, autoFocusField, }) {
|
|
59
|
+
const { getAutoComplete: defaulGetAutoComplete, onEditModel: defaultOnEditModel, optionsAC: externalOptionsAC, } = (0, APIWrapperContext_1.useAPIWrapper)();
|
|
60
|
+
const getAutoComplete = isolatedGetAutoComplete || defaulGetAutoComplete;
|
|
61
|
+
const onEditModel = relatedEditable === false ? undefined : customOnEditModel || defaultOnEditModel;
|
|
63
62
|
const [fieldsLayout, setFieldsLayout] = (0, react_1.useState)([]);
|
|
64
63
|
const [localOptionsAC, setLocalOptionsAC] = (0, react_1.useState)(undefined);
|
|
65
64
|
const defaultSx = { mr: 0 };
|
|
@@ -125,7 +124,7 @@ function FormBySchema({ schema, control, errors, register, multiline = false, se
|
|
|
125
124
|
optionsACModels.map((field) => {
|
|
126
125
|
if (!optionsAC || !(field in optionsAC)) {
|
|
127
126
|
fieldsToLoad.push(field);
|
|
128
|
-
promises.push(
|
|
127
|
+
promises.push(getAutoComplete(field));
|
|
129
128
|
}
|
|
130
129
|
});
|
|
131
130
|
const newOptionsAC = {};
|
|
@@ -146,15 +145,15 @@ function FormBySchema({ schema, control, errors, register, multiline = false, se
|
|
|
146
145
|
setFieldsLayout(newFieldsLayout);
|
|
147
146
|
populateOptionsAC(optionsACModels);
|
|
148
147
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
149
|
-
}, []);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}, [forceReload]);
|
|
148
|
+
}, [schema, externalOptionsAC]);
|
|
149
|
+
// useEffect(() => {
|
|
150
|
+
// if (forceReload) {
|
|
151
|
+
// const { newFieldsLayout, optionsACModels } = getColumns();
|
|
152
|
+
// setFieldsLayout(newFieldsLayout);
|
|
153
|
+
// populateOptionsAC(optionsACModels);
|
|
154
|
+
// }
|
|
155
|
+
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
156
|
+
// }, [forceReload]);
|
|
158
157
|
if (fieldsLayout.length === 0 ||
|
|
159
158
|
(setOptionsAC && !optionsAC) ||
|
|
160
159
|
(!setOptionsAC && !localOptionsAC)) {
|
|
@@ -177,9 +176,7 @@ function FormBySchema({ schema, control, errors, register, multiline = false, se
|
|
|
177
176
|
const fieldProps = fieldsProps && field in fieldsProps ? fieldsProps[field] : {};
|
|
178
177
|
fieldProps.sx = 'sx' in fieldProps ? fieldProps.sx : defaultSx;
|
|
179
178
|
return (react_1.default.createElement(react_1.default.Fragment, { key: field },
|
|
180
|
-
react_1.default.createElement(FieldBySchema_1.default, Object.assign({ name: field, schema: schema, control: control, errors: errors, multiline: multiline, setValue: setValue, getValues: getValues, fieldKey: fieldKey, labelKey: labelKey, index: index, optionsAC: setOptionsAC ? optionsAC : localOptionsAC, optionsModel: optionsModel, getOptionLabel: getOptionLabel, renderOption: renderOption, onEditModel:
|
|
181
|
-
? onEditModel
|
|
182
|
-
: undefined, fieldsLayout: customFieldFormLayouts && field in customFieldFormLayouts
|
|
179
|
+
react_1.default.createElement(FieldBySchema_1.default, Object.assign({ name: field, schema: schema, control: control, errors: errors, multiline: multiline, setValue: setValue, getValues: getValues, fieldKey: fieldKey, labelKey: labelKey, index: index, optionsAC: setOptionsAC ? optionsAC : localOptionsAC, optionsModel: optionsModel, getOptionLabel: getOptionLabel, renderOption: renderOption, onEditModel: onEditModel, fieldsLayout: customFieldFormLayouts && field in customFieldFormLayouts
|
|
183
180
|
? customFieldFormLayouts[field]
|
|
184
181
|
: undefined, options: options, isSemaphoric: isSemaphoric, label: label, decimalScale: decimalScale, autoFocus: autoFocusField === field || (sectionIndex === 0 && rowIndex === 0) }, fieldProps))));
|
|
185
182
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIWrapper.d.ts","sourceRoot":"","sources":["../../src/context/APIWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAwCvE,OAAO,EAEL,UAAU,EAQV,YAAY,EACb,MAAM,qBAAqB,CAAC;AAG7B,UAAU,eAAe;IACvB,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC5C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AASD,iBAAS,UAAU,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"APIWrapper.d.ts","sourceRoot":"","sources":["../../src/context/APIWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAwCvE,OAAO,EAEL,UAAU,EAQV,YAAY,EACb,MAAM,qBAAqB,CAAC;AAG7B,UAAU,eAAe;IACvB,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC5C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AASD,iBAAS,UAAU,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,eAAe,qBAmjBvF;;AAED,wBAAsC"}
|
|
@@ -217,9 +217,9 @@ function APIWrapper({ handleLoading, setSnackBar, setDialog, children }) {
|
|
|
217
217
|
const value = getValues(targetKey);
|
|
218
218
|
const newValue = Array.isArray(value)
|
|
219
219
|
? value.map((item) => {
|
|
220
|
-
return item.id ===
|
|
220
|
+
return item.id === response.id ? response : item;
|
|
221
221
|
})
|
|
222
|
-
: Object.assign(
|
|
222
|
+
: Object.assign({}, response);
|
|
223
223
|
setValue(targetKey, newValue);
|
|
224
224
|
populateOptionsAC([model]);
|
|
225
225
|
}
|
|
@@ -279,7 +279,7 @@ function APIWrapper({ handleLoading, setSnackBar, setDialog, children }) {
|
|
|
279
279
|
open: true,
|
|
280
280
|
loading: false,
|
|
281
281
|
title: 'Editar',
|
|
282
|
-
Body: (react_1.default.createElement(DialogFormBySchema_1.default, { schema: result.schema, validationSchema: yupSchema, initialValues: values, setDialog: setDialog, getAutoComplete: localGetAutoComplete, onEditModelSave: onEditModelSave, fieldsLayout: fieldsLayout, isCancelDisabled: true, forceSaveEnabled: true })),
|
|
282
|
+
Body: (react_1.default.createElement(DialogFormBySchema_1.default, { schema: result.schema, validationSchema: yupSchema, initialValues: values, setDialog: setDialog, getAutoComplete: localGetAutoComplete, onEditModelSave: onEditModelSave, fieldsLayout: fieldsLayout, isCancelDisabled: true, forceSaveEnabled: true, optionsAC: optionsAC, setOptionsAC: setOptionsAC })),
|
|
283
283
|
Actions: react_1.default.createElement(react_1.default.Fragment, null),
|
|
284
284
|
isCancelDisabled: true,
|
|
285
285
|
});
|
package/dist/styles/layout.d.ts
CHANGED
|
@@ -1,115 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export declare const topBar: {
|
|
23
|
-
width: string;
|
|
24
|
-
pl: number;
|
|
25
|
-
pr: number;
|
|
26
|
-
display: string;
|
|
27
|
-
flexDirection: string;
|
|
28
|
-
justifyContent: string;
|
|
29
|
-
alignItems: string;
|
|
30
|
-
};
|
|
31
|
-
export declare const loadingBox: {
|
|
32
|
-
height: string;
|
|
33
|
-
backgroundColor: string;
|
|
34
|
-
justifyContent: string;
|
|
35
|
-
display: string;
|
|
36
|
-
flexDirection: string;
|
|
37
|
-
alignItems: string;
|
|
38
|
-
};
|
|
39
|
-
export declare const loadingBoxWhite: {
|
|
40
|
-
height: string;
|
|
41
|
-
justifyContent: string;
|
|
42
|
-
display: string;
|
|
43
|
-
flexDirection: string;
|
|
44
|
-
alignItems: string;
|
|
45
|
-
};
|
|
46
|
-
export declare const actionButtons: {
|
|
47
|
-
width: string;
|
|
48
|
-
alignItems: string;
|
|
49
|
-
display: string;
|
|
50
|
-
flexDirection: string;
|
|
51
|
-
justifyContent: string;
|
|
52
|
-
};
|
|
53
|
-
export declare const inLineForm: {
|
|
54
|
-
width: string;
|
|
55
|
-
justifyContent: string;
|
|
56
|
-
display: string;
|
|
57
|
-
flexDirection: string;
|
|
58
|
-
alignItems: string;
|
|
59
|
-
};
|
|
60
|
-
export declare const flexColumn: {
|
|
61
|
-
flexDirection: string;
|
|
62
|
-
display: string;
|
|
63
|
-
justifyContent: string;
|
|
64
|
-
alignItems: string;
|
|
65
|
-
};
|
|
66
|
-
export declare const flexRowGrow: {
|
|
67
|
-
flexGrow: number;
|
|
68
|
-
display: string;
|
|
69
|
-
flexDirection: string;
|
|
70
|
-
justifyContent: string;
|
|
71
|
-
alignItems: string;
|
|
72
|
-
};
|
|
73
|
-
export declare const topBarOverList: {
|
|
74
|
-
mb: number;
|
|
75
|
-
flexGrow: number;
|
|
76
|
-
display: string;
|
|
77
|
-
flexDirection: string;
|
|
78
|
-
justifyContent: string;
|
|
79
|
-
alignItems: string;
|
|
80
|
-
};
|
|
81
|
-
export declare const dataGrid: {
|
|
82
|
-
height: string;
|
|
83
|
-
mt: number;
|
|
84
|
-
};
|
|
85
|
-
export declare const dataGridWithTabs: {
|
|
86
|
-
mt: number;
|
|
87
|
-
height: string;
|
|
88
|
-
};
|
|
89
|
-
export declare const dataGridFixedHeight: {
|
|
90
|
-
height: number;
|
|
91
|
-
mt: number;
|
|
92
|
-
};
|
|
93
|
-
export declare const fullWidthButton: {
|
|
94
|
-
mt: number;
|
|
95
|
-
width: string;
|
|
96
|
-
};
|
|
97
|
-
export declare const formCard: {
|
|
98
|
-
width: string;
|
|
99
|
-
backgroundColor: any;
|
|
100
|
-
mt: number;
|
|
101
|
-
mb: number;
|
|
102
|
-
};
|
|
103
|
-
export declare const formCardContent: {
|
|
104
|
-
maxHeight: number;
|
|
105
|
-
overflow: string;
|
|
106
|
-
};
|
|
107
|
-
export declare const metabaseAppEmbed: {
|
|
108
|
-
height: number;
|
|
109
|
-
};
|
|
110
|
-
export declare const geoPicker: {
|
|
111
|
-
height: number;
|
|
112
|
-
width: string;
|
|
113
|
-
mt: number;
|
|
114
|
-
};
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
export declare const content: SxProps<Theme>;
|
|
3
|
+
export declare const main: SxProps<Theme>;
|
|
4
|
+
export declare const flexRow: SxProps<Theme>;
|
|
5
|
+
export declare const topBar: SxProps<Theme>;
|
|
6
|
+
export declare const loadingBox: SxProps<Theme>;
|
|
7
|
+
export declare const loadingBoxWhite: SxProps<Theme>;
|
|
8
|
+
export declare const actionButtons: SxProps<Theme>;
|
|
9
|
+
export declare const inLineForm: SxProps<Theme>;
|
|
10
|
+
export declare const flexColumn: SxProps<Theme>;
|
|
11
|
+
export declare const flexRowGrow: SxProps<Theme>;
|
|
12
|
+
export declare const topBarOverList: SxProps<Theme>;
|
|
13
|
+
export declare const dataGrid: SxProps<Theme>;
|
|
14
|
+
export declare const dataGridWithTabs: SxProps<Theme>;
|
|
15
|
+
export declare const dataGridFixedHeight: SxProps<Theme>;
|
|
16
|
+
export declare const fullWidthButton: SxProps<Theme>;
|
|
17
|
+
export declare const formCard: SxProps<Theme>;
|
|
18
|
+
export declare const formCardContent: SxProps<Theme>;
|
|
19
|
+
export declare const metabaseAppEmbed: SxProps<Theme>;
|
|
20
|
+
export declare const geoPicker: SxProps<Theme>;
|
|
21
|
+
export declare const detailFieldImg: SxProps<Theme>;
|
|
115
22
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/styles/layout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/styles/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,KAAK,CAMlC,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,KAAK,CAG/B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,KAAK,CAKlC,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,KAAK,CAKjC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,KAAK,CAKrC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,KAAK,CAI1C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,KAAK,CAIxC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,KAAK,CAIrC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,KAAK,CAGrC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,KAAK,CAGtC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,KAAK,CAGzC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,KAAK,CAGnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,KAAK,CAG3C,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,KAAK,CAG9C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,KAAK,CAG1C,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,KAAK,CAKnC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,KAAK,CAG1C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,KAAK,CAE3C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,KAAK,CAIpC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,KAAK,CAKzC,CAAC"}
|
package/dist/styles/layout.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.geoPicker = exports.metabaseAppEmbed = exports.formCardContent = exports.formCard = exports.fullWidthButton = exports.dataGridFixedHeight = exports.dataGridWithTabs = exports.dataGrid = exports.topBarOverList = exports.flexRowGrow = exports.flexColumn = exports.inLineForm = exports.actionButtons = exports.loadingBoxWhite = exports.loadingBox = exports.topBar = exports.flexRow = exports.main = exports.content = void 0;
|
|
7
|
-
const theme_1 = __importDefault(require("./theme"));
|
|
3
|
+
exports.detailFieldImg = exports.geoPicker = exports.metabaseAppEmbed = exports.formCardContent = exports.formCard = exports.fullWidthButton = exports.dataGridFixedHeight = exports.dataGridWithTabs = exports.dataGrid = exports.topBarOverList = exports.flexRowGrow = exports.flexColumn = exports.inLineForm = exports.actionButtons = exports.loadingBoxWhite = exports.loadingBox = exports.topBar = exports.flexRow = exports.main = exports.content = void 0;
|
|
8
4
|
exports.content = {
|
|
9
5
|
flexGrow: 1,
|
|
10
6
|
pr: 3,
|
|
@@ -39,7 +35,7 @@ exports.fullWidthButton = {
|
|
|
39
35
|
};
|
|
40
36
|
exports.formCard = {
|
|
41
37
|
width: '100%',
|
|
42
|
-
backgroundColor:
|
|
38
|
+
backgroundColor: (theme) => theme.palette.formCard.main,
|
|
43
39
|
mt: 2,
|
|
44
40
|
mb: 2,
|
|
45
41
|
};
|
|
@@ -55,3 +51,9 @@ exports.geoPicker = {
|
|
|
55
51
|
width: '100%',
|
|
56
52
|
mt: 0,
|
|
57
53
|
};
|
|
54
|
+
exports.detailFieldImg = {
|
|
55
|
+
width: '100%',
|
|
56
|
+
maxWidth: 450,
|
|
57
|
+
maxHeight: 300,
|
|
58
|
+
overflow: 'hidden',
|
|
59
|
+
};
|
package/package.json
CHANGED