drf-react-by-schema 0.17.17 → 0.18.1

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.
Files changed (67) hide show
  1. package/dist/api.d.ts +17 -16
  2. package/dist/api.js +28 -28
  3. package/dist/components/DataGridBySchemaEditable/BooleanInputCell.d.ts +0 -1
  4. package/dist/components/DataGridBySchemaEditable/BooleanInputCell.js +1 -2
  5. package/dist/components/DataGridBySchemaEditable/ConfirmDialog.d.ts +1 -1
  6. package/dist/components/DataGridBySchemaEditable/CustomToolbar.d.ts +2 -2
  7. package/dist/components/DataGridBySchemaEditable/CustomToolbar.js +17 -7
  8. package/dist/components/DataGridBySchemaEditable/FooterToolbar.d.ts +2 -2
  9. package/dist/components/DataGridBySchemaEditable/GridDateInput.d.ts +2 -2
  10. package/dist/components/DataGridBySchemaEditable/GridDecimalInput.d.ts +2 -2
  11. package/dist/components/DataGridBySchemaEditable/GridPatternInput.d.ts +2 -2
  12. package/dist/components/DataGridBySchemaEditable/InputInterval.d.ts +4 -4
  13. package/dist/components/DataGridBySchemaEditable/InputInterval.js +17 -7
  14. package/dist/components/DataGridBySchemaEditable/SelectEditInputCell.d.ts +0 -1
  15. package/dist/components/DataGridBySchemaEditable/SelectEditInputCell.js +21 -9
  16. package/dist/components/DataGridBySchemaEditable/utils.d.ts +1 -2
  17. package/dist/components/DataGridBySchemaEditable/utils.js +2 -2
  18. package/dist/components/DataGridBySchemaEditable.js +24 -14
  19. package/dist/components/DataTotals.d.ts +2 -2
  20. package/dist/components/DataTotalsServer.d.ts +2 -2
  21. package/dist/components/DialogActions.d.ts +1 -1
  22. package/dist/components/DialogActions.js +1 -1
  23. package/dist/components/FormButtons.d.ts +1 -1
  24. package/dist/components/FormButtons.js +1 -1
  25. package/dist/components/GenericModelList.d.ts +2 -2
  26. package/dist/components/GenericModelList.js +17 -7
  27. package/dist/components/GenericRelatedModelList.d.ts +2 -2
  28. package/dist/components/GenericRelatedModelList.js +18 -8
  29. package/dist/components/details/DetailBySchema.d.ts +2 -2
  30. package/dist/components/details/DetailBySchema.js +18 -8
  31. package/dist/components/details/DetailFieldBySchema.d.ts +2 -2
  32. package/dist/components/details/DetailFieldBySchema.js +1 -1
  33. package/dist/components/forms/DialogFormBySchema.d.ts +4 -2
  34. package/dist/components/forms/DialogFormBySchema.js +22 -12
  35. package/dist/components/forms/FieldBySchema.d.ts +2 -2
  36. package/dist/components/forms/FieldBySchema.js +8 -8
  37. package/dist/components/forms/FormBySchema.d.ts +2 -2
  38. package/dist/components/forms/FormBySchema.js +21 -10
  39. package/dist/components/forms/inputs/AutocompleteFieldBySchema.d.ts +2 -2
  40. package/dist/components/forms/inputs/AutocompleteFieldBySchema.js +3 -3
  41. package/dist/components/forms/inputs/BooleanFieldBySchema.d.ts +2 -2
  42. package/dist/components/forms/inputs/BooleanFieldBySchema.js +3 -3
  43. package/dist/components/forms/inputs/DesktopDatePickerBySchema.d.ts +2 -2
  44. package/dist/components/forms/inputs/DesktopDatePickerBySchema.js +3 -2
  45. package/dist/components/forms/inputs/DesktopDateTimePickerBySchema.d.ts +2 -2
  46. package/dist/components/forms/inputs/DesktopDateTimePickerBySchema.js +3 -2
  47. package/dist/components/forms/inputs/EditableAutocompleteFieldBySchema.d.ts +2 -1
  48. package/dist/components/forms/inputs/EditableAutocompleteFieldBySchema.js +23 -10
  49. package/dist/components/forms/inputs/FloatFieldBySchema.d.ts +2 -2
  50. package/dist/components/forms/inputs/FloatFieldBySchema.js +3 -3
  51. package/dist/components/forms/inputs/TextFieldBySchema.d.ts +2 -2
  52. package/dist/components/forms/inputs/TextFieldBySchema.js +3 -3
  53. package/dist/context/APIWrapper.d.ts +1 -1
  54. package/dist/context/APIWrapper.js +28 -15
  55. package/dist/context/APIWrapperContext.d.ts +2 -0
  56. package/dist/context/DRFReactBySchemaProvider.d.ts +1 -1
  57. package/dist/context/Form.d.ts +1 -1
  58. package/dist/context/Overlays.d.ts +1 -1
  59. package/dist/context/Overlays.js +19 -9
  60. package/dist/styles/index.js +17 -7
  61. package/dist/styles/layout.d.ts +1 -1
  62. package/dist/styles/theme.d.ts +1 -1
  63. package/dist/utils.d.ts +8 -6
  64. package/dist/utils.js +21 -11
  65. package/package.json +1 -1
  66. package/dist/components/DialogJSONSchemaForm.d.ts +0 -13
  67. package/dist/components/DialogJSONSchemaForm.js +0 -20
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { SumRowsType } from '../utils';
3
3
  interface DataTotalsServerProps {
4
4
  sumRows?: SumRowsType;
5
5
  totals?: null | Record<string, number>;
6
6
  }
