drf-react-by-schema 0.17.13 → 0.17.14
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.
|
@@ -81,9 +81,9 @@ const CustomToolbar = ({ preparedColumns, setPreparedColumns, onSelectActions, s
|
|
|
81
81
|
}
|
|
82
82
|
selectAction.action(selectionModel, bulkUpdateData);
|
|
83
83
|
} }, selectAction.title)))))),
|
|
84
|
-
hideColumnsButton && (react_1.default.createElement(x_data_grid_1.GridToolbarColumnsButton, { sx: { ml: '10px', fontSize: '13px' }, placeholder: '' })),
|
|
85
|
-
hideFilterButton && (react_1.default.createElement(x_data_grid_1.GridToolbarFilterButton, { sx: { ml: '10px', fontSize: '13px' }, placeholder: '' })),
|
|
86
|
-
hideDensityButton && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
84
|
+
!hideColumnsButton && (react_1.default.createElement(x_data_grid_1.GridToolbarColumnsButton, { sx: { ml: '10px', fontSize: '13px' }, placeholder: '' })),
|
|
85
|
+
!hideFilterButton && (react_1.default.createElement(x_data_grid_1.GridToolbarFilterButton, { sx: { ml: '10px', fontSize: '13px' }, placeholder: '' })),
|
|
86
|
+
!hideDensityButton && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
87
87
|
react_1.default.createElement(x_data_grid_1.GridToolbarDensitySelector, { sx: { ml: '10px', fontSize: '13px' }, placeholder: '' }),
|
|
88
88
|
react_1.default.createElement(Button_1.default, { onClick: openResizeMenu, sx: { ml: '0px', fontSize: '13px' } },
|
|
89
89
|
react_1.default.createElement(Expand_1.default, { sx: { transform: 'rotate(90deg)', mr: '6px' } }),
|
|
@@ -97,8 +97,8 @@ const CustomToolbar = ({ preparedColumns, setPreparedColumns, onSelectActions, s
|
|
|
97
97
|
closeResizeMenu();
|
|
98
98
|
setPreparedColumns((0, utils_1.resizeColumns)(preparedColumns, 'maxContent', apiRef));
|
|
99
99
|
} }, "Ajustar ao conte\u00FAdo")))),
|
|
100
|
-
hideExportButton && react_1.default.createElement(x_data_grid_1.GridToolbarExport, { sx: { ml: '0px', fontSize: '13px' } })),
|
|
101
|
-
hideQuickFilterBar && (react_1.default.createElement("div", null,
|
|
100
|
+
!hideExportButton && react_1.default.createElement(x_data_grid_1.GridToolbarExport, { sx: { ml: '0px', fontSize: '13px' } })),
|
|
101
|
+
!hideQuickFilterBar && (react_1.default.createElement("div", null,
|
|
102
102
|
react_1.default.createElement(x_data_grid_1.GridToolbarQuickFilter, null)))));
|
|
103
103
|
};
|
|
104
104
|
exports.CustomToolbar = CustomToolbar;
|
|
@@ -129,6 +129,16 @@ function SelectEditInputCell({ field, id, value, column, type, optionsAC, isInde
|
|
|
129
129
|
}
|
|
130
130
|
if (newValue && newValue.inputValue) {
|
|
131
131
|
const tmpId = (0, utils_1.getTmpId)();
|
|
132
|
+
if (onEditModel) {
|
|
133
|
+
// Open modal to save new item:
|
|
134
|
+
onEditModel({
|
|
135
|
+
model: field,
|
|
136
|
+
id: tmpId,
|
|
137
|
+
labelKey,
|
|
138
|
+
fieldsLayout,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
// Define new Item as an "optimistic response"
|
|
132
142
|
newValue = {
|
|
133
143
|
[valueKey]: tmpId,
|
|
134
144
|
[labelKey]: newValue.inputValue,
|
|
@@ -142,7 +152,7 @@ function SelectEditInputCell({ field, id, value, column, type, optionsAC, isInde
|
|
|
142
152
|
open: true,
|
|
143
153
|
loading: false,
|
|
144
154
|
title: 'Linha sendo criada',
|
|
145
|
-
Body: 'Esta linha está sendo
|
|
155
|
+
Body: 'Esta linha está sendo criada agora por você. Para editar suas propriedades, salve antes, e depois você poderá editar!',
|
|
146
156
|
Actions: (react_1.default.createElement(DialogActions_1.default, { setDialog: setDialog, btnCancel: "Entendi" })),
|
|
147
157
|
});
|
|
148
158
|
return;
|
|
@@ -121,20 +121,21 @@ const EditableAutocompleteFieldBySchema = react_1.default.forwardRef((_a, ref) =
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
if (newValue && newValue.inputValue) {
|
|
124
|
+
const tmpId = (0, utils_1.getTmpId)();
|
|
124
125
|
if (onEditModel) {
|
|
126
|
+
// Open modal to save new item:
|
|
125
127
|
onEditModel({
|
|
126
128
|
fieldKey,
|
|
127
129
|
index,
|
|
128
130
|
model: optionsModel,
|
|
129
|
-
id:
|
|
131
|
+
id: tmpId,
|
|
130
132
|
labelKey,
|
|
131
133
|
setValue,
|
|
132
134
|
getValues,
|
|
133
135
|
fieldsLayout,
|
|
134
136
|
});
|
|
135
|
-
return;
|
|
136
137
|
}
|
|
137
|
-
|
|
138
|
+
// Define new Item as an "optimistic response"
|
|
138
139
|
newValue = {
|
|
139
140
|
id: tmpId,
|
|
140
141
|
label: newValue.inputValue,
|
package/package.json
CHANGED