@selfcommunity/react-ui 0.7.0-alpha.136 → 0.7.0-alpha.138
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/CommentObject/CommentObject.d.ts +5 -5
- package/lib/cjs/components/CommentObject/CommentObject.d.ts.map +1 -1
- package/lib/cjs/components/CommentObject/CommentObject.js +14 -252
- package/lib/cjs/components/CommentObject/CommentObject.js.map +1 -1
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.d.ts +3 -3
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.d.ts.map +1 -1
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js +1 -1
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js.map +1 -1
- package/lib/cjs/components/CommentsObject/CommentsObject.d.ts +3 -3
- package/lib/cjs/components/CommentsObject/CommentsObject.d.ts.map +1 -1
- package/lib/cjs/components/CommentsObject/CommentsObject.js +1 -1
- package/lib/cjs/components/CommentsObject/CommentsObject.js.map +1 -1
- package/lib/cjs/components/Composer/Composer.d.ts +2 -2
- package/lib/cjs/components/Composer/Composer.d.ts.map +1 -1
- package/lib/cjs/components/Composer/Composer.js +1 -125
- package/lib/cjs/components/Composer/Composer.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Actions.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Actions.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Actions.js +4 -7
- package/lib/cjs/components/FeedObject/Actions/Actions.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/Share.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Share/Share.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Vote/Vote.d.ts +2 -18
- package/lib/cjs/components/FeedObject/Actions/Vote/Vote.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Vote/Vote.js +10 -277
- package/lib/cjs/components/FeedObject/Actions/Vote/Vote.js.map +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.d.ts +4 -4
- package/lib/cjs/components/FeedObject/Activities/Activities.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js.map +1 -1
- package/lib/cjs/components/FeedObject/Contributors/Contributors.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Contributors/Contributors.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.d.ts +2 -2
- package/lib/cjs/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.js +8 -9
- package/lib/cjs/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/cjs/components/FeedObject/Poll/Poll.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Poll/Poll.js +1 -1
- package/lib/cjs/components/FeedObject/Poll/Poll.js.map +1 -1
- package/lib/cjs/components/InlineComposer/InlineComposer.d.ts.map +1 -1
- package/lib/cjs/components/InlineComposer/InlineComposer.js +1 -20
- package/lib/cjs/components/InlineComposer/InlineComposer.js.map +1 -1
- package/lib/cjs/components/Notification/Comment/Comment.d.ts +2 -12
- package/lib/cjs/components/Notification/Comment/Comment.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Comment/Comment.js +7 -12
- package/lib/cjs/components/Notification/Comment/Comment.js.map +1 -1
- package/lib/cjs/components/Notification/Contribution/Contribution.d.ts +2 -12
- package/lib/cjs/components/Notification/Contribution/Contribution.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Contribution/Contribution.js +11 -16
- package/lib/cjs/components/Notification/Contribution/Contribution.js.map +1 -1
- package/lib/cjs/components/Notification/Notification.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Notification.js +7 -33
- package/lib/cjs/components/Notification/Notification.js.map +1 -1
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +11 -265
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js.map +1 -1
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js +81 -4
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts +11 -27
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +198 -9
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/Skeleton.js +2 -2
- package/lib/cjs/components/PrivateMessageThread/Skeleton.js.map +1 -1
- package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.js +2 -4
- package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.js.map +1 -1
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.d.ts +2 -2
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.js.map +1 -1
- package/lib/cjs/components/User/User.d.ts +3 -8
- package/lib/cjs/components/User/User.d.ts.map +1 -1
- package/lib/cjs/components/User/User.js +6 -28
- package/lib/cjs/components/User/User.js.map +1 -1
- package/lib/cjs/components/UserInfoDialog/UserInfoDialog.d.ts +1 -1
- package/lib/cjs/components/UserInfoDialog/UserInfoDialog.d.ts.map +1 -1
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts +50 -0
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts.map +1 -0
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +174 -0
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js.map +1 -0
- package/lib/cjs/components/VoteAudienceButton/index.d.ts +4 -0
- package/lib/cjs/components/VoteAudienceButton/index.d.ts.map +1 -0
- package/lib/cjs/components/{CommentObject/Reactions/ReactionsDialog → VoteAudienceButton}/index.js +2 -2
- package/lib/cjs/components/VoteAudienceButton/index.js.map +1 -0
- package/lib/cjs/components/VoteButton/VoteButton.d.ts +53 -0
- package/lib/cjs/components/VoteButton/VoteButton.d.ts.map +1 -0
- package/lib/cjs/components/VoteButton/VoteButton.js +152 -0
- package/lib/cjs/components/VoteButton/VoteButton.js.map +1 -0
- package/lib/cjs/components/VoteButton/index.d.ts +4 -0
- package/lib/cjs/components/VoteButton/index.d.ts.map +1 -0
- package/lib/cjs/components/{FeedObject/Actions/Reaction → VoteButton}/index.js +2 -2
- package/lib/cjs/components/VoteButton/index.js.map +1 -0
- package/lib/cjs/shared/BaseDialog/BaseDialog.d.ts +11 -0
- package/lib/cjs/shared/BaseDialog/BaseDialog.d.ts.map +1 -1
- package/lib/cjs/shared/BaseDialog/BaseDialog.js +3 -8
- package/lib/cjs/shared/BaseDialog/BaseDialog.js.map +1 -1
- package/lib/cjs/shared/ContributionActionsMenu/index.d.ts +2 -2
- package/lib/cjs/shared/ContributionActionsMenu/index.d.ts.map +1 -1
- package/lib/cjs/shared/ContributionActionsMenu/index.js +14 -15
- package/lib/cjs/shared/ContributionActionsMenu/index.js.map +1 -1
- package/lib/cjs/utils/contribution.d.ts +2 -2
- package/lib/cjs/utils/contribution.d.ts.map +1 -1
- package/lib/cjs/utils/contribution.js +15 -17
- package/lib/cjs/utils/contribution.js.map +1 -1
- package/lib/esm/components/CommentObject/CommentObject.d.ts +5 -5
- package/lib/esm/components/CommentObject/CommentObject.d.ts.map +1 -1
- package/lib/esm/components/CommentObject/CommentObject.js +20 -258
- package/lib/esm/components/CommentObject/CommentObject.js.map +1 -1
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.d.ts +3 -3
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.d.ts.map +1 -1
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js +3 -3
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js.map +1 -1
- package/lib/esm/components/CommentsObject/CommentsObject.d.ts +3 -3
- package/lib/esm/components/CommentsObject/CommentsObject.d.ts.map +1 -1
- package/lib/esm/components/CommentsObject/CommentsObject.js +2 -2
- package/lib/esm/components/CommentsObject/CommentsObject.js.map +1 -1
- package/lib/esm/components/Composer/Composer.d.ts +2 -2
- package/lib/esm/components/Composer/Composer.d.ts.map +1 -1
- package/lib/esm/components/Composer/Composer.js +2 -126
- package/lib/esm/components/Composer/Composer.js.map +1 -1
- package/lib/esm/components/Editor/plugins/ImagePlugin.js +1 -1
- package/lib/esm/components/Editor/plugins/ImagePlugin.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Actions.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Actions.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Actions.js +6 -9
- package/lib/esm/components/FeedObject/Actions/Actions.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.js +3 -3
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.js +3 -3
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Share/Share.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Share/Share.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +2 -2
- package/lib/esm/components/FeedObject/Actions/Share/Share.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js +2 -2
- package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Vote/Vote.d.ts +2 -18
- package/lib/esm/components/FeedObject/Actions/Vote/Vote.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Vote/Vote.js +12 -255
- package/lib/esm/components/FeedObject/Actions/Vote/Vote.js.map +1 -1
- package/lib/esm/components/FeedObject/Activities/Activities.d.ts +4 -4
- package/lib/esm/components/FeedObject/Activities/Activities.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Activities/Activities.js +2 -2
- package/lib/esm/components/FeedObject/Activities/Activities.js.map +1 -1
- package/lib/esm/components/FeedObject/Contributors/Contributors.d.ts +2 -2
- package/lib/esm/components/FeedObject/Contributors/Contributors.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.d.ts +2 -2
- package/lib/esm/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.js +10 -11
- package/lib/esm/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/esm/components/FeedObject/Poll/Poll.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Poll/Poll.js +2 -2
- package/lib/esm/components/FeedObject/Poll/Poll.js.map +1 -1
- package/lib/esm/components/InlineComposer/InlineComposer.d.ts.map +1 -1
- package/lib/esm/components/InlineComposer/InlineComposer.js +1 -20
- package/lib/esm/components/InlineComposer/InlineComposer.js.map +1 -1
- package/lib/esm/components/Notification/Comment/Comment.d.ts +2 -12
- package/lib/esm/components/Notification/Comment/Comment.d.ts.map +1 -1
- package/lib/esm/components/Notification/Comment/Comment.js +9 -14
- package/lib/esm/components/Notification/Comment/Comment.js.map +1 -1
- package/lib/esm/components/Notification/Contribution/Contribution.d.ts +2 -12
- package/lib/esm/components/Notification/Contribution/Contribution.d.ts.map +1 -1
- package/lib/esm/components/Notification/Contribution/Contribution.js +13 -18
- package/lib/esm/components/Notification/Contribution/Contribution.js.map +1 -1
- package/lib/esm/components/Notification/Notification.d.ts.map +1 -1
- package/lib/esm/components/Notification/Notification.js +7 -33
- package/lib/esm/components/Notification/Notification.js.map +1 -1
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +15 -269
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js.map +1 -1
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js +84 -7
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js.map +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts +11 -27
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +201 -12
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js.map +1 -1
- package/lib/esm/components/PrivateMessageThread/Skeleton.js +2 -2
- package/lib/esm/components/PrivateMessageThread/Skeleton.js.map +1 -1
- package/lib/esm/components/PrivateMessageThreadItem/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageThreadItem/Skeleton.js +2 -4
- package/lib/esm/components/PrivateMessageThreadItem/Skeleton.js.map +1 -1
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.d.ts +2 -2
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.js.map +1 -1
- package/lib/esm/components/User/User.d.ts +3 -8
- package/lib/esm/components/User/User.d.ts.map +1 -1
- package/lib/esm/components/User/User.js +6 -28
- package/lib/esm/components/User/User.js.map +1 -1
- package/lib/esm/components/UserInfoDialog/UserInfoDialog.d.ts +1 -1
- package/lib/esm/components/UserInfoDialog/UserInfoDialog.d.ts.map +1 -1
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts +50 -0
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts.map +1 -0
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +145 -0
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js.map +1 -0
- package/lib/esm/components/VoteAudienceButton/index.d.ts +4 -0
- package/lib/esm/components/VoteAudienceButton/index.d.ts.map +1 -0
- package/lib/esm/components/VoteAudienceButton/index.js +3 -0
- package/lib/esm/components/VoteAudienceButton/index.js.map +1 -0
- package/lib/esm/components/VoteButton/VoteButton.d.ts +53 -0
- package/lib/esm/components/VoteButton/VoteButton.d.ts.map +1 -0
- package/lib/esm/components/VoteButton/VoteButton.js +123 -0
- package/lib/esm/components/VoteButton/VoteButton.js.map +1 -0
- package/lib/esm/components/VoteButton/index.d.ts +4 -0
- package/lib/esm/components/VoteButton/index.d.ts.map +1 -0
- package/lib/esm/components/VoteButton/index.js +3 -0
- package/lib/esm/components/VoteButton/index.js.map +1 -0
- package/lib/esm/shared/BaseDialog/BaseDialog.d.ts +11 -0
- package/lib/esm/shared/BaseDialog/BaseDialog.d.ts.map +1 -1
- package/lib/esm/shared/BaseDialog/BaseDialog.js +3 -8
- package/lib/esm/shared/BaseDialog/BaseDialog.js.map +1 -1
- package/lib/esm/shared/ContributionActionsMenu/index.d.ts +2 -2
- package/lib/esm/shared/ContributionActionsMenu/index.d.ts.map +1 -1
- package/lib/esm/shared/ContributionActionsMenu/index.js +12 -13
- package/lib/esm/shared/ContributionActionsMenu/index.js.map +1 -1
- package/lib/esm/utils/contribution.d.ts +2 -2
- package/lib/esm/utils/contribution.d.ts.map +1 -1
- package/lib/esm/utils/contribution.js +16 -18
- package/lib/esm/utils/contribution.js.map +1 -1
- package/lib/umd/react-ui.js +11 -11
- package/lib/umd/react-ui.js.LICENSE.txt +1 -1
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +6 -6
- package/lib/cjs/components/CommentObject/Reactions/Reactions.d.ts +0 -23
- package/lib/cjs/components/CommentObject/Reactions/Reactions.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/Reactions.js +0 -97
- package/lib/cjs/components/CommentObject/Reactions/Reactions.js.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts +0 -34
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js +0 -129
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.d.ts +0 -4
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.js.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/index.d.ts +0 -4
- package/lib/cjs/components/CommentObject/Reactions/index.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/index.js +0 -8
- package/lib/cjs/components/CommentObject/Reactions/index.js.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/Votes.d.ts +0 -19
- package/lib/cjs/components/CommentObject/Votes/Votes.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/Votes.js +0 -93
- package/lib/cjs/components/CommentObject/Votes/Votes.js.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts +0 -24
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.js +0 -95
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.js.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.d.ts +0 -4
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.js +0 -8
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.js.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/index.d.ts +0 -4
- package/lib/cjs/components/CommentObject/Votes/index.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/index.js +0 -8
- package/lib/cjs/components/CommentObject/Votes/index.js.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.d.ts +0 -34
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.d.ts.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.js +0 -474
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.js.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts +0 -40
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.js +0 -156
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.js.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/index.d.ts +0 -3
- package/lib/cjs/components/FeedObject/Actions/Reaction/index.d.ts.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/index.js.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/Reactions.d.ts +0 -23
- package/lib/esm/components/CommentObject/Reactions/Reactions.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/Reactions.js +0 -68
- package/lib/esm/components/CommentObject/Reactions/Reactions.js.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts +0 -34
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js +0 -100
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.d.ts +0 -4
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.js +0 -3
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.js.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/index.d.ts +0 -4
- package/lib/esm/components/CommentObject/Reactions/index.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/index.js +0 -3
- package/lib/esm/components/CommentObject/Reactions/index.js.map +0 -1
- package/lib/esm/components/CommentObject/Votes/Votes.d.ts +0 -19
- package/lib/esm/components/CommentObject/Votes/Votes.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Votes/Votes.js +0 -64
- package/lib/esm/components/CommentObject/Votes/Votes.js.map +0 -1
- package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts +0 -24
- package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.js +0 -66
- package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.js.map +0 -1
- package/lib/esm/components/CommentObject/Votes/VotesDialog/index.d.ts +0 -4
- package/lib/esm/components/CommentObject/Votes/VotesDialog/index.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Votes/VotesDialog/index.js +0 -3
- package/lib/esm/components/CommentObject/Votes/VotesDialog/index.js.map +0 -1
- package/lib/esm/components/CommentObject/Votes/index.d.ts +0 -4
- package/lib/esm/components/CommentObject/Votes/index.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Votes/index.js +0 -3
- package/lib/esm/components/CommentObject/Votes/index.js.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.d.ts +0 -34
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.d.ts.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.js +0 -444
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.js.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts +0 -40
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.js +0 -127
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.js.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/index.d.ts +0 -3
- package/lib/esm/components/FeedObject/Actions/Reaction/index.d.ts.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/index.js +0 -3
- package/lib/esm/components/FeedObject/Actions/Reaction/index.js.map +0 -1
|
@@ -30,6 +30,7 @@ const PREFIX = 'SCUser';
|
|
|
30
30
|
const classes = {
|
|
31
31
|
root: `${PREFIX}-root`,
|
|
32
32
|
avatar: `${PREFIX}-avatar`,
|
|
33
|
+
staffBadge: `${PREFIX}-staff-badge`,
|
|
33
34
|
staffBadgeLabel: `${PREFIX}-staff-badge-label`,
|
|
34
35
|
staffBadgeIcon: `${PREFIX}-staff-badge-icon`
|
|
35
36
|
};
|
|
@@ -37,24 +38,7 @@ const Root = styled(BaseItemButton, {
|
|
|
37
38
|
name: PREFIX,
|
|
38
39
|
slot: 'Root',
|
|
39
40
|
overridesResolver: (props, styles) => styles.root
|
|
40
|
-
})(({ theme }) => ({
|
|
41
|
-
'& .MuiChip-root': {
|
|
42
|
-
height: '18px'
|
|
43
|
-
},
|
|
44
|
-
[`& .${classes.avatar}`]: {
|
|
45
|
-
width: theme.selfcommunity.user.avatar.sizeMedium,
|
|
46
|
-
height: theme.selfcommunity.user.avatar.sizeMedium
|
|
47
|
-
},
|
|
48
|
-
[`& .${classes.staffBadgeLabel}`]: {
|
|
49
|
-
marginLeft: theme.spacing(1),
|
|
50
|
-
borderRadius: 0,
|
|
51
|
-
fontSize: '0.5rem'
|
|
52
|
-
},
|
|
53
|
-
[`& .${classes.staffBadgeIcon}`]: {
|
|
54
|
-
top: '25%',
|
|
55
|
-
right: '5%'
|
|
56
|
-
}
|
|
57
|
-
}));
|
|
41
|
+
})(({ theme }) => ({}));
|
|
58
42
|
const PREFERENCES = [SCPreferences.STAFF_STAFF_BADGE_LABEL, SCPreferences.STAFF_STAFF_BADGE_ICON];
|
|
59
43
|
/**
|
|
60
44
|
* > API documentation for the Community-JS User component. Learn about the available props and the CSS API.
|
|
@@ -77,7 +61,7 @@ const PREFERENCES = [SCPreferences.STAFF_STAFF_BADGE_LABEL, SCPreferences.STAFF_
|
|
|
77
61
|
|root|.SCUser-root|Styles applied to the root element.|
|
|
78
62
|
|staffBadgeLabel|.SCUser-staff-badge-label|Styles applied to the staff badge label element.|
|
|
79
63
|
|staffBadgeIcon|.SCUser-staff-badge-icon|Styles applied to the staff badge icon element.|
|
|
80
|
-
|
|
64
|
+
|staffBadge|.SCUser-staff-badge|Styles applied to the reaction icon element.|
|
|
81
65
|
* @param inProps
|
|
82
66
|
*/
|
|
83
67
|
export default function User(inProps) {
|
|
@@ -86,13 +70,7 @@ export default function User(inProps) {
|
|
|
86
70
|
props: inProps,
|
|
87
71
|
name: PREFIX
|
|
88
72
|
});
|
|
89
|
-
const { userId = null, user = null, handleIgnoreAction, className = null, followConnectUserButtonProps = {}, showFollowers = false, elevation,
|
|
90
|
-
const SmallAvatar = styled(Avatar)(({ theme }) => ({
|
|
91
|
-
width: theme.selfcommunity.user.avatar.sizeSmall,
|
|
92
|
-
height: theme.selfcommunity.user.avatar.sizeSmall,
|
|
93
|
-
backgroundColor: theme.palette.common.white,
|
|
94
|
-
border: `2px solid ${theme.palette.background.paper}`
|
|
95
|
-
}));
|
|
73
|
+
const { userId = null, user = null, handleIgnoreAction, className = null, followConnectUserButtonProps = {}, showFollowers = false, elevation, badgeContent = null, search = '' } = props, rest = __rest(props, ["userId", "user", "handleIgnoreAction", "className", "followConnectUserButtonProps", "showFollowers", "elevation", "badgeContent", "search"]);
|
|
96
74
|
// STATE
|
|
97
75
|
const { scUser, setSCUser } = useSCFetchUser({ id: userId, user });
|
|
98
76
|
// CONTEXT
|
|
@@ -126,8 +104,8 @@ export default function User(inProps) {
|
|
|
126
104
|
/**
|
|
127
105
|
* Renders root object
|
|
128
106
|
*/
|
|
129
|
-
return (React.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: classNames(classes.root, className), ButtonBaseProps: { component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUser) }, image:
|
|
130
|
-
React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))) : (React.createElement(Badge, { invisible: !hasBadge, classes: { badge: classes.staffBadgeIcon }, overlap: "circular", anchorOrigin: { vertical: 'top', horizontal: 'right' }, badgeContent: preferences ? (React.createElement(
|
|
107
|
+
return (React.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: classNames(classes.root, className), ButtonBaseProps: { component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUser) }, image: badgeContent ? (React.createElement(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: badgeContent },
|
|
108
|
+
React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))) : (React.createElement(Badge, { invisible: !hasBadge, classes: { badge: classes.staffBadgeIcon }, overlap: "circular", anchorOrigin: { vertical: 'top', horizontal: 'right' }, badgeContent: preferences ? (React.createElement(Avatar, { className: classes.staffBadge, alt: preferences[SCPreferences.STAFF_STAFF_BADGE_LABEL], src: preferences[SCPreferences.STAFF_STAFF_BADGE_ICON] })) : null },
|
|
131
109
|
React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))), primary: hasBadge && preferences ? (React.createElement(React.Fragment, null,
|
|
132
110
|
search !== '' ? highlight(scUser.username, search) : scUser.username,
|
|
133
111
|
React.createElement(Chip, { component: "span", className: classes.staffBadgeLabel, size: "small", label: preferences[SCPreferences.STAFF_STAFF_BADGE_LABEL] }))) : search !== '' ? (highlight(scUser.username, search)) : (scUser.username), secondary: showFollowers ? `${intl.formatMessage(messages.userFollowers, { total: scUser.followers_counter })}` : scUser.description, actions: renderAuthenticatedActions() })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../../src/components/User/User.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,YAAY,MAAM,YAAY,CAAC;AACtC,OAAO,EAAC,MAAM,E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AAC,WAAW,EAClI,OAAO,EAAE,0BAA0B,EAAE,IACrC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserInfoProps } from '../UserInfo';
|
|
2
2
|
import { BaseDialogProps } from '../../shared/BaseDialog';
|
|
3
|
-
import { SCUserType } from '@selfcommunity/types
|
|
3
|
+
import { SCUserType } from '@selfcommunity/types';
|
|
4
4
|
export interface UserInfoDialogProps extends Pick<BaseDialogProps, Exclude<keyof BaseDialogProps, 'title' | 'subtitle'>> {
|
|
5
5
|
/**
|
|
6
6
|
* Id of user object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInfoDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/UserInfoDialog/UserInfoDialog.tsx"],"names":[],"mappings":"AAIA,OAAiB,EAAE,aAAa,EAAoB,MAAM,aAAa,CAAC;AACxE,OAAmB,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAC,UAAU,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"UserInfoDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/UserInfoDialog/UserInfoDialog.tsx"],"names":[],"mappings":"AAIA,OAAiB,EAAE,aAAa,EAAoB,MAAM,aAAa,CAAC;AACxE,OAAmB,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAmBhD,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,eAAe,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;IACtH;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,OAAO,EAAE,mBAAmB,eA8BlE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LoadingButtonProps } from '@mui/lab';
|
|
2
|
+
import { SCCommentType, SCContributionType, SCFeedObjectType } from '@selfcommunity/types';
|
|
3
|
+
export interface VoteAudienceButtonProps extends Pick<LoadingButtonProps, Exclude<keyof LoadingButtonProps, 'onClick' | 'disabled' | 'loading'>> {
|
|
4
|
+
/**
|
|
5
|
+
* Id of the contribution object to vote
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
contributionId: number;
|
|
9
|
+
/**
|
|
10
|
+
* Type of the contribution object to vote
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
contributionType: SCContributionType | any;
|
|
14
|
+
/**
|
|
15
|
+
* Contribution object to vote
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
contribution?: SCFeedObjectType | SCCommentType | null;
|
|
19
|
+
/**
|
|
20
|
+
* Others properties
|
|
21
|
+
*/
|
|
22
|
+
[p: string]: any;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* > API documentation for the Community-JS Vote Audience Button component. Learn about the available props and the CSS API.
|
|
26
|
+
|
|
27
|
+
#### Import
|
|
28
|
+
|
|
29
|
+
```jsx
|
|
30
|
+
import {VoteAudienceButton} from '@selfcommunity/react-ui';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### Component Name
|
|
34
|
+
|
|
35
|
+
The name `SCVoteAudienceButton` can be used when providing style overrides in the theme.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
#### CSS
|
|
39
|
+
|
|
40
|
+
|Rule Name|Global class|Description|
|
|
41
|
+
|---|---|---|
|
|
42
|
+
|root|.SCVoteAudienceButton-root|Styles applied to the root element.|
|
|
43
|
+
|reactionList|.SCVoteAudienceButton-reactions|Styles applied to the reactionList list element.|
|
|
44
|
+
|dialogRoot|.SCVoteAudienceButton-dialog-root|Styles applied to the dialog root element.|
|
|
45
|
+
|dialogTabs|.SCVoteAudienceButton-dialog-tabs|Styles applied to the tabs element.|
|
|
46
|
+
|dialogVoteBadge|.SCVoteAudienceButton-dialog-vote-badge|Styles applied to the vote badge element.|
|
|
47
|
+
* @param inProps
|
|
48
|
+
*/
|
|
49
|
+
export default function VoteAudienceButton(inProps: VoteAudienceButtonProps): JSX.Element;
|
|
50
|
+
//# sourceMappingURL=VoteAudienceButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoteAudienceButton.d.ts","sourceRoot":"","sources":["../../../../src/components/VoteAudienceButton/VoteAudienceButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAiCzF,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,MAAM,kBAAkB,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;IAC9I;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,gBAAgB,EAAE,kBAAkB,GAAG,GAAG,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG,IAAI,CAAC;IAEvD;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,OAAO,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CA2JxF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
13
|
+
import { styled } from '@mui/material/styles';
|
|
14
|
+
import { LoadingButton } from '@mui/lab';
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
import { useThemeProps } from '@mui/system';
|
|
17
|
+
import Icon from '@mui/material/Icon';
|
|
18
|
+
import { Avatar, Box, List, ListItem, Tab, Tabs, Typography } from '@mui/material';
|
|
19
|
+
import { FormattedMessage } from 'react-intl';
|
|
20
|
+
import { useSCFetchVote, useSCUser } from '@selfcommunity/react-core';
|
|
21
|
+
import BaseDialog from '../../shared/BaseDialog';
|
|
22
|
+
import CentralProgress from '../../shared/CentralProgress';
|
|
23
|
+
import InfiniteScroll from '../../shared/InfiniteScroll';
|
|
24
|
+
import User from '../User';
|
|
25
|
+
const PREFIX = 'SCVoteAudienceButton';
|
|
26
|
+
const classes = {
|
|
27
|
+
root: `${PREFIX}-root`,
|
|
28
|
+
reactionList: `${PREFIX}-reaction-list`,
|
|
29
|
+
dialogRoot: `${PREFIX}-dialog-root`,
|
|
30
|
+
dialogTabs: `${PREFIX}-dialog-tabs`,
|
|
31
|
+
dialogVoteBadge: `${PREFIX}-dialog-vote-badge`
|
|
32
|
+
};
|
|
33
|
+
const Root = styled(LoadingButton, {
|
|
34
|
+
name: PREFIX,
|
|
35
|
+
slot: 'Root',
|
|
36
|
+
overridesResolver: (props, styles) => [styles.root, styles.voted]
|
|
37
|
+
})(({ theme }) => ({}));
|
|
38
|
+
const DialogRoot = styled(BaseDialog, {
|
|
39
|
+
name: PREFIX,
|
|
40
|
+
slot: 'Root',
|
|
41
|
+
overridesResolver: (props, styles) => styles.dialogRoot
|
|
42
|
+
})(({ theme }) => ({}));
|
|
43
|
+
/**
|
|
44
|
+
* > API documentation for the Community-JS Vote Audience Button component. Learn about the available props and the CSS API.
|
|
45
|
+
|
|
46
|
+
#### Import
|
|
47
|
+
|
|
48
|
+
```jsx
|
|
49
|
+
import {VoteAudienceButton} from '@selfcommunity/react-ui';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Component Name
|
|
53
|
+
|
|
54
|
+
The name `SCVoteAudienceButton` can be used when providing style overrides in the theme.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
#### CSS
|
|
58
|
+
|
|
59
|
+
|Rule Name|Global class|Description|
|
|
60
|
+
|---|---|---|
|
|
61
|
+
|root|.SCVoteAudienceButton-root|Styles applied to the root element.|
|
|
62
|
+
|reactionList|.SCVoteAudienceButton-reactions|Styles applied to the reactionList list element.|
|
|
63
|
+
|dialogRoot|.SCVoteAudienceButton-dialog-root|Styles applied to the dialog root element.|
|
|
64
|
+
|dialogTabs|.SCVoteAudienceButton-dialog-tabs|Styles applied to the tabs element.|
|
|
65
|
+
|dialogVoteBadge|.SCVoteAudienceButton-dialog-vote-badge|Styles applied to the vote badge element.|
|
|
66
|
+
* @param inProps
|
|
67
|
+
*/
|
|
68
|
+
export default function VoteAudienceButton(inProps) {
|
|
69
|
+
// PROPS
|
|
70
|
+
const props = useThemeProps({
|
|
71
|
+
props: inProps,
|
|
72
|
+
name: PREFIX
|
|
73
|
+
});
|
|
74
|
+
const { className, contributionId = null, contributionType = null, contribution = null } = props, rest = __rest(props, ["className", "contributionId", "contributionType", "contribution"]);
|
|
75
|
+
// STATE
|
|
76
|
+
const [open, setOpen] = useState(false);
|
|
77
|
+
const [tab, setTab] = useState(0);
|
|
78
|
+
// CONTEXT
|
|
79
|
+
const scUserContext = useSCUser();
|
|
80
|
+
// HANDLERS
|
|
81
|
+
const handleOpen = (event) => {
|
|
82
|
+
setOpen(true);
|
|
83
|
+
};
|
|
84
|
+
const handleClose = (event) => {
|
|
85
|
+
setOpen(false);
|
|
86
|
+
};
|
|
87
|
+
const handleChangeTab = (event, newValue) => {
|
|
88
|
+
setTab(newValue);
|
|
89
|
+
};
|
|
90
|
+
// HOOKS
|
|
91
|
+
const { isLoading, contributionVoted, contributionVoteCount, contributionReactionsCount, reactions, error, handleFetchVoteList, voteList, isLoadingVoteList, voteListHasNext } = useSCFetchVote({
|
|
92
|
+
id: contributionId,
|
|
93
|
+
contributionType,
|
|
94
|
+
contribution
|
|
95
|
+
});
|
|
96
|
+
// EFFECTS
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!isLoadingVoteList && open) {
|
|
99
|
+
handleFetchVoteList({ reset: true });
|
|
100
|
+
}
|
|
101
|
+
}, [open]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (isLoadingVoteList || !open) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (tab === 0) {
|
|
107
|
+
handleFetchVoteList({ reset: true });
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const { reaction } = contributionReactionsCount[tab - 1];
|
|
111
|
+
handleFetchVoteList({ reaction, reset: true });
|
|
112
|
+
}, [tab]);
|
|
113
|
+
// RENDER
|
|
114
|
+
const audienceIcon = useMemo(() => {
|
|
115
|
+
if (reactions.default && !isLoading && !error) {
|
|
116
|
+
return (React.createElement(Box, { className: classes.reactionList }, contributionReactionsCount.slice(0, 3).map((count, i) => (React.createElement(Icon, { key: count.reaction.id },
|
|
117
|
+
React.createElement("img", { alt: count.reaction.label, src: count.reaction.image, width: "100%", height: "100%" }))))));
|
|
118
|
+
}
|
|
119
|
+
return scUserContext.user && contributionVoted ? React.createElement(Icon, null, "thumb_up") : React.createElement(Icon, null, "thumb_up_off_alt");
|
|
120
|
+
}, [reactions.default, isLoading, error, contributionReactionsCount, scUserContext.user, contributionVoted]);
|
|
121
|
+
const dialogTitle = useMemo(() => {
|
|
122
|
+
if (reactions.default && !isLoading) {
|
|
123
|
+
return (React.createElement(Tabs, { className: classes.dialogTabs, value: tab, onChange: handleChangeTab, "aria-label": "reactions" },
|
|
124
|
+
React.createElement(Tab, { label: React.createElement(FormattedMessage, { defaultMessage: "ui.voteAudienceButton.dialog.tab.all", id: "ui.voteAudienceButton.dialog.tab.all" }) }),
|
|
125
|
+
contributionReactionsCount.map((count) => React.createElement(Tab, { key: count.reaction.id, label: React.createElement(React.Fragment, null,
|
|
126
|
+
React.createElement(Icon, null,
|
|
127
|
+
React.createElement("img", { alt: count.reaction.label, src: count.reaction.image, width: "100%", height: "100%" })),
|
|
128
|
+
count.count) }))));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return React.createElement(FormattedMessage, { defaultMessage: "ui.voteAudienceButton.dialog.title", id: "ui.voteAudienceButton.dialog.title" });
|
|
132
|
+
}
|
|
133
|
+
}, [tab, reactions, contributionReactionsCount]);
|
|
134
|
+
return (React.createElement(React.Fragment, null,
|
|
135
|
+
React.createElement(Root, Object.assign({ onClick: handleOpen, disabled: isLoading || Boolean(error) || contributionVoteCount === 0, loading: isLoading, className: classNames(classes.root, className) }, rest),
|
|
136
|
+
audienceIcon,
|
|
137
|
+
"\u00A0",
|
|
138
|
+
scUserContext.user && contributionVoted ? (contributionVoteCount === 1 ? (React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.votedOnlyByMe", defaultMessage: "ui.voteAudienceButton.votedOnlyByMe" })) : (React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.votedByMe", defaultMessage: "ui.voteAudienceButton.votedByMe", values: { total: contributionVoteCount - 1 } }))) : (React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.votes", defaultMessage: "ui.voteAudienceButton.votes", values: { total: contributionVoteCount } }))),
|
|
139
|
+
open && (React.createElement(DialogRoot, { title: dialogTitle, onClose: handleClose, open: open, DialogContentProps: {} }, isLoadingVoteList ? (React.createElement(CentralProgress, { size: 50 })) : (React.createElement(InfiniteScroll, { dataLength: voteList.length, next: () => handleFetchVoteList({}), hasMoreNext: voteListHasNext, loaderNext: React.createElement(CentralProgress, { size: 30 }), height: 400, endMessage: React.createElement(Typography, null,
|
|
140
|
+
React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.dialog.end", defaultMessage: "ui.voteAudienceButton.dialog.end" })) },
|
|
141
|
+
React.createElement(List, null, voteList.map((vote) => (React.createElement(ListItem, { key: vote.user.id },
|
|
142
|
+
React.createElement(User, { elevation: 0, user: vote.user, badgeContent: React.createElement(Avatar, { className: classes.dialogVoteBadge }, vote.reaction ? (React.createElement(Icon, null,
|
|
143
|
+
React.createElement("img", { alt: vote.reaction.label, src: vote.reaction.image, width: "100%", height: "100%" }))) : (React.createElement(Icon, null, "thumb_up"))) })))))))))));
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=VoteAudienceButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoteAudienceButton.js","sourceRoot":"","sources":["../../../../src/components/VoteAudienceButton/VoteAudienceButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAqB,MAAM,UAAU,CAAC;AAC3D,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAmC,c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AAE,IAAI,CAAC,IAAI,EACf,YAAY,EACV,oBAAC,MAAM,IAAC,SAAS,EAAE,OAAO,CAAC,eAAe,IACvC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CACf,oBAAC,IAAI;wBACH,6BAAK,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,GAAG,CACjF,CACR,CAAC,CAAC,CAAC,CACF,oBAAC,IAAI,mBAAgB,CACtB,CACM,GAEX,CACO,CACZ,CAAC,CACG,CACQ,CAClB,CACU,CACd,CACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/VoteAudienceButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,EAAE,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAC;AACjF,eAAe,kBAAkB,CAAC;AAClC,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/VoteAudienceButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAA6C,MAAM,sBAAsB,CAAC;AACjF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { LoadingButtonProps } from '@mui/lab';
|
|
2
|
+
import { SCCommentType, SCContributionType, SCFeedObjectType } from '@selfcommunity/types';
|
|
3
|
+
export interface VoteButtonProps extends Pick<LoadingButtonProps, Exclude<keyof LoadingButtonProps, 'onClick' | 'disabled' | 'loading'>> {
|
|
4
|
+
/**
|
|
5
|
+
* Id of the contribution object to vote
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
contributionId: number;
|
|
9
|
+
/**
|
|
10
|
+
* Type of the contribution object to vote
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
contributionType: SCContributionType | any;
|
|
14
|
+
/**
|
|
15
|
+
* Contribution object to vote
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
contribution?: SCFeedObjectType | SCCommentType | null;
|
|
19
|
+
/**
|
|
20
|
+
* onVote callback
|
|
21
|
+
* @default null
|
|
22
|
+
*/
|
|
23
|
+
onVote?: (contribution: SCFeedObjectType | SCCommentType) => any;
|
|
24
|
+
/**
|
|
25
|
+
* Others properties
|
|
26
|
+
*/
|
|
27
|
+
[p: string]: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* > API documentation for the Community-JS Vote Button component. Learn about the available props and the CSS API.
|
|
31
|
+
|
|
32
|
+
#### Import
|
|
33
|
+
|
|
34
|
+
```jsx
|
|
35
|
+
import {VoteAudienceButton} from '@selfcommunity/react-ui';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Component Name
|
|
39
|
+
|
|
40
|
+
The name `SCVoteButton` can be used when providing style overrides in the theme.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
#### CSS
|
|
44
|
+
|
|
45
|
+
|Rule Name|Global class|Description|
|
|
46
|
+
|---|---|---|
|
|
47
|
+
|root|.SCVoteButton-root|Styles applied to the root element.|
|
|
48
|
+
|voted|.SCVoteButton-voted|Styles applied to the root element when the user has vote the contribution.|
|
|
49
|
+
|
|
50
|
+
* @param inProps
|
|
51
|
+
*/
|
|
52
|
+
export default function VoteButton(inProps: VoteButtonProps): JSX.Element;
|
|
53
|
+
//# sourceMappingURL=VoteButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoteButton.d.ts","sourceRoot":"","sources":["../../../../src/components/VoteButton/VoteButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAiB,MAAM,sBAAsB,CAAC;AA6BzG,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,MAAM,kBAAkB,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;IACtI;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,gBAAgB,EAAE,kBAAkB,GAAG,GAAG,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG,IAAI,CAAC;IAEvD;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,gBAAgB,GAAG,aAAa,KAAK,GAAG,CAAC;IAEjE;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAsHxE"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
13
|
+
import { styled } from '@mui/material/styles';
|
|
14
|
+
import { LoadingButton } from '@mui/lab';
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
import { useThemeProps } from '@mui/system';
|
|
17
|
+
import Icon from '@mui/material/Icon';
|
|
18
|
+
import { IconButton, Paper, Popper, Tooltip } from '@mui/material';
|
|
19
|
+
import { useSCFetchVote, useSCUser } from '@selfcommunity/react-core';
|
|
20
|
+
import { FormattedMessage } from 'react-intl';
|
|
21
|
+
const PREFIX = 'SCVoteButton';
|
|
22
|
+
const classes = {
|
|
23
|
+
root: `${PREFIX}-root`,
|
|
24
|
+
voted: `${PREFIX}-voted`,
|
|
25
|
+
popperRoot: `${PREFIX}-popper-root`,
|
|
26
|
+
reactionList: `${PREFIX}-reaction-list`,
|
|
27
|
+
reaction: `${PREFIX}-reaction`
|
|
28
|
+
};
|
|
29
|
+
const Root = styled(LoadingButton, {
|
|
30
|
+
name: PREFIX,
|
|
31
|
+
slot: 'Root',
|
|
32
|
+
overridesResolver: (props, styles) => [styles.root, styles.voted]
|
|
33
|
+
})(({ theme }) => ({}));
|
|
34
|
+
const PopperRoot = styled(Popper, {
|
|
35
|
+
name: PREFIX,
|
|
36
|
+
slot: 'Root',
|
|
37
|
+
overridesResolver: (props, styles) => styles.popperRoot
|
|
38
|
+
})(({ theme }) => ({}));
|
|
39
|
+
/**
|
|
40
|
+
* > API documentation for the Community-JS Vote Button component. Learn about the available props and the CSS API.
|
|
41
|
+
|
|
42
|
+
#### Import
|
|
43
|
+
|
|
44
|
+
```jsx
|
|
45
|
+
import {VoteAudienceButton} from '@selfcommunity/react-ui';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Component Name
|
|
49
|
+
|
|
50
|
+
The name `SCVoteButton` can be used when providing style overrides in the theme.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
#### CSS
|
|
54
|
+
|
|
55
|
+
|Rule Name|Global class|Description|
|
|
56
|
+
|---|---|---|
|
|
57
|
+
|root|.SCVoteButton-root|Styles applied to the root element.|
|
|
58
|
+
|voted|.SCVoteButton-voted|Styles applied to the root element when the user has vote the contribution.|
|
|
59
|
+
|
|
60
|
+
* @param inProps
|
|
61
|
+
*/
|
|
62
|
+
export default function VoteButton(inProps) {
|
|
63
|
+
// PROPS
|
|
64
|
+
const props = useThemeProps({
|
|
65
|
+
props: inProps,
|
|
66
|
+
name: PREFIX
|
|
67
|
+
});
|
|
68
|
+
const { className, contributionId = null, contributionType = null, contribution = null, onVote } = props, rest = __rest(props, ["className", "contributionId", "contributionType", "contribution", "onVote"]);
|
|
69
|
+
// STATE
|
|
70
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
71
|
+
// REF
|
|
72
|
+
const timeoutRef = useRef(null);
|
|
73
|
+
// CONTEXT
|
|
74
|
+
const scUserContext = useSCUser();
|
|
75
|
+
// HANDLERS
|
|
76
|
+
const handleMouseEnter = (event) => {
|
|
77
|
+
handleClearTimeout();
|
|
78
|
+
setTimeout(() => setAnchorEl(event.target), 1000);
|
|
79
|
+
};
|
|
80
|
+
const handleMouseLeave = (event) => {
|
|
81
|
+
timeoutRef.current = setTimeout(() => setAnchorEl(null), 500);
|
|
82
|
+
};
|
|
83
|
+
const handleClearTimeout = () => {
|
|
84
|
+
timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
85
|
+
timeoutRef.current = null;
|
|
86
|
+
};
|
|
87
|
+
const handleVoteDone = (contribution) => {
|
|
88
|
+
setAnchorEl(null);
|
|
89
|
+
onVote && onVote(contribution);
|
|
90
|
+
};
|
|
91
|
+
// HOOKS
|
|
92
|
+
const { isLoading, isVoting, contributionVoted, contributionReaction, reactions, handleVote, error } = useSCFetchVote({
|
|
93
|
+
id: contributionId,
|
|
94
|
+
contributionType,
|
|
95
|
+
contribution,
|
|
96
|
+
onVote: handleVoteDone
|
|
97
|
+
});
|
|
98
|
+
// MEMO
|
|
99
|
+
const rootProps = useMemo(() => {
|
|
100
|
+
if (!reactions.default) {
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
onMouseEnter: handleMouseEnter,
|
|
105
|
+
onMouseLeave: handleMouseLeave,
|
|
106
|
+
onTouchStart: handleMouseEnter,
|
|
107
|
+
onTouchMove: handleMouseLeave
|
|
108
|
+
};
|
|
109
|
+
}, [reactions]);
|
|
110
|
+
// RENDER
|
|
111
|
+
const button = (React.createElement(Root, Object.assign({ onClick: () => handleVote(contributionReaction ? contributionReaction : reactions.default ? reactions.default : null), disabled: isLoading || Boolean(error), loading: isVoting, className: classNames(classes.root, className, {
|
|
112
|
+
[classes.voted]: scUserContext.user && contributionVoted
|
|
113
|
+
}) }, rest, rootProps), scUserContext.user && contributionVoted ? (contributionReaction ? (React.createElement(Icon, null,
|
|
114
|
+
React.createElement("img", { alt: contributionReaction.label, src: contributionReaction.image, width: "100%", height: "100%" }))) : (React.createElement(Icon, null, "thumb_up"))) : (React.createElement(Icon, null, "thumb_up_off_alt"))));
|
|
115
|
+
return (React.createElement(React.Fragment, null,
|
|
116
|
+
reactions.default ? (button) : (React.createElement(Tooltip, { title: contributionVoted ? (React.createElement(FormattedMessage, { id: "ui.voteButton.voteDown", defaultMessage: "ui.voteButton.voteDown" })) : (React.createElement(FormattedMessage, { id: "ui.voteButton.voteUp", defaultMessage: "ui.voteButton.voteUp" })) },
|
|
117
|
+
React.createElement("span", null, button))),
|
|
118
|
+
reactions.default && (React.createElement(PopperRoot, { id: `vote_${contributionId}_${contributionType}_popper`, className: classes.popperRoot, open: Boolean(anchorEl) && !isVoting && !isLoading, anchorEl: anchorEl, placement: "top", keepMounted: true },
|
|
119
|
+
React.createElement(Paper, { className: classes.reactionList, onMouseEnter: handleClearTimeout, onMouseLeave: handleMouseLeave }, reactions.reactions.map((reaction) => (React.createElement(IconButton, { key: reaction.id, className: classes.reaction, onClick: () => handleVote(reaction) },
|
|
120
|
+
React.createElement(Icon, null,
|
|
121
|
+
React.createElement("img", { alt: reaction.label, src: reaction.image, width: "100%", height: "100%" }))))))))));
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=VoteButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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S,CAAC,GAAG,CAAC,CAAC,QAAwB,EAAE,EAAE,CAAC,CACrD,oBAAC,UAAU,IAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAC5F,oBAAC,IAAI;oBACH,6BAAK,GAAG,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,GAAG,CACvE,CACI,CACd,CAAC,CACI,CACG,CACd,CACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/VoteButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AACzD,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/VoteButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAA6B,MAAM,cAAc,CAAC;AACzD,eAAe,UAAU,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DialogContentProps } from '@mui/material/DialogContent';
|
|
1
3
|
export interface BaseDialogProps {
|
|
2
4
|
/**
|
|
3
5
|
* Overrides or extends the styles applied to the component.
|
|
@@ -14,6 +16,11 @@ export interface BaseDialogProps {
|
|
|
14
16
|
* @default ''
|
|
15
17
|
*/
|
|
16
18
|
subtitle?: any;
|
|
19
|
+
/**
|
|
20
|
+
* Dialog content props
|
|
21
|
+
* @default {dividers: !isMobile}
|
|
22
|
+
*/
|
|
23
|
+
DialogContentProps?: DialogContentProps;
|
|
17
24
|
/**
|
|
18
25
|
* Handles dialog opening
|
|
19
26
|
* @default false
|
|
@@ -24,6 +31,10 @@ export interface BaseDialogProps {
|
|
|
24
31
|
* @default null
|
|
25
32
|
*/
|
|
26
33
|
onClose?: () => any;
|
|
34
|
+
/**
|
|
35
|
+
* Actions for the dialog
|
|
36
|
+
*/
|
|
37
|
+
actions?: ReactNode;
|
|
27
38
|
/**
|
|
28
39
|
* Any other properties
|
|
29
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDialog.d.ts","sourceRoot":"","sources":["../../../../src/shared/BaseDialog/BaseDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseDialog.d.ts","sourceRoot":"","sources":["../../../../src/shared/BaseDialog/BaseDialog.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAKvC,OAAsB,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AA8B9E,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,eAqCxD"}
|
|
@@ -11,11 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { styled } from '@mui/material/styles';
|
|
14
|
-
import Button from '@mui/material/Button';
|
|
15
14
|
import Dialog from '@mui/material/Dialog';
|
|
16
15
|
import DialogActions from '@mui/material/DialogActions';
|
|
17
16
|
import DialogContent from '@mui/material/DialogContent';
|
|
18
|
-
import { FormattedMessage } from 'react-intl';
|
|
19
17
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
20
18
|
import Title from './title';
|
|
21
19
|
import classNames from 'classnames';
|
|
@@ -43,8 +41,7 @@ export default function BaseDialog(props) {
|
|
|
43
41
|
// PROPS
|
|
44
42
|
const theme = useTheme();
|
|
45
43
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
46
|
-
const { className, title = '', subtitle = null, open = false, onClose = null } = props, rest = __rest(props, ["className", "title", "subtitle", "open", "onClose"]);
|
|
47
|
-
const { children } = rest;
|
|
44
|
+
const { className = '', title = '', subtitle = null, DialogContentProps = { dividers: !isMobile }, open = false, onClose = null, actions = null, children } = props, rest = __rest(props, ["className", "title", "subtitle", "DialogContentProps", "open", "onClose", "actions", "children"]);
|
|
48
45
|
// OPTIONS
|
|
49
46
|
const fullScreen = useMediaQuery((theme) => theme['breakpoints'].down('sm'), { noSsr: typeof window !== 'undefined' });
|
|
50
47
|
/**
|
|
@@ -53,9 +50,7 @@ export default function BaseDialog(props) {
|
|
|
53
50
|
return (React.createElement(Root, { className: classNames(classes.root, className), fullScreen: fullScreen, fullWidth: true, open: open, onClose: onClose, maxWidth: rest.maxWidth ? rest.maxWidth : 'sm', scroll: "body" },
|
|
54
51
|
React.createElement(Title, { onClose: onClose }, title),
|
|
55
52
|
subtitle && subtitle,
|
|
56
|
-
React.createElement(DialogContent, {
|
|
57
|
-
|
|
58
|
-
React.createElement(Button, { onClick: onClose, color: "primary", autoFocus: true, variant: 'outlined' },
|
|
59
|
-
React.createElement(FormattedMessage, { id: "ui.baseDialog.button.close", defaultMessage: "ui.baseDialog.button.close" }))))));
|
|
53
|
+
React.createElement(DialogContent, Object.assign({}, DialogContentProps), children),
|
|
54
|
+
actions && React.createElement(DialogActions, null, actions)));
|
|
60
55
|
}
|
|
61
56
|
//# sourceMappingURL=BaseDialog.js.map
|