@selfcommunity/react-ui 0.10.4-alpha.0 → 0.10.4-alpha.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.
- package/lib/cjs/components/Composer/Composer.js +2 -1
- package/lib/cjs/shared/BackdropScrollDisabled/BackdropScrollDisabled.d.ts +5 -0
- package/lib/cjs/shared/BackdropScrollDisabled/BackdropScrollDisabled.js +14 -0
- package/lib/cjs/shared/BackdropScrollDisabled/index.d.ts +2 -0
- package/lib/cjs/shared/BackdropScrollDisabled/index.js +5 -0
- package/lib/esm/components/Composer/Composer.js +2 -1
- package/lib/esm/shared/BackdropScrollDisabled/BackdropScrollDisabled.d.ts +5 -0
- package/lib/esm/shared/BackdropScrollDisabled/BackdropScrollDisabled.js +11 -0
- package/lib/esm/shared/BackdropScrollDisabled/index.d.ts +2 -0
- package/lib/esm/shared/BackdropScrollDisabled/index.js +2 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +2 -2
|
@@ -30,6 +30,7 @@ const Attributes_1 = tslib_1.__importDefault(require("./Attributes"));
|
|
|
30
30
|
const constants_1 = require("./constants");
|
|
31
31
|
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
32
32
|
const CloseLayer_1 = tslib_1.__importDefault(require("./Layer/CloseLayer"));
|
|
33
|
+
const BackdropScrollDisabled_1 = tslib_1.__importDefault(require("../../shared/BackdropScrollDisabled"));
|
|
33
34
|
const DialogTransition = (0, react_1.forwardRef)(function Transition(props, ref) {
|
|
34
35
|
return (0, jsx_runtime_1.jsx)(material_1.Fade, Object.assign({ ref: ref }, props));
|
|
35
36
|
});
|
|
@@ -566,7 +567,7 @@ function Composer(inProps) {
|
|
|
566
567
|
if (!scUserContext.user && !(scUserContext.loading && open)) {
|
|
567
568
|
return null;
|
|
568
569
|
}
|
|
569
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ ref: dialogRef, TransitionComponent: DialogTransition, keepMounted: true, onClose: handleClose }, rest, { className: (0, classnames_1.default)(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [(0, jsx_runtime_1.jsxs)("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, Object.assign({ className: classes.title }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleClosePrompt }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "close" }) })), (0, jsx_runtime_1.jsx)(LoadingButton_1.default, Object.assign({ size: "small", type: "submit", color: "secondary", variant: "contained", disabled: !canSubmit, loading: isSubmitting }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.submit", defaultMessage: "ui.composer.submit" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(Attributes_1.default, { value: { categories, event, group, addressing, location }, className: classes.attributes, onChange: handleChangeAttributes, onClick: handleClickAttributes }), content, medias && medias.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.medias }, { children: mediaObjectTypes.map((mediaObjectType) => {
|
|
570
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ ref: dialogRef, TransitionComponent: DialogTransition, BackdropComponent: BackdropScrollDisabled_1.default, keepMounted: true, onClose: handleClose }, rest, { className: (0, classnames_1.default)(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [(0, jsx_runtime_1.jsxs)("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, Object.assign({ className: classes.title }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleClosePrompt }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "close" }) })), (0, jsx_runtime_1.jsx)(LoadingButton_1.default, Object.assign({ size: "small", type: "submit", color: "secondary", variant: "contained", disabled: !canSubmit, loading: isSubmitting }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.submit", defaultMessage: "ui.composer.submit" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(Attributes_1.default, { value: { categories, event, group, addressing, location }, className: classes.attributes, onChange: handleChangeAttributes, onClick: handleClickAttributes }), content, medias && medias.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.medias }, { children: mediaObjectTypes.map((mediaObjectType) => {
|
|
570
571
|
if (mediaObjectType.previewComponent) {
|
|
571
572
|
return (0, jsx_runtime_1.jsx)(mediaObjectType.previewComponent, { value: medias, onChange: handleChangeMedias }, mediaObjectType.name);
|
|
572
573
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
/**
|
|
6
|
+
* Prevents scrolling of content behind the backdrop
|
|
7
|
+
*/
|
|
8
|
+
function BackdropScrollDisabled(props) {
|
|
9
|
+
const onTouchMove = (event) => {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
};
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(material_1.Backdrop, Object.assign({}, props, { onTouchMove: onTouchMove }));
|
|
13
|
+
}
|
|
14
|
+
exports.default = BackdropScrollDisabled;
|
|
@@ -28,6 +28,7 @@ import Attributes from './Attributes';
|
|
|
28
28
|
import { PREFIX } from './constants';
|
|
29
29
|
import ComposerSkeleton from './Skeleton';
|
|
30
30
|
import CloseLayer from './Layer/CloseLayer';
|
|
31
|
+
import BackdropScrollDisabled from '../../shared/BackdropScrollDisabled';
|
|
31
32
|
const DialogTransition = forwardRef(function Transition(props, ref) {
|
|
32
33
|
return _jsx(Fade, Object.assign({ ref: ref }, props));
|
|
33
34
|
});
|
|
@@ -564,7 +565,7 @@ export default function Composer(inProps) {
|
|
|
564
565
|
if (!scUserContext.user && !(scUserContext.loading && open)) {
|
|
565
566
|
return null;
|
|
566
567
|
}
|
|
567
|
-
return (_jsxs(Root, Object.assign({ ref: dialogRef, TransitionComponent: DialogTransition, keepMounted: true, onClose: handleClose }, rest, { className: classNames(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [_jsxs("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: handleClosePrompt }, { children: _jsx(Icon, { children: "close" }) })), _jsx(LoadingButton, Object.assign({ size: "small", type: "submit", color: "secondary", variant: "contained", disabled: !canSubmit, loading: isSubmitting }, { children: _jsx(FormattedMessage, { id: "ui.composer.submit", defaultMessage: "ui.composer.submit" }) }))] })), _jsxs(DialogContent, Object.assign({ className: classes.content }, { children: [_jsx(Attributes, { value: { categories, event, group, addressing, location }, className: classes.attributes, onChange: handleChangeAttributes, onClick: handleClickAttributes }), content, medias && medias.length > 0 && (_jsx(Box, Object.assign({ className: classes.medias }, { children: mediaObjectTypes.map((mediaObjectType) => {
|
|
568
|
+
return (_jsxs(Root, Object.assign({ ref: dialogRef, TransitionComponent: DialogTransition, BackdropComponent: BackdropScrollDisabled, keepMounted: true, onClose: handleClose }, rest, { className: classNames(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [_jsxs("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: handleClosePrompt }, { children: _jsx(Icon, { children: "close" }) })), _jsx(LoadingButton, Object.assign({ size: "small", type: "submit", color: "secondary", variant: "contained", disabled: !canSubmit, loading: isSubmitting }, { children: _jsx(FormattedMessage, { id: "ui.composer.submit", defaultMessage: "ui.composer.submit" }) }))] })), _jsxs(DialogContent, Object.assign({ className: classes.content }, { children: [_jsx(Attributes, { value: { categories, event, group, addressing, location }, className: classes.attributes, onChange: handleChangeAttributes, onClick: handleClickAttributes }), content, medias && medias.length > 0 && (_jsx(Box, Object.assign({ className: classes.medias }, { children: mediaObjectTypes.map((mediaObjectType) => {
|
|
568
569
|
if (mediaObjectType.previewComponent) {
|
|
569
570
|
return _jsx(mediaObjectType.previewComponent, { value: medias, onChange: handleChangeMedias }, mediaObjectType.name);
|
|
570
571
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Backdrop } from '@mui/material';
|
|
3
|
+
/**
|
|
4
|
+
* Prevents scrolling of content behind the backdrop
|
|
5
|
+
*/
|
|
6
|
+
export default function BackdropScrollDisabled(props) {
|
|
7
|
+
const onTouchMove = (event) => {
|
|
8
|
+
event.preventDefault();
|
|
9
|
+
};
|
|
10
|
+
return _jsx(Backdrop, Object.assign({}, props, { onTouchMove: onTouchMove }));
|
|
11
|
+
}
|