7
- declare const DataTotalsServer: ({ sumRows, totals }: DataTotalsServerProps) => JSX.Element;
7
+ declare const DataTotalsServer: ({ sumRows, totals }: DataTotalsServerProps) => React.JSX.Element;
8
8
  export default DataTotalsServer;
@@ -6,5 +6,5 @@ interface DialogActionsProps {
6
6
  btnCancel?: string;
7
7
  btnConfirm?: string;
8
8
  }
9
- export default function DialogActions({ setDialog, handleSave, btnCancel, btnConfirm, }: DialogActionsProps): JSX.Element;
9
+ export default function DialogActions({ setDialog, handleSave, btnCancel, btnConfirm, }: DialogActionsProps): React.JSX.Element;
10
10
  export {};
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = DialogActions;
6
7
  const react_1 = __importDefault(require("react"));
7
8
  const Button_1 = __importDefault(require("@mui/material/Button"));
8
9
  function DialogActions({ setDialog, handleSave, btnCancel = 'Cancelar', btnConfirm = 'Salvar', }) {
@@ -12,4 +13,3 @@ function DialogActions({ setDialog, handleSave, btnCancel = 'Cancelar', btnConfi
12
13
  } }, btnCancel),
13
14
  handleSave && react_1.default.createElement(Button_1.default, { onClick: handleSave }, btnConfirm)));
14
15
  }
15
- exports.default = DialogActions;
@@ -17,5 +17,5 @@ interface FormButtonsProps {
17
17
  saveAndContinue?: boolean;
18
18
  sx?: any;
19
19
  }
20
- export default function FormButtons({ model, objId, title, formDisabled, cancelBtn, cancelBtnLabel, deleteBtnLabel, saveAndCreateNewBtnLabel, saveAndContinueBtnLabel, saveBtnLabel, onSuccess, bottom, borderBottom, saveAndContinue, sx }: FormButtonsProps): JSX.Element;
20
+ export default function FormButtons({ model, objId, title, formDisabled, cancelBtn, cancelBtnLabel, deleteBtnLabel, saveAndCreateNewBtnLabel, saveAndContinueBtnLabel, saveBtnLabel, onSuccess, bottom, borderBottom, saveAndContinue, sx }: FormButtonsProps): React.JSX.Element;
21
21
  export {};
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = FormButtons;
6
7
  const react_1 = __importDefault(require("react"));
7
8
  const Box_1 = __importDefault(require("@mui/material/Box"));
8
9
  const Button_1 = __importDefault(require("@mui/material/Button"));
@@ -40,4 +41,3 @@ function FormButtons({ model, objId, title, formDisabled, cancelBtn, cancelBtnLa
40
41
  react_1.default.createElement(Button_1.default, { variant: "contained", name: "stayOnSave", type: "submit", color: "secondary", size: "small", sx: { ml: 1 }, disabled: formDisabled }, saveAndContinueBtnLabel)),
41
42
  react_1.default.createElement(Button_1.default, { variant: "contained", name: "exitOnSave", type: "submit", color: "primary", size: "small", sx: { ml: 1 }, disabled: formDisabled }, saveBtnLabel))));
42
43
  }
43
- exports.default = FormButtons;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { GridFilterModel, GridRenderCellParams } from '@mui/x-data-grid';
3
3
  import { GridEnrichedBySchemaColDef, ActionType, Item, OnSelectActions, OptionsAC, FormFieldLayout, CustomAction, SumRowsType } from '../utils';
