drf-react-by-schema 0.19.8 → 0.19.10
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/@types/index.d.ts +13 -4
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/components/DataGridBySchemaEditable/DataGridDesktop.d.ts +66 -0
- package/dist/components/DataGridBySchemaEditable/DataGridDesktop.d.ts.map +1 -0
- package/dist/components/DataGridBySchemaEditable/DataGridDesktop.js +759 -0
- package/dist/components/DataGridBySchemaEditable/DataGridMobile.d.ts +13 -0
- package/dist/components/DataGridBySchemaEditable/DataGridMobile.d.ts.map +1 -0
- package/dist/components/DataGridBySchemaEditable/DataGridMobile.js +165 -0
- package/dist/components/DataGridBySchemaEditable.d.ts +4 -3
- package/dist/components/DataGridBySchemaEditable.d.ts.map +1 -1
- package/dist/components/DataGridBySchemaEditable.js +18 -721
- package/dist/components/GenericModelList.d.ts +6 -5
- package/dist/components/GenericModelList.d.ts.map +1 -1
- package/dist/components/GenericModelList.js +2 -2
- package/dist/components/GenericRelatedModelList.d.ts +5 -4
- package/dist/components/GenericRelatedModelList.d.ts.map +1 -1
- package/dist/components/GenericRelatedModelList.js +3 -3
- package/dist/components/GenericRelatedModelListTable.d.ts +5 -4
- package/dist/components/GenericRelatedModelListTable.d.ts.map +1 -1
- package/dist/components/GenericRelatedModelListTable.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { GridFilterModel, GridRenderCellParams } from '@mui/x-data-grid';
|
|
3
|
-
import { GridEnrichedBySchemaColDef, ActionType, Item, OnSelectActions, OptionsAC, FormFieldLayout, CustomAction, SumRowsType,
|
|
3
|
+
import { GridEnrichedBySchemaColDef, ActionType, Item, OnSelectActions, OptionsAC, FormFieldLayout, CustomAction, SumRowsType, LinkComponentType, MobileListRenderItemType } from '../@types';
|
|
4
4
|
interface GenericModelListProps {
|
|
5
5
|
model: string;
|
|
6
6
|
columnFields: string[];
|
|
@@ -9,7 +9,7 @@ interface GenericModelListProps {
|
|
|
9
9
|
disabledFields?: string[];
|
|
10
10
|
minWidthFields?: Record<string, number>;
|
|
11
11
|
indexField: string;
|
|
12
|
-
indexFieldBasePath
|
|
12
|
+
indexFieldBasePath?: string;
|
|
13
13
|
indexFieldViewBasePath?: string;
|
|
14
14
|
addExistingModel?: string;
|
|
15
15
|
onProcessRow?: (p: Item) => void;
|
|
@@ -24,7 +24,7 @@ interface GenericModelListProps {
|
|
|
24
24
|
sumRows?: SumRowsType;
|
|
25
25
|
isAutoHeight?: boolean;
|
|
26
26
|
forceReload?: boolean;
|
|
27
|
-
LinkComponent?:
|
|
27
|
+
LinkComponent?: LinkComponentType | null;
|
|
28
28
|
hasHeader: boolean;
|
|
29
29
|
paginationMode: 'server' | 'client';
|
|
30
30
|
defaultFilter?: GridFilterModel;
|
|
@@ -38,7 +38,8 @@ interface GenericModelListProps {
|
|
|
38
38
|
defaultValues?: Item;
|
|
39
39
|
disableScreenLoading?: boolean;
|
|
40
40
|
extraValidators?: Item;
|
|
41
|
+
MobileListRenderItem?: MobileListRenderItemType;
|
|
41
42
|
}
|
|
42
|
-
declare const GenericModelList: ({ model, columnFields, hiddenFields, creatableFields, disabledFields, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, onProcessRow, onDataChange, 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;
|
|
43
|
+
declare const GenericModelList: ({ model, columnFields, hiddenFields, creatableFields, disabledFields, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, onProcessRow, onDataChange, reloadAfterRowUpdate, customColumnOperations, customFieldFormLayouts, customLinkDestination, isEditable, hasBulkSelect, onSelectActions, sumRows, isAutoHeight, forceReload, LinkComponent, hasHeader, paginationMode, defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, customActions, optionsAC, defaultValues, disableScreenLoading, extraValidators, MobileListRenderItem, }: GenericModelListProps) => React.JSX.Element;
|
|
43
44
|
export default GenericModelList;
|
|
44
45
|
//# sourceMappingURL=GenericModelList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericModelList.d.ts","sourceRoot":"","sources":["../../src/components/GenericModelList.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GenericModelList.d.ts","sourceRoot":"","sources":["../../src/components/GenericModelList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,OAAO,EAAa,eAAe,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAMpF,OAAO,EACL,0BAA0B,EAG1B,UAAU,EACV,IAAI,EACJ,eAAe,EACf,SAAS,EACT,eAAe,EACf,YAAY,EAEZ,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,WAAW,CAAC;AAMnB,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,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BAAwB,CAAC;CACjD;AAED,QAAA,MAAM,gBAAgB,GAAI,6lBAuCvB,qBAAqB,sBA0NvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -60,7 +60,7 @@ const utils_1 = require("../utils");
|
|
|
60
60
|
const api_1 = require("../api");
|
|
61
61
|
const DRFReactBySchemaContext_1 = require("../context/DRFReactBySchemaContext");
|
|
62
62
|
const APIWrapperContext_1 = require("../context/APIWrapperContext");
|
|
63
|
-
const GenericModelList = ({ model, columnFields, hiddenFields = [], creatableFields, disabledFields, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, onProcessRow, onDataChange, reloadAfterRowUpdate, customColumnOperations, customFieldFormLayouts, customLinkDestination, isEditable, hasBulkSelect = false, onSelectActions, sumRows, isAutoHeight = true, forceReload = false, LinkComponent = null, hasHeader = false, paginationMode = 'client', defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, customActions, optionsAC, defaultValues, disableScreenLoading, extraValidators, }) => {
|
|
63
|
+
const GenericModelList = ({ model, columnFields, hiddenFields = [], creatableFields, disabledFields, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, onProcessRow, onDataChange, reloadAfterRowUpdate, customColumnOperations, customFieldFormLayouts, customLinkDestination, isEditable, hasBulkSelect = false, onSelectActions, sumRows, isAutoHeight = true, forceReload = false, LinkComponent = null, hasHeader = false, paginationMode = 'client', defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, customActions, optionsAC, defaultValues, disableScreenLoading, extraValidators, MobileListRenderItem, }) => {
|
|
64
64
|
const { serverEndPoint, isInBatches, firstBatchLength } = (0, DRFReactBySchemaContext_1.useDRFReactBySchema)();
|
|
65
65
|
const { onEditModel } = (0, APIWrapperContext_1.useAPIWrapper)();
|
|
66
66
|
const [data, setData] = (0, react_1.useState)(false);
|
|
@@ -179,7 +179,7 @@ const GenericModelList = ({ model, columnFields, hiddenFields = [], creatableFie
|
|
|
179
179
|
? undefined
|
|
180
180
|
: typeof data.rowCount !== undefined
|
|
181
181
|
? data.rowCount
|
|
182
|
-
: 0, extraValidators: extraValidators })),
|
|
182
|
+
: 0, extraValidators: extraValidators, MobileListRenderItem: MobileListRenderItem })),
|
|
183
183
|
paginationMode === 'client' ? (react_1.default.createElement(DataTotals_1.default, { data: data.data, sumRows: sumRows, visibleRows: visibleRows })) : (react_1.default.createElement(DataTotalsServer_1.default, { sumRows: sumRows, totals: data.sumRowsTotals })))) : (react_1.default.createElement(Backdrop_1.default, { invisible: true, sx: { color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }, open: loading },
|
|
184
184
|
react_1.default.createElement(CircularProgress_1.default, null)))));
|
|
185
185
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { GridFilterModel } from '@mui/x-data-grid';
|
|
3
|
-
import { ActionType, GridEnrichedBySchemaColDef, Id, Item,
|
|
3
|
+
import { ActionType, GridEnrichedBySchemaColDef, Id, Item, LinkComponentType, MobileListRenderItemType, OnSelectActions, OptionsAC, SumRowsType } from '../@types';
|
|
4
4
|
interface GenericRelatedModelListProps {
|
|
5
5
|
model: string;
|
|
6
6
|
id: Id;
|
|
@@ -36,9 +36,10 @@ interface GenericRelatedModelListProps {
|
|
|
36
36
|
actions?: Partial<ActionType>[];
|
|
37
37
|
optionsAC?: OptionsAC;
|
|
38
38
|
defaultValues?: Item;
|
|
39
|
-
LinkComponent?:
|
|
39
|
+
LinkComponent?: LinkComponentType | null;
|
|
40
40
|
extraValidators?: Item;
|
|
41
|
+
MobileListRenderItem?: MobileListRenderItemType;
|
|
41
42
|
}
|
|
42
|
-
export default function GenericRelatedModelList({ model, id, relatedModel, columnFields, hiddenFields, creatableFields, disabledFields, usuaria, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, label, onProcessRow, onDataChange, reloadAfterRowUpdate, customColumnOperations, isEditable, hasBulkSelect, onSelectActions, sumRows, isAutoHeight, isInBatches, noCardWrapper, paginationMode, defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, optionsAC, defaultValues, LinkComponent, extraValidators, }: GenericRelatedModelListProps): React.JSX.Element;
|
|
43
|
+
export default function GenericRelatedModelList({ model, id, relatedModel, columnFields, hiddenFields, creatableFields, disabledFields, usuaria, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, label, onProcessRow, onDataChange, reloadAfterRowUpdate, customColumnOperations, isEditable, hasBulkSelect, onSelectActions, sumRows, isAutoHeight, isInBatches, noCardWrapper, paginationMode, defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, optionsAC, defaultValues, LinkComponent, extraValidators, MobileListRenderItem, }: GenericRelatedModelListProps): React.JSX.Element;
|
|
43
44
|
export {};
|
|
44
45
|
//# sourceMappingURL=GenericRelatedModelList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericRelatedModelList.d.ts","sourceRoot":"","sources":["../../src/components/GenericRelatedModelList.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GenericRelatedModelList.d.ts","sourceRoot":"","sources":["../../src/components/GenericRelatedModelList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,eAAe,EAAa,MAAM,kBAAkB,CAAC;AAG9D,OAAO,EACL,UAAU,EAGV,0BAA0B,EAC1B,EAAE,EACF,IAAI,EACJ,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,SAAS,EAET,WAAW,EACZ,MAAM,WAAW,CAAC;AAMnB,UAAU,4BAA4B;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,EAAE,CAAC;IACP,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,CAAC,EAA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AE,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,IAAI,CAAC;IAEvB,oBAAoB,CAAC,EAAE,wBAAwB,CAAC;CACjD;AAED,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,KAAK,EACL,EAAE,EACF,YAAY,EACZ,YAAY,EACZ,YAAqB,EACrB,eAAe,EACf,cAAc,EACd,OAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,UAAiB,EACjB,aAAqB,EACrB,eAAe,EACf,OAAO,EACP,YAAoB,EACpB,WAAkB,EAClB,aAAqB,EACrB,cAAyB,EACzB,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,OAAO,EACP,SAAS,EACT,aAAa,EACb,aAAa,EACb,eAAe,EAEf,oBAAoB,GACrB,EAAE,4BAA4B,qBA0N9B"}
|
|
@@ -55,7 +55,7 @@ const utils_1 = require("../utils");
|
|
|
55
55
|
const api_1 = require("../api");
|
|
56
56
|
const styles_1 = require("../styles");
|
|
57
57
|
const GenericRelatedModelListTable_1 = __importDefault(require("./GenericRelatedModelListTable"));
|
|
58
|
-
function GenericRelatedModelList({ model, id, relatedModel, columnFields, hiddenFields = ['id'], creatableFields, disabledFields, usuaria = null, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, label, onProcessRow, onDataChange, reloadAfterRowUpdate, customColumnOperations, isEditable = true, hasBulkSelect = false, onSelectActions, sumRows, isAutoHeight = false, isInBatches = true, noCardWrapper = false, paginationMode = 'client', defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, optionsAC, defaultValues, LinkComponent, extraValidators, }) {
|
|
58
|
+
function GenericRelatedModelList({ model, id, relatedModel, columnFields, hiddenFields = ['id'], creatableFields, disabledFields, usuaria = null, minWidthFields, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, label, onProcessRow, onDataChange, reloadAfterRowUpdate, customColumnOperations, isEditable = true, hasBulkSelect = false, onSelectActions, sumRows, isAutoHeight = false, isInBatches = true, noCardWrapper = false, paginationMode = 'client', defaultFilter, queryParams, hideFooterComponent, hideToolbarComponent, tableAutoHeight, actions, optionsAC, defaultValues, LinkComponent, extraValidators, MobileListRenderItem, }) {
|
|
59
59
|
const [data, setData] = (0, react_1.useState)(false);
|
|
60
60
|
const [visibleRows, setVisibleRows] = (0, react_1.useState)([]);
|
|
61
61
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
@@ -160,8 +160,8 @@ function GenericRelatedModelList({ model, id, relatedModel, columnFields, hidden
|
|
|
160
160
|
}
|
|
161
161
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
162
162
|
}, [paginationModel]);
|
|
163
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, typeof data !== 'boolean' && data.columns && (react_1.default.createElement(react_1.default.Fragment, null, noCardWrapper ? (react_1.default.createElement(GenericRelatedModelListTable_1.default, { 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: onDataChangeLocal, sumRows: sumRows, visibleRows: visibleRows, paginationMode: paginationMode, paginationModel: paginationModel, setPaginationModel: setPaginationModel, actions: actions, optionsAC: optionsAC, defaultValues: defaultValues, LinkComponent: LinkComponent, extraValidators: extraValidators })) : (react_1.default.createElement(Card_1.default, { sx: styles_1.Layout.formCard },
|
|
163
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, typeof data !== 'boolean' && data.columns && (react_1.default.createElement(react_1.default.Fragment, null, noCardWrapper ? (react_1.default.createElement(GenericRelatedModelListTable_1.default, { 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: onDataChangeLocal, sumRows: sumRows, visibleRows: visibleRows, paginationMode: paginationMode, paginationModel: paginationModel, setPaginationModel: setPaginationModel, actions: actions, optionsAC: optionsAC, defaultValues: defaultValues, LinkComponent: LinkComponent, extraValidators: extraValidators, MobileListRenderItem: MobileListRenderItem })) : (react_1.default.createElement(Card_1.default, { sx: styles_1.Layout.formCard },
|
|
164
164
|
react_1.default.createElement(CardHeader_1.default, { title: label }),
|
|
165
165
|
react_1.default.createElement(CardContent_1.default, null,
|
|
166
|
-
react_1.default.createElement(GenericRelatedModelListTable_1.default, { 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: onDataChangeLocal, sumRows: sumRows, visibleRows: visibleRows, paginationMode: paginationMode, paginationModel: paginationModel, setPaginationModel: setPaginationModel, actions: actions, optionsAC: optionsAC, defaultValues: defaultValues, LinkComponent: LinkComponent, extraValidators: extraValidators }))))))));
|
|
166
|
+
react_1.default.createElement(GenericRelatedModelListTable_1.default, { 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: onDataChangeLocal, sumRows: sumRows, visibleRows: visibleRows, paginationMode: paginationMode, paginationModel: paginationModel, setPaginationModel: setPaginationModel, actions: actions, optionsAC: optionsAC, defaultValues: defaultValues, LinkComponent: LinkComponent, extraValidators: extraValidators, MobileListRenderItem: MobileListRenderItem }))))))));
|
|
167
167
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { GridRowId } from '@mui/x-data-grid';
|
|
3
3
|
import { OnEditModelType, OnDeleteRelatedModelType } from '../context/APIWrapperContext';
|
|
4
|
-
import { ActionType, CustomAction, DataSchemaColumnsType, GridEnrichedBySchemaColDef, Id, Item,
|
|
4
|
+
import { ActionType, CustomAction, DataSchemaColumnsType, GridEnrichedBySchemaColDef, Id, Item, LinkComponentType, MobileListRenderItemType, OnSelectActions, OptionsAC, PaginationModel, SumRowsType } from '../@types';
|
|
5
5
|
interface GenericRelatedModelListTableProps {
|
|
6
6
|
data: DataSchemaColumnsType;
|
|
7
7
|
relatedModel: string;
|
|
@@ -35,9 +35,10 @@ interface GenericRelatedModelListTableProps {
|
|
|
35
35
|
customActions?: CustomAction[];
|
|
36
36
|
optionsAC?: OptionsAC;
|
|
37
37
|
defaultValues?: Item;
|
|
38
|
-
LinkComponent?:
|
|
38
|
+
LinkComponent?: LinkComponentType | null;
|
|
39
39
|
extraValidators?: Item;
|
|
40
|
+
MobileListRenderItem?: MobileListRenderItemType;
|
|
40
41
|
}
|
|
41
|
-
export default function GenericRelatedModelListTable({ data, relatedModel, model, loading, id, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, isEditable, onEditModel, finalCustomColumnOperations, setVisibleRows, isAutoHeight, hideFooterPagination, hideFooterComponent, hideToolbarComponent, onProcessRow, onDataChange, sumRows, visibleRows, paginationMode, paginationModel, setPaginationModel, hasBulkSelect, onSelectActions, tableAutoHeight, actions, customActions, optionsAC, defaultValues, LinkComponent, extraValidators, }: GenericRelatedModelListTableProps): React.JSX.Element;
|
|
42
|
+
export default function GenericRelatedModelListTable({ data, relatedModel, model, loading, id, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, isEditable, onEditModel, finalCustomColumnOperations, setVisibleRows, isAutoHeight, hideFooterPagination, hideFooterComponent, hideToolbarComponent, onProcessRow, onDataChange, sumRows, visibleRows, paginationMode, paginationModel, setPaginationModel, hasBulkSelect, onSelectActions, tableAutoHeight, actions, customActions, optionsAC, defaultValues, LinkComponent, extraValidators, MobileListRenderItem, }: GenericRelatedModelListTableProps): React.JSX.Element;
|
|
42
43
|
export {};
|
|
43
44
|
//# sourceMappingURL=GenericRelatedModelListTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericRelatedModelListTable.d.ts","sourceRoot":"","sources":["../../src/components/GenericRelatedModelListTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"GenericRelatedModelListTable.d.ts","sourceRoot":"","sources":["../../src/components/GenericRelatedModelListTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK7C,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EACL,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,EAAE,EACF,IAAI,EACJ,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,SAAS,EACT,eAAe,EACf,WAAW,EACZ,MAAM,WAAW,CAAC;AAGnB,UAAU,iCAAiC;IACzC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,EAAE,EAAE,CAAC;IACP,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,oBAAoB,EAAE,CAAC,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE,2BAA2B,EAAE,CAC3B,CAAC,EAAE,0BAA0B,KAC1B,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACtE,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,IAA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OAAO,EACP,WAAW,EACX,cAAyB,EACzB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,eAAe,EACf,OAAO,EACP,aAAa,EACb,SAAS,EACT,aAAa,EACb,aAAa,EACb,eAAe,EAEf,oBAAoB,GACrB,EAAE,iCAAiC,qBA+DnC"}
|
|
@@ -12,14 +12,14 @@ const DataGridBySchemaEditable_1 = __importDefault(require("./DataGridBySchemaEd
|
|
|
12
12
|
const DataTotals_1 = __importDefault(require("./DataTotals"));
|
|
13
13
|
const DataTotalsServer_1 = __importDefault(require("./DataTotalsServer"));
|
|
14
14
|
const styles_1 = require("../styles");
|
|
15
|
-
function GenericRelatedModelListTable({ data, relatedModel, model, loading, id, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, isEditable, onEditModel, finalCustomColumnOperations, setVisibleRows, isAutoHeight, hideFooterPagination, hideFooterComponent, hideToolbarComponent, onProcessRow, onDataChange, sumRows, visibleRows, paginationMode = 'client', paginationModel, setPaginationModel, hasBulkSelect, onSelectActions, tableAutoHeight, actions, customActions, optionsAC, defaultValues, LinkComponent, extraValidators, }) {
|
|
15
|
+
function GenericRelatedModelListTable({ data, relatedModel, model, loading, id, indexField, indexFieldBasePath, indexFieldViewBasePath, addExistingModel, isEditable, onEditModel, finalCustomColumnOperations, setVisibleRows, isAutoHeight, hideFooterPagination, hideFooterComponent, hideToolbarComponent, onProcessRow, onDataChange, sumRows, visibleRows, paginationMode = 'client', paginationModel, setPaginationModel, hasBulkSelect, onSelectActions, tableAutoHeight, actions, customActions, optionsAC, defaultValues, LinkComponent, extraValidators, MobileListRenderItem, }) {
|
|
16
16
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
17
17
|
data.columns ? (react_1.default.createElement(Box_1.default, { sx: tableAutoHeight ? {} : styles_1.Layout.dataGridFixedHeight },
|
|
18
18
|
react_1.default.createElement(DataGridBySchemaEditable_1.default, { data: data.data, columns: data.columns, schema: data.schema, model: relatedModel, modelParent: model, modelParentId: id, loading: loading, indexField: indexField, indexFieldBasePath: indexFieldBasePath, indexFieldViewBasePath: indexFieldViewBasePath, addExistingModel: addExistingModel, isEditable: isEditable, hasBulkSelect: hasBulkSelect, onSelectActions: onSelectActions, onEditModel: onEditModel, isAutoHeight: isAutoHeight, tableAutoHeight: tableAutoHeight, customColumnOperations: finalCustomColumnOperations, setVisibleRows: setVisibleRows, hideFooterPagination: hideFooterPagination, hideFooterComponent: hideFooterComponent, hideToolbarComponent: hideToolbarComponent, actions: actions, customActions: customActions, optionsAC: optionsAC, defaultValues: defaultValues, onProcessRow: onProcessRow, onDataChange: onDataChange, paginationModel: paginationMode === 'server' ? paginationModel : undefined, setPaginationModel: paginationMode === 'server' ? setPaginationModel : undefined, rowCount: paginationMode === 'client'
|
|
19
19
|
? undefined
|
|
20
20
|
: typeof data.rowCount !== undefined
|
|
21
21
|
? data.rowCount
|
|
22
|
-
: 0, LinkComponent: LinkComponent || undefined, extraValidators: extraValidators }))) : (react_1.default.createElement(Backdrop_1.default, { invisible: true, sx: { color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }, open: loading || false },
|
|
22
|
+
: 0, LinkComponent: LinkComponent || undefined, extraValidators: extraValidators, MobileListRenderItem: MobileListRenderItem }))) : (react_1.default.createElement(Backdrop_1.default, { invisible: true, sx: { color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }, open: loading || false },
|
|
23
23
|
react_1.default.createElement(CircularProgress_1.default, null))),
|
|
24
24
|
paginationMode === 'client' ? (react_1.default.createElement(DataTotals_1.default, { data: data.data, sumRows: sumRows, visibleRows: visibleRows })) : (react_1.default.createElement(DataTotalsServer_1.default, { sumRows: sumRows, totals: data.sumRowsTotals }))));
|
|
25
25
|
}
|
package/package.json
CHANGED