@selfcommunity/react-ui 0.7.9-alpha.2 → 0.7.9-alpha.21
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/BottomNavigation/BottomNavigation.js +3 -1
- package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.js +24 -1
- package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +32 -11
- package/lib/cjs/components/Composer/Attributes/Attributes.d.ts +1 -1
- package/lib/cjs/components/Composer/Attributes/Attributes.js +9 -2
- package/lib/cjs/components/Composer/Composer.d.ts +2 -1
- package/lib/cjs/components/Composer/Composer.js +39 -12
- package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +7 -3
- package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +4 -3
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +7 -1
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +46 -12
- package/lib/cjs/components/CreateGroupButton/CreateGroupButton.d.ts +2 -2
- package/lib/cjs/components/CreateGroupButton/CreateGroupButton.js +5 -6
- package/lib/cjs/components/CustomAdv/CustomAdv.d.ts +4 -0
- package/lib/cjs/components/{CreateGroup/CreateGroup.d.ts → EditGroupButton/EditGroupButton.d.ts} +11 -16
- package/lib/cjs/components/EditGroupButton/EditGroupButton.js +61 -0
- package/lib/cjs/components/EditGroupButton/index.d.ts +3 -0
- package/lib/cjs/components/EditGroupButton/index.js +5 -0
- package/lib/cjs/components/FeedObject/FeedObject.d.ts +1 -0
- package/lib/cjs/components/FeedObject/FeedObject.js +23 -6
- package/lib/cjs/components/Group/Group.d.ts +4 -3
- package/lib/cjs/components/Group/Group.js +5 -4
- package/lib/cjs/components/Group/Skeleton.js +1 -1
- package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.d.ts +49 -0
- package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.js +101 -0
- package/lib/cjs/components/GroupAutocomplete/index.d.ts +3 -0
- package/lib/cjs/components/GroupAutocomplete/index.js +5 -0
- package/lib/cjs/components/GroupForm/GroupForm.d.ts +70 -0
- package/lib/cjs/components/GroupForm/GroupForm.js +239 -0
- package/lib/cjs/components/GroupForm/constants.d.ts +1 -0
- package/lib/cjs/components/{CreateGroup → GroupForm}/constants.js +1 -1
- package/lib/cjs/components/GroupForm/index.d.ts +3 -0
- package/lib/cjs/components/GroupForm/index.js +5 -0
- package/lib/cjs/components/GroupHeader/GroupHeader.d.ts +6 -5
- package/lib/cjs/components/GroupHeader/GroupHeader.js +21 -11
- package/lib/cjs/components/GroupHeader/Skeleton.d.ts +2 -4
- package/lib/cjs/components/GroupHeader/Skeleton.js +10 -10
- package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +8 -8
- package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +9 -6
- package/lib/cjs/components/GroupMembersButton/GroupMembersButton.d.ts +5 -0
- package/lib/cjs/components/GroupMembersButton/GroupMembersButton.js +3 -2
- package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +37 -14
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +0 -5
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +17 -7
- package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.d.ts +48 -0
- package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +132 -0
- package/lib/cjs/components/GroupSettingsIconButton/index.d.ts +3 -0
- package/lib/cjs/components/GroupSettingsIconButton/index.js +5 -0
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +8 -3
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +26 -9
- package/lib/cjs/components/Groups/Groups.d.ts +65 -0
- package/lib/cjs/components/Groups/Groups.js +135 -0
- package/lib/cjs/components/Groups/Skeleton.d.ts +34 -0
- package/lib/cjs/components/Groups/Skeleton.js +45 -0
- package/lib/cjs/components/Groups/constants.d.ts +1 -0
- package/lib/cjs/components/Groups/constants.js +4 -0
- package/lib/cjs/components/Groups/index.d.ts +4 -0
- package/lib/cjs/components/Groups/index.js +8 -0
- package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.d.ts +2 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.js +1 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +5 -1
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +4 -0
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +2 -3
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +1 -1
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +10 -7
- package/lib/cjs/components/PrivateMessageSnippetItem/PrivateMessageSnippetItem.js +11 -6
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts +3 -3
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js +24 -6
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts +6 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +45 -20
- package/lib/cjs/index.d.ts +7 -3
- package/lib/cjs/index.js +14 -4
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +3 -1
- package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.js +24 -1
- package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +32 -11
- package/lib/esm/components/Composer/Attributes/Attributes.d.ts +1 -1
- package/lib/esm/components/Composer/Attributes/Attributes.js +9 -2
- package/lib/esm/components/Composer/Composer.d.ts +2 -1
- package/lib/esm/components/Composer/Composer.js +39 -12
- package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +7 -3
- package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +4 -3
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +7 -1
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +45 -12
- package/lib/esm/components/CreateGroupButton/CreateGroupButton.d.ts +2 -2
- package/lib/esm/components/CreateGroupButton/CreateGroupButton.js +5 -6
- package/lib/esm/components/CustomAdv/CustomAdv.d.ts +4 -0
- package/lib/esm/components/{CreateGroup/CreateGroup.d.ts → EditGroupButton/EditGroupButton.d.ts} +11 -16
- package/lib/esm/components/EditGroupButton/EditGroupButton.js +58 -0
- package/lib/esm/components/EditGroupButton/index.d.ts +3 -0
- package/lib/esm/components/EditGroupButton/index.js +2 -0
- package/lib/esm/components/FeedObject/FeedObject.d.ts +1 -0
- package/lib/esm/components/FeedObject/FeedObject.js +24 -7
- package/lib/esm/components/Group/Group.d.ts +4 -3
- package/lib/esm/components/Group/Group.js +5 -4
- package/lib/esm/components/Group/Skeleton.js +1 -1
- package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.d.ts +49 -0
- package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.js +99 -0
- package/lib/esm/components/GroupAutocomplete/index.d.ts +3 -0
- package/lib/esm/components/GroupAutocomplete/index.js +2 -0
- package/lib/esm/components/GroupForm/GroupForm.d.ts +70 -0
- package/lib/esm/components/GroupForm/GroupForm.js +236 -0
- package/lib/esm/components/GroupForm/constants.d.ts +1 -0
- package/lib/esm/components/GroupForm/constants.js +1 -0
- package/lib/esm/components/GroupForm/index.d.ts +3 -0
- package/lib/esm/components/GroupForm/index.js +2 -0
- package/lib/esm/components/GroupHeader/GroupHeader.d.ts +6 -5
- package/lib/esm/components/GroupHeader/GroupHeader.js +21 -11
- package/lib/esm/components/GroupHeader/Skeleton.d.ts +2 -4
- package/lib/esm/components/GroupHeader/Skeleton.js +10 -10
- package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +8 -8
- package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +9 -6
- package/lib/esm/components/GroupMembersButton/GroupMembersButton.d.ts +5 -0
- package/lib/esm/components/GroupMembersButton/GroupMembersButton.js +4 -3
- package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +39 -16
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +0 -5
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +17 -7
- package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.d.ts +48 -0
- package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +129 -0
- package/lib/esm/components/GroupSettingsIconButton/index.d.ts +3 -0
- package/lib/esm/components/GroupSettingsIconButton/index.js +2 -0
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +8 -3
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +27 -10
- package/lib/esm/components/Groups/Groups.d.ts +65 -0
- package/lib/esm/components/Groups/Groups.js +132 -0
- package/lib/esm/components/Groups/Skeleton.d.ts +34 -0
- package/lib/esm/components/Groups/Skeleton.js +42 -0
- package/lib/esm/components/Groups/constants.d.ts +1 -0
- package/lib/esm/components/Groups/constants.js +1 -0
- package/lib/esm/components/Groups/index.d.ts +4 -0
- package/lib/esm/components/Groups/index.js +4 -0
- package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.d.ts +2 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +1 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +5 -1
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +4 -0
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +2 -3
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +1 -1
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +11 -8
- package/lib/esm/components/PrivateMessageSnippetItem/PrivateMessageSnippetItem.js +11 -6
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts +3 -3
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js +26 -8
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts +6 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +47 -22
- package/lib/esm/index.d.ts +7 -3
- package/lib/esm/index.js +8 -4
- package/lib/umd/react-ui.js +1 -1
- package/package.json +6 -6
- package/lib/cjs/components/CreateGroup/CreateGroup.js +0 -187
- package/lib/cjs/components/CreateGroup/constants.d.ts +0 -1
- package/lib/cjs/components/CreateGroup/index.d.ts +0 -3
- package/lib/cjs/components/CreateGroup/index.js +0 -5
- package/lib/esm/components/CreateGroup/CreateGroup.js +0 -184
- package/lib/esm/components/CreateGroup/constants.d.ts +0 -1
- package/lib/esm/components/CreateGroup/constants.js +0 -1
- package/lib/esm/components/CreateGroup/index.d.ts +0 -3
- package/lib/esm/components/CreateGroup/index.js +0 -2
package/lib/cjs/components/{CreateGroup/CreateGroup.d.ts → EditGroupButton/EditGroupButton.d.ts}
RENAMED
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateGroupButtonProps } from '../CreateGroupButton';
|
|
2
2
|
import { SCGroupType } from '@selfcommunity/types';
|
|
3
|
-
export interface
|
|
3
|
+
export interface EditGroupButtonProps extends CreateGroupButtonProps {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Group Object
|
|
6
6
|
* @default null
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Open dialog
|
|
11
|
-
* @default true
|
|
12
|
-
*/
|
|
13
|
-
open?: boolean;
|
|
8
|
+
group?: SCGroupType;
|
|
14
9
|
/**
|
|
15
|
-
*
|
|
10
|
+
* Id of the group
|
|
16
11
|
* @default null
|
|
17
12
|
*/
|
|
18
|
-
|
|
13
|
+
groupId?: number | string;
|
|
19
14
|
/**
|
|
20
|
-
*
|
|
15
|
+
* On edit success callback function
|
|
21
16
|
* @default null
|
|
22
17
|
*/
|
|
23
|
-
|
|
18
|
+
onEditSuccess?: (data: SCGroupType) => void;
|
|
24
19
|
/**
|
|
25
20
|
* Any other properties
|
|
26
21
|
*/
|
|
@@ -35,14 +30,14 @@ export interface CreateGroupProps extends BaseDialogProps {
|
|
|
35
30
|
```
|
|
36
31
|
|
|
37
32
|
#### Component Name
|
|
38
|
-
The name `
|
|
33
|
+
The name `SCEditGroupButton` can be used when providing style overrides in the theme.
|
|
39
34
|
|
|
40
35
|
#### CSS
|
|
41
36
|
|
|
42
37
|
|Rule Name|Global class|Description|
|
|
43
38
|
|---|---|---|
|
|
44
|
-
|root|.
|
|
39
|
+
|root|.SCEditGroupButton-root|Styles applied to the root element.|
|
|
45
40
|
|
|
46
41
|
* @param inProps
|
|
47
42
|
*/
|
|
48
|
-
export default function
|
|
43
|
+
export default function EditGroupButton(inProps: EditGroupButtonProps): JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const system_1 = require("@mui/system");
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const react_intl_1 = require("react-intl");
|
|
8
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
9
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
10
|
+
const CreateGroupButton_1 = tslib_1.__importDefault(require("../CreateGroupButton"));
|
|
11
|
+
const PREFIX = 'SCEditGroupButton';
|
|
12
|
+
const classes = {
|
|
13
|
+
root: `${PREFIX}-root`
|
|
14
|
+
};
|
|
15
|
+
const Root = (0, styles_1.styled)(CreateGroupButton_1.default, {
|
|
16
|
+
name: PREFIX,
|
|
17
|
+
slot: 'Root',
|
|
18
|
+
overridesResolver: (props, styles) => styles.root
|
|
19
|
+
})(({ theme }) => ({}));
|
|
20
|
+
/**
|
|
21
|
+
*> API documentation for the Community-JS Create Group Button component. Learn about the available props and the CSS API.
|
|
22
|
+
*
|
|
23
|
+
#### Import
|
|
24
|
+
```jsx
|
|
25
|
+
import {CreateGroupButton} from '@selfcommunity/react-ui';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### Component Name
|
|
29
|
+
The name `SCEditGroupButton` can be used when providing style overrides in the theme.
|
|
30
|
+
|
|
31
|
+
#### CSS
|
|
32
|
+
|
|
33
|
+
|Rule Name|Global class|Description|
|
|
34
|
+
|---|---|---|
|
|
35
|
+
|root|.SCEditGroupButton-root|Styles applied to the root element.|
|
|
36
|
+
|
|
37
|
+
* @param inProps
|
|
38
|
+
*/
|
|
39
|
+
function EditGroupButton(inProps) {
|
|
40
|
+
//PROPS
|
|
41
|
+
const props = (0, system_1.useThemeProps)({
|
|
42
|
+
props: inProps,
|
|
43
|
+
name: PREFIX
|
|
44
|
+
});
|
|
45
|
+
const { className, groupId, group, onEditSuccess } = props, rest = tslib_1.__rest(props, ["className", "groupId", "group", "onEditSuccess"]);
|
|
46
|
+
const { scGroup, setSCGroup } = (0, react_core_1.useSCFetchGroup)({ id: groupId, group });
|
|
47
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
48
|
+
const handleSuccess = (data) => {
|
|
49
|
+
setSCGroup(data);
|
|
50
|
+
onEditSuccess && onEditSuccess(data);
|
|
51
|
+
};
|
|
52
|
+
if (!scUserContext.user) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Renders root object
|
|
57
|
+
*/
|
|
58
|
+
return (react_1.default.createElement(Root, Object.assign({ variant: "outlined", className: (0, classnames_1.default)(classes.root, className), GroupFormProps: { group: scGroup, onSuccess: handleSuccess } }, rest),
|
|
59
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.editGroupButton", defaultMessage: "ui.editGroupButton" })));
|
|
60
|
+
}
|
|
61
|
+
exports.default = EditGroupButton;
|
|
@@ -188,6 +188,7 @@ export interface FeedObjectProps extends CardProps, VirtualScrollerItemProps {
|
|
|
188
188
|
|deleted|.SCFeedObject-deleted|Styles applied to the feed obj when is deleted (visible only for admin and moderator).|
|
|
189
189
|
|header|.SCFeedObject-header|Styles applied to the header of the card.|
|
|
190
190
|
|category|.SCFeedObject-category|Styles applied to the category element.|
|
|
191
|
+
|group|.SCFeedObject-group|Styles applied to the group element.|
|
|
191
192
|
|avatar|.SCFeedObject-avatar|Styles applied to the avatar element.|
|
|
192
193
|
|username|.SCFeedObject-username|Styles applied to the username element.|
|
|
193
194
|
|activityAt|.SCFeedObject-activity-at|Styles applied to the activity at section.|
|
|
@@ -42,6 +42,10 @@ const messages = (0, react_intl_1.defineMessages)({
|
|
|
42
42
|
visibleToAll: {
|
|
43
43
|
id: 'ui.feedObject.visibleToAll',
|
|
44
44
|
defaultMessage: 'ui.feedObject.visibleToAll'
|
|
45
|
+
},
|
|
46
|
+
visibleToGroup: {
|
|
47
|
+
id: 'ui.feedObject.visibleToGroup',
|
|
48
|
+
defaultMessage: 'ui.feedObject.visibleToGroup'
|
|
45
49
|
}
|
|
46
50
|
});
|
|
47
51
|
const classes = {
|
|
@@ -49,6 +53,7 @@ const classes = {
|
|
|
49
53
|
deleted: `${constants_1.PREFIX}-deleted`,
|
|
50
54
|
header: `${constants_1.PREFIX}-header`,
|
|
51
55
|
category: `${constants_1.PREFIX}-category`,
|
|
56
|
+
group: `${constants_1.PREFIX}-group`,
|
|
52
57
|
avatar: `${constants_1.PREFIX}-avatar`,
|
|
53
58
|
username: `${constants_1.PREFIX}-username`,
|
|
54
59
|
activityAt: `${constants_1.PREFIX}-activity-at`,
|
|
@@ -102,6 +107,7 @@ const Root = (0, styles_1.styled)(Widget_1.default, {
|
|
|
102
107
|
|deleted|.SCFeedObject-deleted|Styles applied to the feed obj when is deleted (visible only for admin and moderator).|
|
|
103
108
|
|header|.SCFeedObject-header|Styles applied to the header of the card.|
|
|
104
109
|
|category|.SCFeedObject-category|Styles applied to the category element.|
|
|
110
|
+
|group|.SCFeedObject-group|Styles applied to the group element.|
|
|
105
111
|
|avatar|.SCFeedObject-avatar|Styles applied to the avatar element.|
|
|
106
112
|
|username|.SCFeedObject-username|Styles applied to the username element.|
|
|
107
113
|
|activityAt|.SCFeedObject-activity-at|Styles applied to the activity at section.|
|
|
@@ -169,7 +175,7 @@ function FeedObject(inProps) {
|
|
|
169
175
|
}, [onStateChange, onHeightChange]);
|
|
170
176
|
/**
|
|
171
177
|
* Update state object
|
|
172
|
-
* @param
|
|
178
|
+
* @param newObj
|
|
173
179
|
*/
|
|
174
180
|
const updateObject = (newObj) => {
|
|
175
181
|
setObj(newObj);
|
|
@@ -426,8 +432,13 @@ function FeedObject(inProps) {
|
|
|
426
432
|
template === feedObject_1.SCFeedObjectTemplateType.DETAIL ||
|
|
427
433
|
template === feedObject_1.SCFeedObjectTemplateType.SEARCH) {
|
|
428
434
|
objElement = (react_1.default.createElement(react_1.default.Fragment, null, obj ? (react_1.default.createElement(material_1.Box, { className: (0, classnames_1.default)({ [classes.deleted]: obj && obj.deleted }) },
|
|
429
|
-
obj.categories.length > 0 && (react_1.default.createElement("div", { className: classes.category },
|
|
430
|
-
react_1.default.createElement(
|
|
435
|
+
obj.categories.length > 0 && (react_1.default.createElement("div", { className: classes.category },
|
|
436
|
+
react_1.default.createElement(react_1.default.Fragment, null, obj.group && (react_1.default.createElement("div", { className: classes.group },
|
|
437
|
+
react_1.default.createElement(material_1.Chip, { color: "secondary", size: "small", key: obj.group.id, icon: react_1.default.createElement(Icon_1.default, null, "groups"), component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true })))),
|
|
438
|
+
obj.categories.map((c) => (react_1.default.createElement(react_core_1.Link, { to: scRoutingContext.url(react_core_1.SCRoutes.CATEGORY_ROUTE_NAME, c), key: c.id },
|
|
439
|
+
react_1.default.createElement(material_1.Typography, { variant: "overline" }, c.name)))))),
|
|
440
|
+
obj.group && !obj.categories.length && (react_1.default.createElement("div", { className: classes.group },
|
|
441
|
+
react_1.default.createElement(material_1.Chip, { color: "secondary", size: "small", key: obj.group.id, icon: react_1.default.createElement(Icon_1.default, null, "groups"), label: obj.group.name, component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }))),
|
|
431
442
|
react_1.default.createElement(material_1.CardHeader, { className: classes.header, avatar: react_1.default.createElement(react_core_1.Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null }),
|
|
432
443
|
react_1.default.createElement(UserAvatar_1.default, { hide: !obj.author.community_badge },
|
|
433
444
|
react_1.default.createElement(material_1.Avatar, { "aria-label": "recipe", src: obj.author.avatar, className: classes.avatar }, obj.author.username))), title: react_1.default.createElement(react_core_1.Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }), obj.author.username), subheader: react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -439,7 +450,8 @@ function FeedObject(inProps) {
|
|
|
439
450
|
react_1.default.createElement(Icon_1.default, null, "add_location_alt"), (_a = obj.location) === null || _a === void 0 ? void 0 :
|
|
440
451
|
_a.location))),
|
|
441
452
|
react_1.default.createElement(Bullet_1.default, null),
|
|
442
|
-
react_1.default.createElement(material_1.Box, { className: classes.tag }, obj.addressing.length > 0 ? (react_1.default.createElement(Tags_1.default, { tags: obj.addressing, TagChipProps: { disposable: false, clickable: false } })) : (react_1.default.createElement(material_1.Tooltip, { title: `${intl.formatMessage(messages.
|
|
453
|
+
react_1.default.createElement(material_1.Box, { className: classes.tag }, obj.addressing.length > 0 ? (react_1.default.createElement(Tags_1.default, { tags: obj.addressing, TagChipProps: { disposable: false, clickable: false } })) : obj.group ? (react_1.default.createElement(material_1.Tooltip, { title: `${intl.formatMessage(messages.visibleToGroup, { group: obj.group.name })}` },
|
|
454
|
+
react_1.default.createElement(Icon_1.default, { color: "disabled", fontSize: "small" }, "groups"))) : (react_1.default.createElement(material_1.Tooltip, { title: `${intl.formatMessage(messages.visibleToAll)}` },
|
|
443
455
|
react_1.default.createElement(Icon_1.default, { color: "disabled", fontSize: "small" }, "public"))))), action: renderHeaderAction() }),
|
|
444
456
|
react_1.default.createElement(CardContent_1.default, { classes: { root: classes.content } },
|
|
445
457
|
react_1.default.createElement(material_1.Box, { className: classes.titleSection }, 'title' in obj && (react_1.default.createElement(react_1.default.Fragment, null, template === feedObject_1.SCFeedObjectTemplateType.DETAIL ? (react_1.default.createElement(material_1.Typography, { variant: "body1", gutterBottom: true, className: classes.title }, obj.title)) : (react_1.default.createElement(react_core_1.Link, { to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(obj), (0, contribution_1.getRouteData)(obj)) },
|
|
@@ -468,8 +480,13 @@ function FeedObject(inProps) {
|
|
|
468
480
|
}
|
|
469
481
|
else if (template === feedObject_1.SCFeedObjectTemplateType.SHARE) {
|
|
470
482
|
objElement = (react_1.default.createElement(react_1.default.Fragment, null, obj ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
471
|
-
obj.categories.length > 0 && (react_1.default.createElement("div", { className: classes.category },
|
|
472
|
-
react_1.default.createElement(
|
|
483
|
+
obj.categories.length > 0 && (react_1.default.createElement("div", { className: classes.category },
|
|
484
|
+
react_1.default.createElement(react_1.default.Fragment, null, obj.group && (react_1.default.createElement("div", { className: classes.group },
|
|
485
|
+
react_1.default.createElement(material_1.Chip, { color: "secondary", size: "small", key: obj.group.id, icon: react_1.default.createElement(Icon_1.default, null, "groups"), component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true })))),
|
|
486
|
+
obj.categories.map((c) => (react_1.default.createElement(react_core_1.Link, { to: scRoutingContext.url(react_core_1.SCRoutes.CATEGORY_ROUTE_NAME, c), key: c.id },
|
|
487
|
+
react_1.default.createElement(material_1.Typography, { variant: "overline" }, c.name)))))),
|
|
488
|
+
obj.group && !obj.categories.length && (react_1.default.createElement("div", { className: classes.group },
|
|
489
|
+
react_1.default.createElement(material_1.Chip, { color: "secondary", size: "small", key: obj.group.id, icon: react_1.default.createElement(Icon_1.default, null, "groups"), label: obj.group.name, component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }))),
|
|
473
490
|
react_1.default.createElement(material_1.CardHeader, { classes: { root: classes.header }, avatar: react_1.default.createElement(react_core_1.Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }),
|
|
474
491
|
react_1.default.createElement(UserAvatar_1.default, { hide: !obj.author.community_badge },
|
|
475
492
|
react_1.default.createElement(material_1.Avatar, { "aria-label": "recipe", src: obj.author.avatar, className: classes.avatar }, obj.author.username))), title: react_1.default.createElement(react_core_1.Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }), obj.author.username), subheader: react_1.default.createElement(react_core_1.Link, { to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(obj), (0, contribution_1.getRouteData)(obj)), className: classes.activityAt },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ButtonBaseProps } from '@mui/material';
|
|
2
2
|
import { SCGroupType } from '@selfcommunity/types';
|
|
3
3
|
import { WidgetProps } from '../Widget';
|
|
4
|
+
import { GroupSubscribeButtonProps } from '../GroupSubscribeButton';
|
|
4
5
|
export interface GroupProps extends WidgetProps {
|
|
5
6
|
/**
|
|
6
7
|
* Group Object
|
|
@@ -13,10 +14,10 @@ export interface GroupProps extends WidgetProps {
|
|
|
13
14
|
*/
|
|
14
15
|
groupId?: number;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @default
|
|
17
|
+
* Props to spread to group subscribe/unsubscribe button
|
|
18
|
+
* @default {}
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
groupSubscribeButtonProps?: GroupSubscribeButtonProps;
|
|
20
21
|
/**
|
|
21
22
|
* Badge content to show as group avatar badge if show reaction is true.
|
|
22
23
|
*/
|
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const styles_1 = require("@mui/material/styles");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
|
+
const types_1 = require("@selfcommunity/types");
|
|
7
8
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
8
9
|
const react_intl_1 = require("react-intl");
|
|
9
10
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
@@ -63,7 +64,7 @@ function Group(inProps) {
|
|
|
63
64
|
props: inProps,
|
|
64
65
|
name: constants_1.PREFIX
|
|
65
66
|
});
|
|
66
|
-
const { groupId = null, group = null,
|
|
67
|
+
const { groupId = null, group = null, className = null, elevation, hideActions = false, groupSubscribeButtonProps = {} } = props, rest = tslib_1.__rest(props, ["groupId", "group", "className", "elevation", "hideActions", "groupSubscribeButtonProps"]);
|
|
67
68
|
// STATE
|
|
68
69
|
const { scGroup } = (0, react_core_1.useSCFetchGroup)({ id: groupId, group });
|
|
69
70
|
// CONTEXT
|
|
@@ -77,8 +78,8 @@ function Group(inProps) {
|
|
|
77
78
|
*/
|
|
78
79
|
function renderAuthenticatedActions() {
|
|
79
80
|
return (react_1.default.createElement(material_1.Stack, { className: classes.actions, direction: "row", alignItems: "center", justifyContent: "center", spacing: 2 },
|
|
80
|
-
react_1.default.createElement(material_1.Icon, null,
|
|
81
|
-
react_1.default.createElement(GroupSubscribeButton_1.default, { group: group, groupId: groupId })));
|
|
81
|
+
react_1.default.createElement(material_1.Icon, null, (group === null || group === void 0 ? void 0 : group.privacy) === types_1.SCGroupPrivacyType.PRIVATE ? 'private' : 'public'),
|
|
82
|
+
react_1.default.createElement(GroupSubscribeButton_1.default, Object.assign({ group: group, groupId: groupId }, groupSubscribeButtonProps))));
|
|
82
83
|
}
|
|
83
84
|
/**
|
|
84
85
|
* Renders group object
|
|
@@ -90,7 +91,7 @@ function Group(inProps) {
|
|
|
90
91
|
* Renders root object
|
|
91
92
|
*/
|
|
92
93
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
93
|
-
react_1.default.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: (0, classnames_1.default)(classes.root, className), ButtonBaseProps:
|
|
94
|
+
react_1.default.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: (0, classnames_1.default)(classes.root, className), ButtonBaseProps: { component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, scGroup) }, image: react_1.default.createElement(material_1.Avatar, { alt: scGroup.name, src: scGroup.image_medium, className: classes.avatar }), primary: scGroup.name, secondary: `${intl.formatMessage(messages.groupMembers, { total: scGroup.subscribers_counter })}`, actions: hideActions ? null : renderAuthenticatedActions() })),
|
|
94
95
|
openAlert && react_1.default.createElement(UserDeletedSnackBar_1.default, { open: openAlert, handleClose: () => setOpenAlert(false) })));
|
|
95
96
|
}
|
|
96
97
|
exports.default = Group;
|
|
@@ -36,7 +36,7 @@ const Root = (0, styles_1.styled)(BaseItem_1.default, {
|
|
|
36
36
|
*/
|
|
37
37
|
function GroupSkeleton(props) {
|
|
38
38
|
const theme = (0, material_1.useTheme)();
|
|
39
|
-
return (react_1.default.createElement(Root, Object.assign({ className: classes.root }, props, { image: react_1.default.createElement(Skeleton_1.default, { animation: "wave", variant: "circular", width: theme.selfcommunity.
|
|
39
|
+
return (react_1.default.createElement(Root, Object.assign({ className: classes.root }, props, { image: react_1.default.createElement(Skeleton_1.default, { animation: "wave", variant: "circular", width: theme.selfcommunity.group.avatar.sizeSmall, height: theme.selfcommunity.group.avatar.sizeSmall }), primary: react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 120, style: { marginBottom: 10 } }), secondary: react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 70, style: { marginBottom: 10 } }), actions: react_1.default.createElement(material_1.Button, { size: "small", variant: "outlined", disabled: true },
|
|
40
40
|
react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 30, style: { marginTop: 5, marginBottom: 5 } })) })));
|
|
41
41
|
}
|
|
42
42
|
exports.default = GroupSkeleton;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
2
|
+
import { AutocompleteProps } from '@mui/material';
|
|
3
|
+
import { SCGroupType } from '@selfcommunity/types/src/index';
|
|
4
|
+
export interface GroupAutocompleteProps extends Pick<AutocompleteProps<SCGroupType | null, any, any, any>, Exclude<keyof AutocompleteProps<SCGroupType | null, any, any, any>, 'open' | 'onOpen' | 'onClose' | 'onChange' | 'filterSelectedOptions' | 'disableCloseOnSelect' | 'options' | 'getOptionLabel' | 'value' | 'selectOnFocus' | 'clearOnBlur' | 'blurOnSelect' | 'handleHomeEndKeys' | 'clearIcon' | 'noOptionsText' | 'isOptionEqualToValue' | 'renderTags' | 'renderOption' | 'renderInput'>> {
|
|
5
|
+
/**
|
|
6
|
+
* The maximum number of groups that will be visible when not focused.
|
|
7
|
+
* @default 0
|
|
8
|
+
*/
|
|
9
|
+
limitCountGroups?: number;
|
|
10
|
+
/**
|
|
11
|
+
* If checkbox is selected
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
checkboxSelect?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The props applied to text field
|
|
17
|
+
* @default {variant: 'outlined, label: groups_label}
|
|
18
|
+
*/
|
|
19
|
+
TextFieldProps?: TextFieldProps;
|
|
20
|
+
/**
|
|
21
|
+
* Callback for change event on poll object
|
|
22
|
+
* @param value
|
|
23
|
+
*/
|
|
24
|
+
onChange?: (value: any) => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* > API documentation for the Community-JS Group Autocomplete component. Learn about the available props and the CSS API.
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
* This component renders a bar that allows users to search (with autocomplete) for all the groups available in the application.
|
|
31
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/GroupAutocomplete)
|
|
32
|
+
*
|
|
33
|
+
* #### Import
|
|
34
|
+
* ```jsx
|
|
35
|
+
* import {GroupAutocomplete} from '@selfcommunity/react-ui';
|
|
36
|
+
* ```
|
|
37
|
+
* #### Component Name
|
|
38
|
+
* The name `SCGroupAutocomplete` can be used when providing style overrides in the theme.
|
|
39
|
+
*
|
|
40
|
+
* #### CSS
|
|
41
|
+
*
|
|
42
|
+
* |Rule Name|Global class|Description|
|
|
43
|
+
* |---|---|---|
|
|
44
|
+
* |root|.SCGroupAutocomplete-root|Styles applied to the root element.|
|
|
45
|
+
*
|
|
46
|
+
* @param inProps
|
|
47
|
+
*/
|
|
48
|
+
declare const GroupAutocomplete: (inProps: GroupAutocompleteProps) => JSX.Element;
|
|
49
|
+
export default GroupAutocomplete;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const react_intl_1 = require("react-intl");
|
|
6
|
+
const Autocomplete_1 = tslib_1.__importDefault(require("@mui/material/Autocomplete"));
|
|
7
|
+
const TextField_1 = tslib_1.__importDefault(require("@mui/material/TextField"));
|
|
8
|
+
const CircularProgress_1 = tslib_1.__importDefault(require("@mui/material/CircularProgress"));
|
|
9
|
+
const parse_1 = tslib_1.__importDefault(require("autosuggest-highlight/parse"));
|
|
10
|
+
const match_1 = tslib_1.__importDefault(require("autosuggest-highlight/match"));
|
|
11
|
+
const material_1 = require("@mui/material");
|
|
12
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
13
|
+
const styles_1 = require("@mui/material/styles");
|
|
14
|
+
const system_1 = require("@mui/system");
|
|
15
|
+
const PREFIX = 'SCGroupAutocomplete';
|
|
16
|
+
const classes = {
|
|
17
|
+
root: `${PREFIX}-root`
|
|
18
|
+
};
|
|
19
|
+
const Root = (0, styles_1.styled)(Autocomplete_1.default, {
|
|
20
|
+
name: PREFIX,
|
|
21
|
+
slot: 'Root',
|
|
22
|
+
overridesResolver: (props, styles) => styles.root
|
|
23
|
+
})(() => ({}));
|
|
24
|
+
/**
|
|
25
|
+
* > API documentation for the Community-JS Group Autocomplete component. Learn about the available props and the CSS API.
|
|
26
|
+
*
|
|
27
|
+
*
|
|
28
|
+
* This component renders a bar that allows users to search (with autocomplete) for all the groups available in the application.
|
|
29
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/GroupAutocomplete)
|
|
30
|
+
*
|
|
31
|
+
* #### Import
|
|
32
|
+
* ```jsx
|
|
33
|
+
* import {GroupAutocomplete} from '@selfcommunity/react-ui';
|
|
34
|
+
* ```
|
|
35
|
+
* #### Component Name
|
|
36
|
+
* The name `SCGroupAutocomplete` can be used when providing style overrides in the theme.
|
|
37
|
+
*
|
|
38
|
+
* #### CSS
|
|
39
|
+
*
|
|
40
|
+
* |Rule Name|Global class|Description|
|
|
41
|
+
* |---|---|---|
|
|
42
|
+
* |root|.SCGroupAutocomplete-root|Styles applied to the root element.|
|
|
43
|
+
*
|
|
44
|
+
* @param inProps
|
|
45
|
+
*/
|
|
46
|
+
const GroupAutocomplete = (inProps) => {
|
|
47
|
+
const props = (0, system_1.useThemeProps)({
|
|
48
|
+
props: inProps,
|
|
49
|
+
name: PREFIX
|
|
50
|
+
});
|
|
51
|
+
// Props
|
|
52
|
+
const { onChange, defaultValue = null, disabled = false, TextFieldProps = {
|
|
53
|
+
variant: 'outlined',
|
|
54
|
+
label: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupAutocomplete.label", defaultMessage: "ui.groupAutocomplete.label" })
|
|
55
|
+
} } = props, rest = tslib_1.__rest(props, ["onChange", "defaultValue", "disabled", "TextFieldProps"]);
|
|
56
|
+
// State
|
|
57
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
58
|
+
const [value, setValue] = (0, react_1.useState)(typeof defaultValue === 'string' ? null : defaultValue);
|
|
59
|
+
// HOOKS
|
|
60
|
+
const { groups, isLoading } = (0, react_core_1.useSCFetchGroups)();
|
|
61
|
+
(0, react_1.useEffect)(() => {
|
|
62
|
+
if (value === null) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
onChange && onChange(value);
|
|
66
|
+
}, [value]);
|
|
67
|
+
(0, react_1.useEffect)(() => {
|
|
68
|
+
if (!isLoading && typeof defaultValue === 'string') {
|
|
69
|
+
setValue(groups.find((g) => g.id === Number(defaultValue)));
|
|
70
|
+
}
|
|
71
|
+
}, [isLoading]);
|
|
72
|
+
// Handlers
|
|
73
|
+
const handleOpen = () => {
|
|
74
|
+
setOpen(true);
|
|
75
|
+
};
|
|
76
|
+
const handleClose = () => {
|
|
77
|
+
setOpen(false);
|
|
78
|
+
};
|
|
79
|
+
const handleChange = (event, value) => {
|
|
80
|
+
setValue(value);
|
|
81
|
+
};
|
|
82
|
+
// Render
|
|
83
|
+
return (react_1.default.createElement(Root, Object.assign({ freeSolo: true, className: classes.root, open: open, onOpen: handleOpen, onClose: handleClose, options: groups || [], getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, blurOnSelect: true, handleHomeEndKeys: true, clearIcon: null, disabled: disabled || isLoading, noOptionsText: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupAutocomplete.empty", defaultMessage: "ui.groupAutocomplete.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => value.id === option.id,
|
|
84
|
+
// renderTags={(value, getTagProps) => {
|
|
85
|
+
// return value.map((option: any, index) => (
|
|
86
|
+
// <Chip key={option.id} id={option.id} label={option.name} color={option.color} {...getTagProps({index})} />
|
|
87
|
+
// ));
|
|
88
|
+
// }}
|
|
89
|
+
renderOption: (props, option, { inputValue }) => {
|
|
90
|
+
const matches = (0, match_1.default)(option.name, inputValue);
|
|
91
|
+
const parts = (0, parse_1.default)(option.name, matches);
|
|
92
|
+
return (react_1.default.createElement(material_1.Box, Object.assign({ component: "li" }, props),
|
|
93
|
+
react_1.default.createElement(material_1.Avatar, { alt: option.name, src: option.image_small, sx: { marginRight: 1 } }),
|
|
94
|
+
react_1.default.createElement(react_1.default.Fragment, null, parts.map((part, index) => (react_1.default.createElement(material_1.Typography, { key: index, sx: { fontWeight: part.highlight ? 700 : 400, marginRight: 0.2 } }, part.text))))));
|
|
95
|
+
}, renderInput: (params) => {
|
|
96
|
+
return (react_1.default.createElement(TextField_1.default, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'groups', endAdornment: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
97
|
+
isLoading ? react_1.default.createElement(CircularProgress_1.default, { color: "inherit", size: 20 }) : null,
|
|
98
|
+
params.InputProps.endAdornment)) }) })));
|
|
99
|
+
} }, rest)));
|
|
100
|
+
};
|
|
101
|
+
exports.default = GroupAutocomplete;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { BaseDialogProps } from '../../shared/BaseDialog';
|
|
2
|
+
import { SCGroupType } from '@selfcommunity/types';
|
|
3
|
+
export interface GroupFormProps extends BaseDialogProps {
|
|
4
|
+
/**
|
|
5
|
+
* Overrides or extends the styles applied to the component.
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Open dialog
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
open?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* On dialog close callback function
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Group Object
|
|
21
|
+
* @default null
|
|
22
|
+
*/
|
|
23
|
+
group?: SCGroupType;
|
|
24
|
+
/**
|
|
25
|
+
* On success callback function
|
|
26
|
+
* @default null
|
|
27
|
+
*/
|
|
28
|
+
onSuccess?: (data: SCGroupType) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Any other properties
|
|
31
|
+
*/
|
|
32
|
+
[p: string]: any;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*> API documentation for the Community-JS Group Form component. Learn about the available props and the CSS API.
|
|
36
|
+
*
|
|
37
|
+
#### Import
|
|
38
|
+
```jsx
|
|
39
|
+
import {GroupForm} from '@selfcommunity/react-ui';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Component Name
|
|
43
|
+
The name `SCGroupForm` can be used when providing style overrides in the theme.
|
|
44
|
+
|
|
45
|
+
#### CSS
|
|
46
|
+
|
|
47
|
+
|Rule Name|Global class|Description|
|
|
48
|
+
|---|---|---|
|
|
49
|
+
|root|.SCGroupForm-root|Styles applied to the root element.|
|
|
50
|
+
|active|.SCGroupForm-active|Styles applied to the active element.|
|
|
51
|
+
|title|.SCGroupForm-title|Styles applied to the title element.|
|
|
52
|
+
|header|.SCGroupForm-header|Styles applied to the header element.|
|
|
53
|
+
|cover|.SCGroupForm-cover|Styles applied to the cover field.|
|
|
54
|
+
|avatar|.SCGroupForm-avatar|Styles applied to the avatar field.|
|
|
55
|
+
|form|.SCGroupForm-form|Styles applied to the form element.|
|
|
56
|
+
|switch|.SCGroupForm-switch|Styles applied to the switch element.|
|
|
57
|
+
|switchLabel|.SCGroupForm-switch-label|Styles applied to the switchLabel element.|
|
|
58
|
+
|name|.SCGroupForm-name|Styles applied to the name field.|
|
|
59
|
+
|description|.SCGroupForm-description|Styles applied to the description field.|
|
|
60
|
+
|content|.SCGroupForm-content|Styles applied to the element.|
|
|
61
|
+
|privacySection|.SCGroupForm-privacy-section|Styles applied to the privacy section.|
|
|
62
|
+
|privacySectionInfo|.SCGroupForm-privacy-section-info|Styles applied to the privacy info section.|
|
|
63
|
+
|visibilitySection|.SCGroupForm-visibility-section|Styles applied to the visibility section.|
|
|
64
|
+
|visibilitySectionInfo|.SCGroupForm-visibility-section-info|Styles applied to the visibility section info.|
|
|
65
|
+
|inviteSection|.SCGroupForm-invite-section|Styles applied to the invite section.|
|
|
66
|
+
|error|.SCGroupForm-error|Styles applied to the error elements.|
|
|
67
|
+
|
|
68
|
+
* @param inProps
|
|
69
|
+
*/
|
|
70
|
+
export default function GroupForm(inProps: GroupFormProps): JSX.Element;
|