4
4
  interface GenericModelListProps {
@@ -38,5 +38,5 @@ interface GenericModelListProps {
38
38
  disableScreenLoading?: boolean;
39
39
  extraValidators?: Item;
40
40
  }
41
- declare const GenericModelList: ({ model, columnFields, hiddenFields, creatableFields, disabledFields, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, onProcessRow, reloadAfterRowUpdate, customColumnOperations, customFieldFormLayouts, customLinkDestination, isEditable, hasBulkSelect, onSelectActions, sumRows, isAutoHeight, forceReload, LinkComponent, hasHeader, paginationMode, defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, customActions, optionsAC, defaultValues, disableScreenLoading, extraValidators, }: GenericModelListProps) => JSX.Element;
41
+ declare const GenericModelList: ({ model, columnFields, hiddenFields, creatableFields, disabledFields, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, onProcessRow, reloadAfterRowUpdate, customColumnOperations, customFieldFormLayouts, customLinkDestination, isEditable, hasBulkSelect, onSelectActions, sumRows, isAutoHeight, forceReload, LinkComponent, hasHeader, paginationMode, defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, customActions, optionsAC, defaultValues, disableScreenLoading, extraValidators, }: GenericModelListProps) => React.JSX.Element;
42
42
  export default GenericModelList;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { GridFilterModel } from '@mui/x-data-grid';
3
3
  import { ActionType, GridEnrichedBySchemaColDef, Id, Item, OnSelectActions, OptionsAC, SumRowsType } from '../utils';
4
4
  interface GenericRelatedModelListProps {
@@ -38,5 +38,5 @@ interface GenericRelatedModelListProps {
38
38
  LinkComponent?: any | null;
39
39
  extraValidators?: Item;
40
40
  }
41
- export default function GenericRelatedModelList({ model, id, relatedModel, columnFields, hiddenFields, creatableFields, disabledFields, usuaria, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, label, onProcessRow, reloadAfterRowUpdate, customColumnOperations, isEditable, hasBulkSelect, onSelectActions, sumRows, isAutoHeight, isInBatches, noCardWrapper, paginationMode, defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, optionsAC, defaultValues, LinkComponent, extraValidators, }: GenericRelatedModelListProps): JSX.Element;
41
+ export default function GenericRelatedModelList({ model, id, relatedModel, columnFields, hiddenFields, creatableFields, disabledFields, usuaria, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, label, onProcessRow, reloadAfterRowUpdate, customColumnOperations, isEditable, hasBulkSelect, onSelectActions, sumRows, isAutoHeight, isInBatches, noCardWrapper, paginationMode, defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, optionsAC, defaultValues, LinkComponent, extraValidators, }: GenericRelatedModelListProps): React.JSX.Element;
42
42
  export {};
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,6 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.default = GenericRelatedModelList;
38
49
  const react_1 = __importStar(require("react"));
39
50
  const Box_1 = __importDefault(require("@mui/material/Box"));
40
51
  const Card_1 = __importDefault(require("@mui/material/Card"));
@@ -163,4 +174,3 @@ function GenericRelatedModelList({ model, id, relatedModel, columnFields, hidden
163
174
  react_1.default.createElement(CardContent_1.default, null,
164
175
  react_1.default.createElement(ContentTable, { data: data, relatedModel: relatedModel, model: model, loading: loading, id: id, indexField: indexField || '', indexFieldBasePath: indexFieldBasePath, indexFieldViewBasePath: indexFieldViewBasePath, addExistingModel: addExistingModel, isEditable: isEditable, hasBulkSelect: hasBulkSelect, onSelectActions: onSelectActions, onEditModel: onEditModel, onDeleteRelatedModel: onDeleteRelatedModel, finalCustomColumnOperations: finalCustomColumnOperations, setVisibleRows: setVisibleRows, isAutoHeight: isAutoHeight, tableAutoHeight: tableAutoHeight, hideFooterPagination: hideFooterPagination, hideFooterComponent: hideFooterComponent, hideToolbarComponent: hideToolbarComponent, onProcessRow: onProcessRow, onDataChange: onDataChange, sumRows: sumRows, visibleRows: visibleRows, paginationMode: paginationMode, paginationModel: paginationModel, setPaginationModel: setPaginationModel, actions: actions, optionsAC: optionsAC, defaultValues: defaultValues, LinkComponent: LinkComponent, extraValidators: extraValidators }))))))));
165
176
  }
166
- exports.default = GenericRelatedModelList;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { DetailBySchemaProps } from '../../utils';
3
- export default function DetailBySchema({ values, schema, editLink, editLabel, labelKey, decimalScale, fieldsLayout: fieldsLayoutInitial, fieldsProps, sxRow, sxRowMultiple, sxField, sxLabel, sxValue, sxValueList, sxValueListItem, sxValueListItemText, }: DetailBySchemaProps): JSX.Element;
3
+ export default function DetailBySchema({ values, schema, editLink, editLabel, labelKey, decimalScale, fieldsLayout: fieldsLayoutInitial, fieldsProps, sxRow, sxRowMultiple, sxField, sxLabel, sxValue, sxValueList, sxValueListItem, sxValueListItemText, }: DetailBySchemaProps): React.JSX.Element;
@@ -15,17 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.default = DetailBySchema;
29
40
  const react_1 = __importStar(require("react"));
30
41
  const Box_1 = __importDefault(require("@mui/material/Box"));
31
42
  const Card_1 = __importDefault(require("@mui/material/Card"));
@@ -95,4 +106,3 @@ function DetailBySchema({ values, schema, editLink, editLabel, labelKey = 'label
95
106
  }))))));
96
107
  })));
97
108
  }
