@selfcommunity/react-ui 0.11.0-alpha.46 → 0.11.0-alpha.47
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/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/cjs/components/GroupForm/GroupForm.js +2 -2
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/esm/components/GroupForm/GroupForm.js +2 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +2 -2
|
@@ -42,15 +42,15 @@ function EventFormDialog(inProps) {
|
|
|
42
42
|
props: inProps,
|
|
43
43
|
name: constants_1.PREFIX
|
|
44
44
|
});
|
|
45
|
-
const { className, open = true, onClose, EventFormComponentProps } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "EventFormComponentProps"]);
|
|
45
|
+
const { className, open = true, onClose, EventFormComponentProps = {} } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "EventFormComponentProps"]);
|
|
46
46
|
const handleSuccess = (0, react_1.useCallback)((event) => {
|
|
47
47
|
var _a;
|
|
48
|
-
(_a = EventFormComponentProps
|
|
48
|
+
(_a = EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, event);
|
|
49
49
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
50
50
|
}, [onClose, EventFormComponentProps]);
|
|
51
51
|
/**
|
|
52
52
|
* Renders root object
|
|
53
53
|
*/
|
|
54
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, title: (EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.event) ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.title.edit", defaultMessage: "ui.eventForm.title.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.title", defaultMessage: "ui.eventForm.title" })), open: open, onClose: onClose, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsx)(EventForm_1.default, Object.assign({},
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, title: (EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.event) ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.title.edit", defaultMessage: "ui.eventForm.title.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.title", defaultMessage: "ui.eventForm.title" })), open: open, onClose: onClose, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsx)(EventForm_1.default, Object.assign({}, EventFormComponentProps, { onSuccess: handleSuccess })) })));
|
|
55
55
|
}
|
|
56
56
|
exports.default = EventFormDialog;
|
|
@@ -195,10 +195,10 @@ function GroupForm(inProps) {
|
|
|
195
195
|
}
|
|
196
196
|
groupService
|
|
197
197
|
.then((data) => {
|
|
198
|
-
onSuccess
|
|
198
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data);
|
|
199
199
|
notifyChanges(data);
|
|
200
|
-
onClose && onClose();
|
|
201
200
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
201
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
202
202
|
})
|
|
203
203
|
.catch((e) => {
|
|
204
204
|
setError(Object.assign(Object.assign({}, error), (0, api_services_1.formatHttpErrorCode)(e)));
|
|
@@ -40,14 +40,14 @@ export default function EventFormDialog(inProps) {
|
|
|
40
40
|
props: inProps,
|
|
41
41
|
name: PREFIX
|
|
42
42
|
});
|
|
43
|
-
const { className, open = true, onClose, EventFormComponentProps } = props, rest = __rest(props, ["className", "open", "onClose", "EventFormComponentProps"]);
|
|
43
|
+
const { className, open = true, onClose, EventFormComponentProps = {} } = props, rest = __rest(props, ["className", "open", "onClose", "EventFormComponentProps"]);
|
|
44
44
|
const handleSuccess = useCallback((event) => {
|
|
45
45
|
var _a;
|
|
46
|
-
(_a = EventFormComponentProps
|
|
46
|
+
(_a = EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, event);
|
|
47
47
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
48
48
|
}, [onClose, EventFormComponentProps]);
|
|
49
49
|
/**
|
|
50
50
|
* Renders root object
|
|
51
51
|
*/
|
|
52
|
-
return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, title: (EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.event) ? (_jsx(FormattedMessage, { id: "ui.eventForm.title.edit", defaultMessage: "ui.eventForm.title.edit" })) : (_jsx(FormattedMessage, { id: "ui.eventForm.title", defaultMessage: "ui.eventForm.title" })), open: open, onClose: onClose, className: classNames(classes.root, className) }, rest, { children: _jsx(EventForm, Object.assign({},
|
|
52
|
+
return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, title: (EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.event) ? (_jsx(FormattedMessage, { id: "ui.eventForm.title.edit", defaultMessage: "ui.eventForm.title.edit" })) : (_jsx(FormattedMessage, { id: "ui.eventForm.title", defaultMessage: "ui.eventForm.title" })), open: open, onClose: onClose, className: classNames(classes.root, className) }, rest, { children: _jsx(EventForm, Object.assign({}, EventFormComponentProps, { onSuccess: handleSuccess })) })));
|
|
53
53
|
}
|
|
@@ -193,10 +193,10 @@ export default function GroupForm(inProps) {
|
|
|
193
193
|
}
|
|
194
194
|
groupService
|
|
195
195
|
.then((data) => {
|
|
196
|
-
onSuccess
|
|
196
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data);
|
|
197
197
|
notifyChanges(data);
|
|
198
|
-
onClose && onClose();
|
|
199
198
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
199
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
200
200
|
})
|
|
201
201
|
.catch((e) => {
|
|
202
202
|
setError(Object.assign(Object.assign({}, error), formatHttpErrorCode(e)));
|