98
- exports.default = DetailBySchema;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { DetailFieldBySchemaProps } from '../../utils';
3
- export default function DetailFieldBySchema({ name, value, schema, labelKey, optionIdKey, optionLabelKey, sxField, sxLabel, sxValue, sxValueList, sxValueListItem, sxValueListItemText, }: DetailFieldBySchemaProps): JSX.Element;
3
+ export default function DetailFieldBySchema({ name, value, schema, labelKey, optionIdKey, optionLabelKey, sxField, sxLabel, sxValue, sxValueList, sxValueListItem, sxValueListItemText, }: DetailFieldBySchemaProps): React.JSX.Element;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = DetailFieldBySchema;
6
7
  const react_1 = __importDefault(require("react"));
7
8
  const moment_1 = __importDefault(require("moment"));
8
9
  const Typography_1 = __importDefault(require("@mui/material/Typography"));
@@ -71,4 +72,3 @@ function DetailFieldBySchema({ name, value, schema, labelKey = 'label', optionId
71
72
  react_1.default.createElement(Typography_1.default, { variant: "body2", sx: sxValue }, value)));
72
73
  }
73
74
  }
74
- exports.default = DetailFieldBySchema;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { AnyObjectSchema } from 'yup';
3
3
  import { FormFieldLayout, Item, SchemaType } from '../../utils';
4
4
  import { DialogType } from '../../context/APIWrapperContext';
@@ -10,6 +10,8 @@ interface DialogFormBySchemaProps {
10
10
  setDialog: (x: Partial<DialogType>) => void;
11
11
  getAutoComplete: (model: string) => Promise<false | Item[]>;
12
12
  fieldsLayout?: FormFieldLayout[];
13
+ isCancelDisabled?: boolean;
14
+ forceSaveEnabled?: boolean;
13
15
  }
14
- export default function DialogFormBySchema({ schema, validationSchema, initialValues, onEditModelSave, setDialog, getAutoComplete, fieldsLayout, }: DialogFormBySchemaProps): JSX.Element;
16
+ export default function DialogFormBySchema({ schema, validationSchema, initialValues, onEditModelSave, setDialog, getAutoComplete, fieldsLayout, isCancelDisabled, forceSaveEnabled, }: DialogFormBySchemaProps): React.JSX.Element;
15
17
  export {};
@@ -15,17 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.default = DialogFormBySchema;
29
40
  const react_1 = __importStar(require("react"));
30
41
  const react_hook_form_1 = require("react-hook-form");
31
42
  const yup_1 = require("@hookform/resolvers/yup");
@@ -33,7 +44,7 @@ const Box_1 = __importDefault(require("@mui/material/Box"));
33
44
  const Button_1 = __importDefault(require("@mui/material/Button"));
34
45
  const styles_1 = require("../../styles");
35
46
  const FormBySchema_1 = __importDefault(require("./FormBySchema"));
36
- function DialogFormBySchema({ schema, validationSchema, initialValues, onEditModelSave, setDialog, getAutoComplete, fieldsLayout, }) {
47
+ function DialogFormBySchema({ schema, validationSchema, initialValues, onEditModelSave, setDialog, getAutoComplete, fieldsLayout, isCancelDisabled, forceSaveEnabled, }) {
37
48
  const { control, handleSubmit, reset, getValues, setValue, formState: { errors, isDirty }, } = (0, react_hook_form_1.useForm)({
38
49
  mode: 'onBlur',
39
50
  resolver: (0, yup_1.yupResolver)(validationSchema),
@@ -48,11 +59,10 @@ function DialogFormBySchema({ schema, validationSchema, initialValues, onEditMod
48
59
  react_1.default.createElement(Box_1.default, null,
49
60
  react_1.default.createElement(FormBySchema_1.default, { control: control, errors: errors, schema: schema, getValues: getValues, setValue: setValue, isolatedGetAutoComplete: getAutoComplete, fieldsLayout: fieldsLayout, relatedEditable: false })),
50
61
  react_1.default.createElement(Box_1.default, { sx: styles_1.Layout.flexRow },
51
- react_1.default.createElement(Button_1.default, { variant: "contained", color: "primary", size: "small", sx: { ml: 1 }, onClick: () => {
62
+ !isCancelDisabled && (react_1.default.createElement(Button_1.default, { variant: "contained", color: "primary", size: "small", sx: { ml: 1 }, onClick: () => {
52
63
  setDialog({
53
64
  open: false,
54
65
  });
55
- } }, "Cancelar"),
56
- react_1.default.createElement(Button_1.default, { variant: "contained", name: "exitOnSave", disabled: !isDirty, type: "submit", color: "primary", size: "small" }, "Salvar"))))));
66
+ } }, "Cancelar")),
67
+ react_1.default.createElement(Button_1.default, { variant: "contained", name: "exitOnSave", disabled: !forceSaveEnabled && !isDirty, type: "submit", color: "primary", size: "small" }, "Salvar"))))));
57
68
  }
58
- exports.default = DialogFormBySchema;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { FieldBySchemaProps } from '../../utils';
3
- export default function FieldBySchema({ name, schema, control, errors, multiline, setValue, getValues, fieldKey, labelKey, index, optionsAC, optionsModel, getOptionLabel, renderOption, onEditModel, fieldsLayout, sx, options, isSemaphoric, label, onValueChange, decimalScale, ...other }: FieldBySchemaProps): JSX.Element;
3
+ export default function FieldBySchema({ name, schema, control, errors, multiline, setValue, getValues, fieldKey, labelKey, index, optionsAC, optionsModel, getOptionLabel, renderOption, onEditModel, fieldsLayout, sx, options, isSemaphoric, label, onValueChange, decimalScale, autoFocus, ...other }: FieldBySchemaProps): React.JSX.Element;
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.default = FieldBySchema;
17
18
  const react_1 = __importDefault(require("react"));
18
19
  const DesktopDatePickerBySchema_1 = __importDefault(require("./inputs/DesktopDatePickerBySchema"));
19
20
  const DesktopDateTimePickerBySchema_1 = __importDefault(require("./inputs/DesktopDateTimePickerBySchema"));
@@ -23,10 +24,10 @@ const BooleanFieldBySchema_1 = __importDefault(require("./inputs/BooleanFieldByS
23
24
  const FloatFieldBySchema_1 = __importDefault(require("./inputs/FloatFieldBySchema"));
24
25
  const TextFieldBySchema_1 = __importDefault(require("./inputs/TextFieldBySchema"));
25
26
  function FieldBySchema(_a) {
26
- var { name, schema, control, errors, multiline = false, setValue, getValues, fieldKey, labelKey = 'nome', index, optionsAC, optionsModel, getOptionLabel, renderOption, onEditModel, fieldsLayout, sx, options, isSemaphoric = false, label, onValueChange, decimalScale = 2 } = _a, other = __rest(_a, ["name", "schema", "control", "errors", "multiline", "setValue", "getValues", "fieldKey", "labelKey", "index", "optionsAC", "optionsModel", "getOptionLabel", "renderOption", "onEditModel", "fieldsLayout", "sx", "options", "isSemaphoric", "label", "onValueChange", "decimalScale"]);
27
+ var { name, schema, control, errors, multiline = false, setValue, getValues, fieldKey, labelKey = 'nome', index, optionsAC, optionsModel, getOptionLabel, renderOption, onEditModel, fieldsLayout, sx, options, isSemaphoric = false, label, onValueChange, decimalScale = 2, autoFocus } = _a, other = __rest(_a, ["name", "schema", "control", "errors", "multiline", "setValue", "getValues", "fieldKey", "labelKey", "index", "optionsAC", "optionsModel", "getOptionLabel", "renderOption", "onEditModel", "fieldsLayout", "sx", "options", "isSemaphoric", "label", "onValueChange", "decimalScale", "autoFocus"]);
27
28
  switch (schema[name].type) {
28
29
  case 'date':
29
- return (react_1.default.createElement(DesktopDatePickerBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, multiline: multiline, fieldKey: fieldKey, index: index, sx: sx, onValueChange: onValueChange }, other)));
30
+ return (react_1.default.createElement(DesktopDatePickerBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, multiline: multiline, fieldKey: fieldKey, index: index, sx: sx, onValueChange: onValueChange, autoFocus: autoFocus }, other)));
30
31
  case 'datetime':
31
32
  return (react_1.default.createElement(DesktopDateTimePickerBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, multiline: multiline, fieldKey: fieldKey, index: index, sx: sx, onValueChange: onValueChange }, other)));
32
33
  // case 'field':
@@ -45,21 +46,20 @@ function FieldBySchema(_a) {
45
46
  case 'field':
46
47
  const relatedEditable = schema[name].related_editable;
47
48
  const multiple = schema[name].many || false;
48
- return (react_1.default.createElement(EditableAutocompleteFieldBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, setValue: setValue, getValues: getValues, fieldKey: fieldKey, labelKey: labelKey, index: index, optionsAC: optionsAC, optionsModel: optionsModel, getOptionLabel: getOptionLabel, renderOption: renderOption, onEditModel: relatedEditable ? onEditModel : undefined, fieldsLayout: fieldsLayout, multiple: multiple, sx: sx, onValueChange: onValueChange }, other)));
49
+ return (react_1.default.createElement(EditableAutocompleteFieldBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, setValue: setValue, getValues: getValues, fieldKey: fieldKey, labelKey: labelKey, index: index, optionsAC: optionsAC, optionsModel: optionsModel, getOptionLabel: getOptionLabel, renderOption: renderOption, onEditModel: relatedEditable ? onEditModel : undefined, fieldsLayout: fieldsLayout, multiple: multiple, sx: sx, onValueChange: onValueChange, autoFocus: autoFocus }, other)));
49
50
  case 'choice':
50
- return (react_1.default.createElement(AutocompleteFieldBySchema_1.default, { index: index, name: name, schema: schema, control: control, errors: errors, fieldKey: fieldKey, optionIdKey: "value", optionLabelKey: "display_name", options: options, isSemaphoric: isSemaphoric, label: label, sx: sx, onValueChange: onValueChange }));
51
+ return (react_1.default.createElement(AutocompleteFieldBySchema_1.default, { index: index, name: name, schema: schema, control: control, errors: errors, fieldKey: fieldKey, optionIdKey: "value", optionLabelKey: "display_name", options: options, isSemaphoric: isSemaphoric, label: label, sx: sx, onValueChange: onValueChange, autoFocus: autoFocus }));
51
52
  case 'boolean':
52
- return (react_1.default.createElement(BooleanFieldBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, fieldKey: fieldKey, index: index, sx: sx, onValueChange: onValueChange }, other)));
53
+ return (react_1.default.createElement(BooleanFieldBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, fieldKey: fieldKey, index: index, sx: sx, onValueChange: onValueChange, autoFocus: autoFocus }, other)));
53
54
  case 'decimal':
54
55
  case 'float':
55
- return (react_1.default.createElement(FloatFieldBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, multiline: multiline, fieldKey: fieldKey, index: index, onValueChange: onValueChange, decimalScale: decimalScale, label: label, sx: sx }, other)));
56
+ return (react_1.default.createElement(FloatFieldBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, multiline: multiline, fieldKey: fieldKey, index: index, onValueChange: onValueChange, decimalScale: decimalScale, label: label, sx: sx, autoFocus: autoFocus }, other)));
56
57
  case 'number':
57
58
  case 'integer':
58
59
  case 'password':
59
60
  default:
60
61
  const localMultiline = schema[name].model_multiline === true || multiline;
61
62
  const minRows = localMultiline ? 3 : 0;
62
- return (react_1.default.createElement(TextFieldBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, multiline: localMultiline, minRows: minRows, fieldKey: fieldKey, index: index, sx: sx, isPassword: schema[name].type === 'password', onValueChange: onValueChange }, other)));
63
+ return (react_1.default.createElement(TextFieldBySchema_1.default, Object.assign({ name: name, schema: schema, control: control, errors: errors, multiline: localMultiline, minRows: minRows, fieldKey: fieldKey, index: index, sx: sx, isPassword: schema[name].type === 'password', onValueChange: onValueChange, autoFocus: autoFocus }, other)));
63
64
  }
64
65
  }
65
- exports.default = FieldBySchema;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { UseFormRegister } from 'react-hook-form';
3
3
  import { CommonFieldProps, FieldBySchemaProps, FormFieldLayout, Item, OptionsAC } from '../../utils';
4
4
  interface FormBySchemaProps extends Omit<FieldBySchemaProps, 'name'> {
@@ -12,5 +12,5 @@ interface FormBySchemaProps extends Omit<FieldBySchemaProps, 'name'> {
12
12
  fieldsProps?: Record<string, CommonFieldProps>;
13
13
  relatedEditable?: boolean;
14
14
  }
15
- 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, }: FormBySchemaProps): JSX.Element;
15
+ 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, }: FormBySchemaProps): React.JSX.Element;
16
16
  export {};
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,6 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.default = FormBySchema;
38
49
  const react_1 = __importStar(require("react"));
39
50
  const Box_1 = __importDefault(require("@mui/material/Box"));
40
51
  const Card_1 = __importDefault(require("@mui/material/Card"));
@@ -171,7 +182,7 @@ function FormBySchema({ schema, control, errors, register, multiline = false, se
171
182
  : undefined, fieldsLayout: customFieldFormLayouts &&
172
183
  field in customFieldFormLayouts
173
184
  ? customFieldFormLayouts[field]
174
- : undefined, options: options, isSemaphoric: isSemaphoric, label: label, decimalScale: decimalScale }, fieldProps))));
185
+ : undefined, options: options, isSemaphoric: isSemaphoric, label: label, decimalScale: decimalScale, autoFocus: rowIndex === 0 }, fieldProps))));
175
186
  }
176
187
  if (Array.isArray(row)) {
177
188
  return (react_1.default.createElement(Box_1.default, { sx: styles_1.Layout.inLineForm, key: `row_${rowIndex}` },
@@ -189,7 +200,8 @@ function FormBySchema({ schema, control, errors, register, multiline = false, se
189
200
  ? Object.assign(Object.assign({}, fieldProps.sx), { mr }) : {
190
201
  mr,
191
202
  };
192
- return (react_1.default.createElement(react_1.default.Fragment, { key: `field_${rowIndex}_${i}` }, typeof field === 'string' ? (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: optionsAC, optionsModel: optionsModel, getOptionLabel: getOptionLabel, renderOption: renderOption, onEditModel: onEditModel, options: options, isSemaphoric: isSemaphoric, label: label, decimalScale: decimalScale }, fieldProps))) : (react_1.default.createElement(field.CustomElement, Object.assign({}, fieldProps)))));
203
+ return (react_1.default.createElement(react_1.default.Fragment, { key: `field_${rowIndex}_${i}` }, typeof field === 'string' ? (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: optionsAC, optionsModel: optionsModel, getOptionLabel: getOptionLabel, renderOption: renderOption, onEditModel: onEditModel, options: options, isSemaphoric: isSemaphoric, label: label, decimalScale: decimalScale, autoFocus: rowIndex === 0 &&
204
+ i === 0 }, fieldProps))) : (react_1.default.createElement(field.CustomElement, Object.assign({}, fieldProps)))));
193
205
  }))));
194
206
  }
195
207
  const fieldProps = fieldsProps && fieldsProps.hasOwnProperty(row.key)
@@ -202,4 +214,3 @@ function FormBySchema({ schema, control, errors, register, multiline = false, se
202
214
  }))))));
203
215
  })));
204
216
  }
205
- exports.default = FormBySchema;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { FieldBySchemaProps } from '../../../utils';
3
- export default function AutocompleteFieldBySchema({ fieldKey, index, name, schema, control, errors, optionIdKey, optionLabelKey, options, isSemaphoric, sx, onValueChange, ...other }: FieldBySchemaProps): JSX.Element;
3
+ export default function AutocompleteFieldBySchema({ fieldKey, index, name, schema, control, errors, optionIdKey, optionLabelKey, options, isSemaphoric, sx, onValueChange, autoFocus, ...other }: FieldBySchemaProps): React.JSX.Element;
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.default = AutocompleteFieldBySchema;
17
18
  const react_1 = __importDefault(require("react"));
18
19
  const react_hook_form_1 = require("react-hook-form");
19
20
  const Autocomplete_1 = __importDefault(require("@mui/material/Autocomplete"));
@@ -55,7 +56,7 @@ const renderInput = (_a) => {
55
56
  return (react_1.default.createElement(TextField_1.default, Object.assign({}, params, { label: label || schema[model].label, required: schema[model].required, margin: "normal", error: error, helperText: helperText, sx: sx })));
56
57
  };
57
58
  function AutocompleteFieldBySchema(_a) {
58
- var { fieldKey, index, name, schema, control, errors, optionIdKey = 'id', optionLabelKey = 'label', options, isSemaphoric = false, sx = { mr: 2 }, onValueChange } = _a, other = __rest(_a, ["fieldKey", "index", "name", "schema", "control", "errors", "optionIdKey", "optionLabelKey", "options", "isSemaphoric", "sx", "onValueChange"]);
59
+ var { fieldKey, index, name, schema, control, errors, optionIdKey = 'id', optionLabelKey = 'label', options, isSemaphoric = false, sx = { mr: 2 }, onValueChange, autoFocus } = _a, other = __rest(_a, ["fieldKey", "index", "name", "schema", "control", "errors", "optionIdKey", "optionLabelKey", "options", "isSemaphoric", "sx", "onValueChange", "autoFocus"]);
59
60
  const model = name;
60
61
  const { theme } = (0, DRFReactBySchemaContext_1.useDRFReactBySchema)();
61
62
  if (!options) {
@@ -64,7 +65,7 @@ function AutocompleteFieldBySchema(_a) {
64
65
  if (fieldKey && index && index >= 0) {
65
66
  name = `${fieldKey}.${index}.${name}`;
66
67
  }
67
- return (react_1.default.createElement(react_hook_form_1.Controller, { name: name, control: control, render: ({ field }) => (react_1.default.createElement(Autocomplete_1.default, Object.assign({}, field, { key: name, id: name, options: options || [], selectOnFocus: true, autoHighlight: true, isOptionEqualToValue: (option, value) => {
68
+ return (react_1.default.createElement(react_hook_form_1.Controller, { name: name, control: control, render: ({ field }) => (react_1.default.createElement(Autocomplete_1.default, Object.assign({}, field, { key: name, id: name, options: options || [], selectOnFocus: true, autoHighlight: true, autoFocus: autoFocus, isOptionEqualToValue: (option, value) => {
68
69
  return option[optionIdKey] === value[optionIdKey];
69
70
  }, getOptionLabel: (option) => {
70
71
  return option[optionLabelKey];
@@ -86,4 +87,3 @@ function AutocompleteFieldBySchema(_a) {
86
87
  theme }));
87
88
  }, sx: sx }, other))) }));
88
89
  }
89
- exports.default = AutocompleteFieldBySchema;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { FieldBySchemaProps } from '../../../utils';
3
- export default function BooleanFieldBySchema({ name, schema, control, fieldKey, index, sx, onValueChange, ...other }: FieldBySchemaProps): JSX.Element;
3
+ export default function BooleanFieldBySchema({ name, schema, control, fieldKey, index, sx, onValueChange, autoFocus, ...other }: FieldBySchemaProps): React.JSX.Element;
@@ -14,12 +14,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.default = BooleanFieldBySchema;
17
18
  const react_1 = __importDefault(require("react"));
18
19
  const react_hook_form_1 = require("react-hook-form");
19
20
  const Checkbox_1 = __importDefault(require("@mui/material/Checkbox"));
20
21
  const FormControlLabel_1 = __importDefault(require("@mui/material/FormControlLabel"));
21
22
  function BooleanFieldBySchema(_a) {
22
- var { name, schema, control, fieldKey, index, sx = { mr: 2 }, onValueChange } = _a, other = __rest(_a, ["name", "schema", "control", "fieldKey", "index", "sx", "onValueChange"]);
23
+ var { name, schema, control, fieldKey, index, sx = { mr: 2 }, onValueChange, autoFocus } = _a, other = __rest(_a, ["name", "schema", "control", "fieldKey", "index", "sx", "onValueChange", "autoFocus"]);
23
24
  const model = name;
24
25
  if (fieldKey && index && index >= 0) {
25
26
  name = `${fieldKey}.${index}.${name}`;
@@ -29,6 +30,5 @@ function BooleanFieldBySchema(_a) {
29
30
  onValueChange(e);
30
31
  }
31
32
  field.onChange(e);
32
- } })), label: schema[model].label, required: schema[model].required, sx: Object.assign({ width: '100%' }, sx) })) }));
33
+ }, autoFocus: autoFocus })), label: schema[model].label, required: schema[model].required, sx: Object.assign({ width: '100%' }, sx) })) }));
33
34
  }
34
- exports.default = BooleanFieldBySchema;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import 'dayjs/locale/pt-br';
3
3
  import { FieldBySchemaProps } from '../../../utils';
4
- export default function DesktopDatePickerBySchema({ name, schema, control, errors, fieldKey, index, sx, }: FieldBySchemaProps): JSX.Element;
4
+ export default function DesktopDatePickerBySchema({ name, schema, control, errors, fieldKey, index, sx, autoFocus, }: FieldBySchemaProps): React.JSX.Element;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = DesktopDatePickerBySchema;
6
7
  const react_1 = __importDefault(require("react"));
7
8
  const react_hook_form_1 = require("react-hook-form");
8
9
  const DesktopDatePicker_1 = require("@mui/x-date-pickers/DesktopDatePicker");
@@ -11,7 +12,7 @@ const AdapterDayjs_1 = require("@mui/x-date-pickers/AdapterDayjs");
11
12
  const dayjs_1 = __importDefault(require("dayjs"));
12
13
  require("dayjs/locale/pt-br");
13
14
  const utils_1 = require("../../../utils");
14
- function DesktopDatePickerBySchema({ name, schema, control, errors, fieldKey, index, sx = { mr: 2, mt: 2 }, }) {
15
+ function DesktopDatePickerBySchema({ name, schema, control, errors, fieldKey, index, sx = { mr: 2, mt: 2 }, autoFocus, }) {
15
16
  if (!sx) {
16
17
  sx = { minWidth: 200 };
17
18
  }
@@ -41,7 +42,7 @@ function DesktopDatePickerBySchema({ name, schema, control, errors, fieldKey, in
41
42
  helperText,
42
43
  sx,
43
44
  margin: 'normal',
45
+ autoFocus,
44
46
  },
45
47
  } })))) }));
46
48
  }
47
- exports.default = DesktopDatePickerBySchema;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import 'dayjs/locale/pt-br';
3
3
  import { FieldBySchemaProps } from '../../../utils';
4
- export default function DesktopDateTimePickerBySchema({ name, schema, control, errors, fieldKey, index, sx, }: FieldBySchemaProps): JSX.Element;
4
+ export default function DesktopDateTimePickerBySchema({ name, schema, control, errors, fieldKey, index, sx, autoFocus, }: FieldBySchemaProps): React.JSX.Element;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = DesktopDateTimePickerBySchema;
6
7
  const react_1 = __importDefault(require("react"));
7
8
  const react_hook_form_1 = require("react-hook-form");
8
9
  const DesktopDateTimePicker_1 = require("@mui/x-date-pickers/DesktopDateTimePicker");
@@ -11,7 +12,7 @@ const AdapterDayjs_1 = require("@mui/x-date-pickers/AdapterDayjs");
11
12
  const dayjs_1 = __importDefault(require("dayjs"));
12
13
  require("dayjs/locale/pt-br");
13
14
  const utils_1 = require("../../../utils");
14
- function DesktopDateTimePickerBySchema({ name, schema, control, errors, fieldKey, index, sx = { mr: 2, mt: 2 }, }) {
15
+ function DesktopDateTimePickerBySchema({ name, schema, control, errors, fieldKey, index, sx = { mr: 2, mt: 2 }, autoFocus, }) {
15
16
  const model = name;
16
17
  if (fieldKey && index && index >= 0) {
17
18
  name = `${fieldKey}.${index}.${name}`;
@@ -34,7 +35,7 @@ function DesktopDateTimePickerBySchema({ name, schema, control, errors, fieldKey
34
35
  helperText,
35
36
  sx,
36
37
  margin: 'normal',
38
+ autoFocus,
37
39
  },
38
40
  } })))) }));
39
41
  }
40
- exports.default = DesktopDateTimePickerBySchema;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import Autocomplete from '@mui/material/Autocomplete';
2
3
  import { FieldBySchemaProps } from '../../../utils';
3
- declare const EditableAutocompleteFieldBySchema: React.ForwardRefExoticComponent<FieldBySchemaProps & React.RefAttributes<any>>;
4
+ declare const EditableAutocompleteFieldBySchema: React.ForwardRefExoticComponent<FieldBySchemaProps & React.RefAttributes<typeof Autocomplete>>;
4
5
  export default EditableAutocompleteFieldBySchema;