@selfcommunity/react-ui 0.5.6-alpha.9 → 0.5.6
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/Categories/Categories.d.ts +75 -0
- package/lib/cjs/components/Categories/Categories.d.ts.map +1 -0
- package/lib/cjs/components/Categories/Categories.js +188 -0
- package/lib/cjs/components/Categories/Categories.js.map +1 -0
- package/lib/cjs/components/Categories/Skeleton.d.ts +35 -0
- package/lib/cjs/components/Categories/Skeleton.d.ts.map +1 -0
- package/lib/cjs/components/Categories/Skeleton.js +71 -0
- package/lib/cjs/components/Categories/Skeleton.js.map +1 -0
- package/lib/cjs/components/Categories/index.d.ts +5 -0
- package/lib/cjs/components/Categories/index.d.ts.map +1 -0
- package/lib/cjs/components/Categories/index.js +11 -0
- package/lib/cjs/components/Categories/index.js.map +1 -0
- package/lib/cjs/components/Category/Category.d.ts.map +1 -1
- package/lib/cjs/components/Category/Category.js +10 -2
- package/lib/cjs/components/Category/Category.js.map +1 -1
- package/lib/cjs/components/Category/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/Category/Skeleton.js +22 -4
- package/lib/cjs/components/Category/Skeleton.js.map +1 -1
- package/lib/cjs/components/CommentObject/CommentObject.js +2 -2
- package/lib/cjs/components/CommentObject/CommentObject.js.map +1 -1
- package/lib/cjs/components/CommentObject/ReplyComment/ReplyComment.d.ts +2 -2
- package/lib/cjs/components/CommentObject/ReplyComment/ReplyComment.js +5 -5
- package/lib/cjs/components/CommentObject/ReplyComment/ReplyComment.js.map +1 -1
- package/lib/cjs/components/Composer/Composer.d.ts.map +1 -1
- package/lib/cjs/components/Composer/Composer.js +22 -8
- package/lib/cjs/components/Composer/Composer.js.map +1 -1
- package/lib/cjs/components/Editor/Editor.d.ts +2 -2
- package/lib/cjs/components/Editor/Editor.js +3 -3
- package/lib/cjs/components/Editor/Editor.js.map +1 -1
- package/lib/cjs/components/Editor/nodes/ImageNode.js +1 -1
- package/lib/cjs/components/Editor/nodes/ImageNode.js.map +1 -1
- package/lib/cjs/components/Editor/plugins/EmojiPlugin.d.ts.map +1 -1
- package/lib/cjs/components/Editor/plugins/EmojiPlugin.js +1 -0
- package/lib/cjs/components/Editor/plugins/EmojiPlugin.js.map +1 -1
- package/lib/cjs/components/Editor/plugins/ImagePlugin.d.ts.map +1 -1
- package/lib/cjs/components/Editor/plugins/ImagePlugin.js +3 -1
- package/lib/cjs/components/Editor/plugins/ImagePlugin.js.map +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.js +5 -4
- package/lib/cjs/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/cjs/components/FollowUserButton/FollowUserButton.js +1 -1
- package/lib/cjs/components/FollowUserButton/FollowUserButton.js.map +1 -1
- package/lib/cjs/components/Header/Header.d.ts +8 -0
- package/lib/cjs/components/Header/Header.d.ts.map +1 -1
- package/lib/cjs/components/Header/Header.js +21 -18
- package/lib/cjs/components/Header/Header.js.map +1 -1
- package/lib/cjs/components/Header/HeaderMenu.d.ts +0 -4
- package/lib/cjs/components/Header/HeaderMenu.d.ts.map +1 -1
- package/lib/cjs/components/Header/HeaderMenu.js +13 -13
- package/lib/cjs/components/Header/HeaderMenu.js.map +1 -1
- package/lib/cjs/components/Header/MobileHeader/MobileHeader.d.ts +11 -0
- package/lib/cjs/components/Header/MobileHeader/MobileHeader.d.ts.map +1 -1
- package/lib/cjs/components/Header/MobileHeader/MobileHeader.js +32 -18
- package/lib/cjs/components/Header/MobileHeader/MobileHeader.js.map +1 -1
- package/lib/cjs/components/MessageEditor/MessageMediaUploader/index.js +1 -1
- package/lib/cjs/components/MessageEditor/MessageMediaUploader/index.js.map +1 -1
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.d.ts.map +1 -1
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +39 -5
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js.map +1 -1
- package/lib/cjs/index.d.ts +2 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +6 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/shared/Media/Document/EditComponent.js +1 -1
- package/lib/cjs/shared/Media/Document/EditComponent.js.map +1 -1
- package/lib/cjs/shared/Media/Image/EditComponent.js +1 -1
- package/lib/cjs/shared/Media/Image/EditComponent.js.map +1 -1
- package/lib/cjs/shared/Media/Video/EditComponent.js +1 -1
- package/lib/cjs/shared/Media/Video/EditComponent.js.map +1 -1
- package/lib/cjs/shared/MediaChunkUploader/index.d.ts.map +1 -1
- package/lib/cjs/shared/MediaChunkUploader/index.js +4 -2
- package/lib/cjs/shared/MediaChunkUploader/index.js.map +1 -1
- package/lib/cjs/shared/MessageChunkUploader/index.d.ts.map +1 -1
- package/lib/cjs/shared/MessageChunkUploader/index.js +4 -2
- package/lib/cjs/shared/MessageChunkUploader/index.js.map +1 -1
- package/lib/cjs/shared/VirtualizedScroller/VirtualizedScroller.js +0 -1
- package/lib/cjs/shared/VirtualizedScroller/VirtualizedScroller.js.map +1 -1
- package/lib/esm/components/Categories/Categories.d.ts +75 -0
- package/lib/esm/components/Categories/Categories.d.ts.map +1 -0
- package/lib/esm/components/Categories/Categories.js +159 -0
- package/lib/esm/components/Categories/Categories.js.map +1 -0
- package/lib/esm/components/Categories/Skeleton.d.ts +35 -0
- package/lib/esm/components/Categories/Skeleton.d.ts.map +1 -0
- package/lib/esm/components/Categories/Skeleton.js +65 -0
- package/lib/esm/components/Categories/Skeleton.js.map +1 -0
- package/lib/esm/components/Categories/index.d.ts +5 -0
- package/lib/esm/components/Categories/index.d.ts.map +1 -0
- package/lib/esm/components/Categories/index.js +5 -0
- package/lib/esm/components/Categories/index.js.map +1 -0
- package/lib/esm/components/Category/Category.d.ts.map +1 -1
- package/lib/esm/components/Category/Category.js +10 -2
- package/lib/esm/components/Category/Category.js.map +1 -1
- package/lib/esm/components/Category/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/Category/Skeleton.js +22 -4
- package/lib/esm/components/Category/Skeleton.js.map +1 -1
- package/lib/esm/components/CommentObject/CommentObject.js +2 -2
- package/lib/esm/components/CommentObject/CommentObject.js.map +1 -1
- package/lib/esm/components/CommentObject/ReplyComment/ReplyComment.d.ts +2 -2
- package/lib/esm/components/CommentObject/ReplyComment/ReplyComment.js +5 -5
- package/lib/esm/components/CommentObject/ReplyComment/ReplyComment.js.map +1 -1
- package/lib/esm/components/Composer/Composer.d.ts.map +1 -1
- package/lib/esm/components/Composer/Composer.js +22 -8
- package/lib/esm/components/Composer/Composer.js.map +1 -1
- package/lib/esm/components/Editor/Editor.d.ts +2 -2
- package/lib/esm/components/Editor/Editor.js +3 -3
- package/lib/esm/components/Editor/Editor.js.map +1 -1
- package/lib/esm/components/Editor/nodes/ImageNode.js +1 -1
- package/lib/esm/components/Editor/nodes/ImageNode.js.map +1 -1
- package/lib/esm/components/Editor/plugins/EmojiPlugin.d.ts.map +1 -1
- package/lib/esm/components/Editor/plugins/EmojiPlugin.js +1 -0
- package/lib/esm/components/Editor/plugins/EmojiPlugin.js.map +1 -1
- package/lib/esm/components/Editor/plugins/ImagePlugin.d.ts.map +1 -1
- package/lib/esm/components/Editor/plugins/ImagePlugin.js +4 -2
- package/lib/esm/components/Editor/plugins/ImagePlugin.js.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.js +5 -4
- package/lib/esm/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/esm/components/FollowUserButton/FollowUserButton.js +1 -1
- package/lib/esm/components/FollowUserButton/FollowUserButton.js.map +1 -1
- package/lib/esm/components/Header/Header.d.ts +8 -0
- package/lib/esm/components/Header/Header.d.ts.map +1 -1
- package/lib/esm/components/Header/Header.js +21 -18
- package/lib/esm/components/Header/Header.js.map +1 -1
- package/lib/esm/components/Header/HeaderMenu.d.ts +0 -4
- package/lib/esm/components/Header/HeaderMenu.d.ts.map +1 -1
- package/lib/esm/components/Header/HeaderMenu.js +13 -13
- package/lib/esm/components/Header/HeaderMenu.js.map +1 -1
- package/lib/esm/components/Header/MobileHeader/MobileHeader.d.ts +11 -0
- package/lib/esm/components/Header/MobileHeader/MobileHeader.d.ts.map +1 -1
- package/lib/esm/components/Header/MobileHeader/MobileHeader.js +33 -19
- package/lib/esm/components/Header/MobileHeader/MobileHeader.js.map +1 -1
- package/lib/esm/components/MessageEditor/MessageMediaUploader/index.js +1 -1
- package/lib/esm/components/MessageEditor/MessageMediaUploader/index.js.map +1 -1
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.d.ts.map +1 -1
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +18 -7
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js.map +1 -1
- package/lib/esm/index.d.ts +2 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/shared/Media/Document/EditComponent.js +1 -1
- package/lib/esm/shared/Media/Document/EditComponent.js.map +1 -1
- package/lib/esm/shared/Media/Image/EditComponent.js +1 -1
- package/lib/esm/shared/Media/Image/EditComponent.js.map +1 -1
- package/lib/esm/shared/Media/Video/EditComponent.js +1 -1
- package/lib/esm/shared/Media/Video/EditComponent.js.map +1 -1
- package/lib/esm/shared/MediaChunkUploader/index.d.ts.map +1 -1
- package/lib/esm/shared/MediaChunkUploader/index.js +4 -2
- package/lib/esm/shared/MediaChunkUploader/index.js.map +1 -1
- package/lib/esm/shared/MessageChunkUploader/index.d.ts.map +1 -1
- package/lib/esm/shared/MessageChunkUploader/index.js +4 -2
- package/lib/esm/shared/MessageChunkUploader/index.js.map +1 -1
- package/lib/esm/shared/VirtualizedScroller/VirtualizedScroller.js +0 -1
- package/lib/esm/shared/VirtualizedScroller/VirtualizedScroller.js.map +1 -1
- package/lib/umd/react-ui.js +7 -7
- package/lib/umd/react-ui.js.LICENSE.txt +1 -1
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +17 -17
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { SCCategoryType } from '@selfcommunity/types';
|
|
2
|
+
import { CategoriesSkeletonProps } from './Skeleton';
|
|
3
|
+
import { CategoryProps } from '../Category';
|
|
4
|
+
export interface CategoriesProps {
|
|
5
|
+
/**
|
|
6
|
+
* Overrides or extends the styles applied to the component.
|
|
7
|
+
* @default null
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* CategoryComponent component
|
|
12
|
+
* Usefully to override the single Category render component
|
|
13
|
+
* @default Category
|
|
14
|
+
*/
|
|
15
|
+
CategoryComponent?: (inProps: CategoryProps) => JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Props to spread to single category object
|
|
18
|
+
* @default {variant: 'outlined', ButtonBaseProps: {disableRipple: 'true'}}
|
|
19
|
+
*/
|
|
20
|
+
CategoryComponentProps?: CategoryProps;
|
|
21
|
+
/**
|
|
22
|
+
* CategorySkeletonComponent component
|
|
23
|
+
* Usefully to override the single Category skeleton render component
|
|
24
|
+
* @default Skeleton
|
|
25
|
+
*/
|
|
26
|
+
CategoriesSkeletonComponent?: (inProps: any) => JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Props to spread to single category skeleton object
|
|
29
|
+
* @default {variant: 'outlined'}
|
|
30
|
+
*/
|
|
31
|
+
CategoriesSkeletonProps?: CategoriesSkeletonProps;
|
|
32
|
+
/**
|
|
33
|
+
* Show/Hide filters
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
showFilters?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Filters component
|
|
39
|
+
* @param props
|
|
40
|
+
*/
|
|
41
|
+
filters?: JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* Override filter func
|
|
44
|
+
* @default null
|
|
45
|
+
*/
|
|
46
|
+
handleFilterCategories?: (categories: SCCategoryType[]) => SCCategoryType[];
|
|
47
|
+
/**
|
|
48
|
+
* Other props
|
|
49
|
+
*/
|
|
50
|
+
[p: string]: any;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* > API documentation for the Community-JS Categories component. Learn about the available props and the CSS API.
|
|
54
|
+
*
|
|
55
|
+
#### Import
|
|
56
|
+
```jsx
|
|
57
|
+
import {Categories} from '@selfcommunity/react-ui';
|
|
58
|
+
```
|
|
59
|
+
#### Component Name
|
|
60
|
+
The name `SCCategories` can be used when providing style overrides in the theme.
|
|
61
|
+
|
|
62
|
+
#### CSS
|
|
63
|
+
|
|
64
|
+
|Rule Name|Global class|Description|
|
|
65
|
+
|---|---|---|
|
|
66
|
+
|root|.SCCategories-root|Styles applied to the root element.|
|
|
67
|
+
|filters|.SCCategories-filter|Styles applied to the filter.|
|
|
68
|
+
|categories|.SCCategories-categories|Styles applied to the list of categories.|
|
|
69
|
+
|category|.SCCategories-category|Styles applied to the of category element.|
|
|
70
|
+
|noResults|.SCCategories-no-results|Styles applied to no results section.|
|
|
71
|
+
|
|
72
|
+
* @param inProps
|
|
73
|
+
*/
|
|
74
|
+
export default function CategoriesSuggestion(inProps: CategoriesProps): JSX.Element;
|
|
75
|
+
//# sourceMappingURL=Categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Categories.d.ts","sourceRoot":"","sources":["../../../../src/components/Categories/Categories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAA2B,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAC;AACvE,OAAiB,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAuCpD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,GAAG,CAAC,OAAO,CAAC;IAE5D;;;OAGG;IACH,sBAAsB,CAAC,EAAE,aAAa,CAAC;IAEvC;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,GAAG,CAAC,OAAO,CAAC;IAE5D;;;OAGG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAElD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAEtB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAC;IAE5E;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAyIlF"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
35
|
+
var t = {};
|
|
36
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37
|
+
t[p] = s[p];
|
|
38
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
39
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
40
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
41
|
+
t[p[i]] = s[p[i]];
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
45
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
+
};
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
const react_1 = __importStar(require("react"));
|
|
50
|
+
const styles_1 = require("@mui/material/styles");
|
|
51
|
+
const material_1 = require("@mui/material");
|
|
52
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
53
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
54
|
+
const Skeleton_1 = __importDefault(require("./Skeleton"));
|
|
55
|
+
const Category_1 = __importDefault(require("../Category"));
|
|
56
|
+
const react_intl_1 = require("react-intl");
|
|
57
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
58
|
+
const system_1 = require("@mui/system");
|
|
59
|
+
const Errors_1 = require("../../constants/Errors");
|
|
60
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
61
|
+
const PREFIX = 'SCCategories';
|
|
62
|
+
const classes = {
|
|
63
|
+
root: `${PREFIX}-root`,
|
|
64
|
+
filters: `${PREFIX}-filter`,
|
|
65
|
+
categories: `${PREFIX}-categories`,
|
|
66
|
+
category: `${PREFIX}-category`,
|
|
67
|
+
noResults: `${PREFIX}-no-results`
|
|
68
|
+
};
|
|
69
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
70
|
+
name: PREFIX,
|
|
71
|
+
slot: 'Root',
|
|
72
|
+
overridesResolver: (props, styles) => styles.root
|
|
73
|
+
})(({ theme }) => ({
|
|
74
|
+
[`& .${classes.filters}`]: {
|
|
75
|
+
marginTop: theme.spacing(),
|
|
76
|
+
marginBottom: theme.spacing(2)
|
|
77
|
+
},
|
|
78
|
+
[`& .${classes.category}`]: {
|
|
79
|
+
'& > div': {
|
|
80
|
+
cursor: 'default'
|
|
81
|
+
},
|
|
82
|
+
' .SCCategory-category-image': {
|
|
83
|
+
minWidth: 56,
|
|
84
|
+
height: '100%',
|
|
85
|
+
borderTopLeftRadius: theme.shape.borderRadius,
|
|
86
|
+
borderBottomLeftRadius: theme.shape.borderRadius
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
/**
|
|
91
|
+
* > API documentation for the Community-JS Categories component. Learn about the available props and the CSS API.
|
|
92
|
+
*
|
|
93
|
+
#### Import
|
|
94
|
+
```jsx
|
|
95
|
+
import {Categories} from '@selfcommunity/react-ui';
|
|
96
|
+
```
|
|
97
|
+
#### Component Name
|
|
98
|
+
The name `SCCategories` can be used when providing style overrides in the theme.
|
|
99
|
+
|
|
100
|
+
#### CSS
|
|
101
|
+
|
|
102
|
+
|Rule Name|Global class|Description|
|
|
103
|
+
|---|---|---|
|
|
104
|
+
|root|.SCCategories-root|Styles applied to the root element.|
|
|
105
|
+
|filters|.SCCategories-filter|Styles applied to the filter.|
|
|
106
|
+
|categories|.SCCategories-categories|Styles applied to the list of categories.|
|
|
107
|
+
|category|.SCCategories-category|Styles applied to the of category element.|
|
|
108
|
+
|noResults|.SCCategories-no-results|Styles applied to no results section.|
|
|
109
|
+
|
|
110
|
+
* @param inProps
|
|
111
|
+
*/
|
|
112
|
+
function CategoriesSuggestion(inProps) {
|
|
113
|
+
// PROPS
|
|
114
|
+
const props = (0, system_1.useThemeProps)({
|
|
115
|
+
props: inProps,
|
|
116
|
+
name: PREFIX
|
|
117
|
+
});
|
|
118
|
+
const { className, CategoryComponent = Category_1.default, CategoryComponentProps = { variant: 'outlined', ButtonBaseProps: { disableRipple: 'true', component: material_1.Box } }, CategoriesSkeletonComponent = Skeleton_1.default, CategoriesSkeletonProps = {}, showFilters = true, filters, handleFilterCategories } = props, rest = __rest(props, ["className", "CategoryComponent", "CategoryComponentProps", "CategoriesSkeletonComponent", "CategoriesSkeletonProps", "showFilters", "filters", "handleFilterCategories"]);
|
|
119
|
+
// STATE
|
|
120
|
+
const [categories, setCategories] = (0, react_1.useState)([]);
|
|
121
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
122
|
+
const [filterName, setFilterName] = (0, react_1.useState)(null);
|
|
123
|
+
// CONTEXT
|
|
124
|
+
const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
|
|
125
|
+
// CONST
|
|
126
|
+
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
127
|
+
// REFS
|
|
128
|
+
const isMountedRef = (0, react_core_1.useIsComponentMountedRef)();
|
|
129
|
+
/**
|
|
130
|
+
* Fetches categories list
|
|
131
|
+
*/
|
|
132
|
+
const fetchCategories = (next = api_services_1.Endpoints.CategoryList.url({})) => __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
const data = yield api_services_1.CategoryService.getAllCategories({ active: true }, { url: next });
|
|
134
|
+
return data.next ? data.results.concat(yield fetchCategories(data.next)) : data.results;
|
|
135
|
+
});
|
|
136
|
+
/**
|
|
137
|
+
* On mount, fetches categories list
|
|
138
|
+
*/
|
|
139
|
+
(0, react_1.useEffect)(() => {
|
|
140
|
+
if (scUserContext.user) {
|
|
141
|
+
fetchCategories()
|
|
142
|
+
.then((data) => {
|
|
143
|
+
if (isMountedRef.current) {
|
|
144
|
+
setCategories(data);
|
|
145
|
+
setLoading(false);
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
.catch((error) => {
|
|
149
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}, [authUserId]);
|
|
153
|
+
/**
|
|
154
|
+
* Get categories filtered
|
|
155
|
+
*/
|
|
156
|
+
const getFilteredCategories = () => {
|
|
157
|
+
if (handleFilterCategories) {
|
|
158
|
+
return handleFilterCategories(categories);
|
|
159
|
+
}
|
|
160
|
+
if (filterName) {
|
|
161
|
+
return categories.filter((c) => c.name.toLowerCase().includes(filterName.toLowerCase()));
|
|
162
|
+
}
|
|
163
|
+
return categories;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Handle change filter name
|
|
167
|
+
* @param event
|
|
168
|
+
*/
|
|
169
|
+
const handleOnChangeFilterName = (event) => {
|
|
170
|
+
setFilterName(event.target.value);
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Renders categories list
|
|
174
|
+
*/
|
|
175
|
+
const c = (react_1.default.createElement(material_1.Box, null, !categories.length && !loading ? (react_1.default.createElement(material_1.Typography, { className: classes.noResults, variant: "body2" },
|
|
176
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.categoriesSuggestion.noResults", defaultMessage: "ui.categoriesSuggestion.noResults" }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
177
|
+
showFilters && (react_1.default.createElement(material_1.Grid, { container: true, direction: "row", justifyContent: "center", alignItems: "center", className: classes.filters }, filters ? (filters) : (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, md: 6 },
|
|
178
|
+
react_1.default.createElement(material_1.TextField, { fullWidth: true, value: filterName, label: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.categories.filterByName", defaultMessage: "ui.categories.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading }))))),
|
|
179
|
+
react_1.default.createElement(material_1.Grid, { container: true, spacing: { xs: 3 }, className: classes.categories }, loading ? (react_1.default.createElement(material_1.Grid, { item: true },
|
|
180
|
+
react_1.default.createElement(CategoriesSkeletonComponent, Object.assign({}, CategoriesSkeletonProps)))) : (react_1.default.createElement(react_1.default.Fragment, null, getFilteredCategories().map((category) => (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, sm: 6, md: 4, key: category.id },
|
|
181
|
+
react_1.default.createElement(CategoryComponent, Object.assign({ category: category }, CategoryComponentProps, { className: classes.category }))))))))))));
|
|
182
|
+
/**
|
|
183
|
+
* Renders root object
|
|
184
|
+
*/
|
|
185
|
+
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest), c));
|
|
186
|
+
}
|
|
187
|
+
exports.default = CategoriesSuggestion;
|
|
188
|
+
//# sourceMappingURL=Categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Categories.js","sourceRoot":"","sources":["../../../../src/components/Categories/Categories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA6D;AAC7D,iDAA4C;AAC5C,4CAA+D;AAC/D,8DAAuE;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,iBAAiB,kBAAC,QAAQ,EAAE,QAAQ,IAAM,sBAAsB,IAAE,SAAS,EAAE,OAAO,CAAC,QAAQ,IAAI,CAC7F,CACR,CAAC,CACD,CACJ,CACI,CACN,CACJ,CACG,CACP,CAAC;IAEF;;OAEG;IACH,OAAO,CACL,8BAAC,IAAI,kBAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,IAAM,IAAI,GAC3D,CAAC,CACG,CACR,CAAC;AACJ,CAAC;AAzID,uCAyIC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface CategoriesSkeletonProps {
|
|
2
|
+
/**
|
|
3
|
+
* Overrides or extends the styles applied to the component.
|
|
4
|
+
* @default null
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Overrides or extends the styles applied to the component.
|
|
9
|
+
* @default null
|
|
10
|
+
*/
|
|
11
|
+
CategorySkeletonProps?: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* > API documentation for the Community-JS Categories Skeleton component. Learn about the available props and the CSS API.
|
|
15
|
+
|
|
16
|
+
#### Import
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
import {CategoriesSkeleton} from '@selfcommunity/react-ui';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
#### Component Name
|
|
23
|
+
|
|
24
|
+
The name `SCCategoriesSkeleton` can be used when providing style overrides in the theme.
|
|
25
|
+
|
|
26
|
+
#### CSS
|
|
27
|
+
|
|
28
|
+
|Rule Name|Global class|Description|
|
|
29
|
+
|---|---|---|
|
|
30
|
+
|root|.SCCategoriesSkeleton-root|Styles applied to the root element.|
|
|
31
|
+
|categories|.SCCategoriesSkeleton-categories|Styles applied to the categories element.|
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export default function CategoriesSkeleton(inProps: CategoriesSkeletonProps): JSX.Element;
|
|
35
|
+
//# sourceMappingURL=Skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Categories/Skeleton.tsx"],"names":[],"mappings":"AA8BA,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,GAAG,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,OAAO,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAcxF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const styles_1 = require("@mui/material/styles");
|
|
19
|
+
const material_1 = require("@mui/material");
|
|
20
|
+
const Skeleton_1 = __importDefault(require("../Category/Skeleton"));
|
|
21
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
22
|
+
const PREFIX = 'SCCategoriesSkeleton';
|
|
23
|
+
const classes = {
|
|
24
|
+
root: `${PREFIX}-root`,
|
|
25
|
+
categories: `${PREFIX}-categories`
|
|
26
|
+
};
|
|
27
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
28
|
+
name: PREFIX,
|
|
29
|
+
slot: 'Root',
|
|
30
|
+
overridesResolver: (props, styles) => styles.root
|
|
31
|
+
})(({ theme }) => ({
|
|
32
|
+
[`& .${classes.categories}`]: {
|
|
33
|
+
' .SCBaseItem-image': {
|
|
34
|
+
borderTopLeftRadius: theme.shape.borderRadius,
|
|
35
|
+
borderBottomLeftRadius: theme.shape.borderRadius,
|
|
36
|
+
'& > span': {
|
|
37
|
+
width: '56px !important',
|
|
38
|
+
height: '56px !important'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
/**
|
|
44
|
+
* > API documentation for the Community-JS Categories Skeleton component. Learn about the available props and the CSS API.
|
|
45
|
+
|
|
46
|
+
#### Import
|
|
47
|
+
|
|
48
|
+
```jsx
|
|
49
|
+
import {CategoriesSkeleton} from '@selfcommunity/react-ui';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Component Name
|
|
53
|
+
|
|
54
|
+
The name `SCCategoriesSkeleton` can be used when providing style overrides in the theme.
|
|
55
|
+
|
|
56
|
+
#### CSS
|
|
57
|
+
|
|
58
|
+
|Rule Name|Global class|Description|
|
|
59
|
+
|---|---|---|
|
|
60
|
+
|root|.SCCategoriesSkeleton-root|Styles applied to the root element.|
|
|
61
|
+
|categories|.SCCategoriesSkeleton-categories|Styles applied to the categories element.|
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
function CategoriesSkeleton(inProps) {
|
|
65
|
+
const { className, CategorySkeletonProps = {} } = inProps, rest = __rest(inProps, ["className", "CategorySkeletonProps"]);
|
|
66
|
+
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest),
|
|
67
|
+
react_1.default.createElement(material_1.Grid, { container: true, spacing: { xs: 3 }, className: classes.categories }, [...Array(15)].map((category, index) => (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, sm: 6, md: 4, key: index },
|
|
68
|
+
react_1.default.createElement(Skeleton_1.default, Object.assign({ elevation: 0, variant: 'outlined' }, CategorySkeletonProps))))))));
|
|
69
|
+
}
|
|
70
|
+
exports.default = CategoriesSkeleton;
|
|
71
|
+
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sourceRoot":"","sources":["../../../../src/components/Categories/Skeleton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAA4C;AAC5C,4CAAwC;AACxC,oEAAoD;AACpD,4DAAoC;AAEpC,MAAM,MAAM,GAAG,sBAAsB,CAAC;AAEtC,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,UAAU,EAAE,GAAG,MAAM,aAAa;CACnC,CAAC;AAEF,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,cAAG,EAAE;IACvB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI;CAClD,CAAC,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC;IACf,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE;QAC5B,oBAAoB,EAAE;YACpB,mBAAmB,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY;YAC7C,sBAAsB,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY;YAChD,UAAU,EAAE;gBACV,KAAK,EAAE,iBAAiB;gBACxB,MAAM,EAAE,iBAAiB;aAC1B;SACF;KACF;CACF,CAAC,CAAC,CAAC;AAgBJ;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAwB,kBAAkB,CAAC,OAAgC;IACzE,MAAM,EAAC,SAAS,EAAE,qBAAqB,GAAG,EAAE,KAAa,OAAO,EAAf,IAAI,UAAI,OAAO,EAA1D,sCAAgD,CAAU,CAAC;IAEjE,OAAO,CACL,8BAAC,IAAI,kBAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,IAAM,IAAI;QAC5D,8BAAC,eAAI,IAAC,SAAS,QAAC,OAAO,EAAE,EAAC,EAAE,EAAE,CAAC,EAAC,EAAE,SAAS,EAAE,OAAO,CAAC,UAAU,IAC5D,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CACvC,8BAAC,eAAI,IAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK;YACzC,8BAAC,kBAAgB,kBAAC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,IAAM,qBAAqB,EAAI,CAC7E,CACR,CAAC,CACG,CACF,CACR,CAAC;AACJ,CAAC;AAdD,qCAcC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Categories, { CategoriesProps } from './Categories';
|
|
2
|
+
import CategoriesSkeleton, { CategoriesSkeletonProps } from './Skeleton';
|
|
3
|
+
export default Categories;
|
|
4
|
+
export { CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps };
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Categories/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AACzD,OAAO,kBAAkB,EAAE,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAC;AACvE,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAE,uBAAuB,EAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CategoriesSkeleton = void 0;
|
|
7
|
+
const Categories_1 = __importDefault(require("./Categories"));
|
|
8
|
+
const Skeleton_1 = __importDefault(require("./Skeleton"));
|
|
9
|
+
exports.CategoriesSkeleton = Skeleton_1.default;
|
|
10
|
+
exports.default = Categories_1.default;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Categories/index.tsx"],"names":[],"mappings":";;;;;;AAAA,8DAAyD;AACzD,0DAAuE;AAE9C,6BAFlB,kBAAkB,CAEkB;AAD3C,kBAAe,oBAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../../src/components/Category/Category.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEpD,OAAqB,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAKhF,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../../src/components/Category/Category.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEpD,OAAqB,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAKhF,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAgCtC,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CA+CpE"}
|
|
@@ -41,7 +41,15 @@ const Root = (0, styles_1.styled)(BaseItemButton_1.default, {
|
|
|
41
41
|
name: PREFIX,
|
|
42
42
|
slot: 'Root',
|
|
43
43
|
overridesResolver: (props, styles) => styles.root
|
|
44
|
-
})(({ theme }) => ({
|
|
44
|
+
})(({ theme }) => ({
|
|
45
|
+
'& .SCBaseItemButton-primary, & .SCBaseItemButton-secondary': {
|
|
46
|
+
whiteSpace: 'nowrap',
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
textOverflow: 'ellipsis',
|
|
49
|
+
display: 'block',
|
|
50
|
+
width: '44%'
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
45
53
|
/**
|
|
46
54
|
* > API documentation for the Community-JS Category component. Learn about the available props and the CSS API.
|
|
47
55
|
*
|
|
@@ -81,7 +89,7 @@ function Category(inProps) {
|
|
|
81
89
|
}
|
|
82
90
|
// RENDER
|
|
83
91
|
if (!autoHide) {
|
|
84
|
-
return (react_1.default.createElement(Root, Object.assign({ elevation: elevation
|
|
92
|
+
return (react_1.default.createElement(Root, Object.assign({ elevation: elevation, className: (0, classnames_1.default)(classes.root, className), ButtonBaseProps: { component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.CATEGORY_ROUTE_NAME, scCategory) }, image: react_1.default.createElement(material_1.Avatar, { alt: scCategory.name, src: scCategory.image_medium, variant: "square", className: classes.categoryImage }), primary: scCategory.name, secondary: showFollowers ? `${intl.formatMessage(messages.categoryFollowers, { total: scCategory.followers_counter })}` : scCategory.slogan, actions: react_1.default.createElement(FollowCategoryButton_1.default, Object.assign({ category: scCategory }, followCategoryButtonProps)) }, rest)));
|
|
85
93
|
}
|
|
86
94
|
return null;
|
|
87
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Category.js","sourceRoot":"","sources":["../../../../src/components/Category/Category.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAA4C;AAC5C,4CAAqC;AACrC,0DAAiH;AAEjH,0DAA0C;AAC1C,mFAAgF;AAChF,2CAAmD;AACnD,4DAAoC;AACpC,wCAA0C;AAC1C,iFAAyD;AAGzD,MAAM,QAAQ,GAAG,IAAA,2BAAc,EAAC;IAC9B,iBAAiB,EAAE;QACjB,EAAE,EAAE,+BAA+B;QACnC,cAAc,EAAE,+BAA+B;KAChD;CACF,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,YAAY,CAAC;AAE5B,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,aAAa,EAAE,GAAG,MAAM,iBAAiB;IACzC,KAAK,EAAE,GAAG,MAAM,QAAQ;IACxB,OAAO,EAAE,GAAG,MAAM,UAAU;CAC7B,CAAC;AAEF,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,wBAAc,EAAE;IAClC,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI;CAClD,CAAC,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Category.js","sourceRoot":"","s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,UAAU,CAAC,MAAM,EACzI,OAAO,EAAE,8BAAC,8BAAY,kBAAC,QAAQ,EAAE,UAAU,IAAM,yBAAyB,EAAI,IAC1E,IAAI,EACR,CACH,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AA/CD,2BA+CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Category/Skeleton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Category/Skeleton.tsx"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,KAAA,GAAG,GAAG,CAAC,OAAO,CAe3D"}
|
|
@@ -10,9 +10,27 @@ const material_1 = require("@mui/material");
|
|
|
10
10
|
const BaseItem_1 = __importDefault(require("../../shared/BaseItem"));
|
|
11
11
|
const PREFIX = 'SCCategorySkeleton';
|
|
12
12
|
const classes = {
|
|
13
|
-
root: `${PREFIX}-root
|
|
13
|
+
root: `${PREFIX}-root`,
|
|
14
|
+
image: `${PREFIX}-image`,
|
|
15
|
+
primary: `${PREFIX}-primary`,
|
|
16
|
+
secondary: `${PREFIX}-secondary`,
|
|
17
|
+
button: `${PREFIX}-button`,
|
|
18
|
+
action: `${PREFIX}-action`
|
|
14
19
|
};
|
|
15
|
-
const Root = (0, styles_1.styled)(BaseItem_1.default)(({ theme }) => ({
|
|
20
|
+
const Root = (0, styles_1.styled)(BaseItem_1.default)(({ theme }) => ({
|
|
21
|
+
[`& .${classes.primary}`]: {
|
|
22
|
+
marginBottom: theme.spacing()
|
|
23
|
+
},
|
|
24
|
+
[`& .${classes.secondary}`]: {
|
|
25
|
+
marginBottom: theme.spacing()
|
|
26
|
+
},
|
|
27
|
+
[`& .${classes.button}`]: {
|
|
28
|
+
margin: theme.spacing()
|
|
29
|
+
},
|
|
30
|
+
[`& .${classes.action}`]: {
|
|
31
|
+
margin: theme.spacing()
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
16
34
|
/**
|
|
17
35
|
* > API documentation for the Community-JS Category Skeleton component. Learn about the available props and the CSS API.
|
|
18
36
|
|
|
@@ -34,8 +52,8 @@ const Root = (0, styles_1.styled)(BaseItem_1.default)(({ theme }) => ({}));
|
|
|
34
52
|
*
|
|
35
53
|
*/
|
|
36
54
|
function CategorySkeleton(props) {
|
|
37
|
-
return (react_1.default.createElement(Root, Object.assign({ className: classes.root }, props, { image: react_1.default.createElement(Skeleton_1.default, { animation: "wave", variant: "rectangular", width: 40, height: 40 }), primary: react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 120,
|
|
38
|
-
react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 50,
|
|
55
|
+
return (react_1.default.createElement(Root, Object.assign({ className: classes.root }, props, { image: react_1.default.createElement(Skeleton_1.default, { animation: "wave", variant: "rectangular", width: 40, height: 40, className: classes.image }), primary: react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 120, className: classes.primary }), secondary: react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 70, className: classes.secondary }), actions: react_1.default.createElement(material_1.Button, { size: "small", variant: "outlined", disabled: true, className: classes.button },
|
|
56
|
+
react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 50, className: classes.action })) })));
|
|
39
57
|
}
|
|
40
58
|
exports.default = CategorySkeleton;
|
|
41
59
|
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.js","sourceRoot":"","sources":["../../../../src/components/Category/Skeleton.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,iDAA4C;AAC5C,sEAA8C;AAC9C,4CAAqC;AACrC,qEAA6C;AAE7C,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAEpC,MAAM,OAAO,GAAG;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,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,aAAa,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,GAAI,EAC3G,OAAO,EAAE,8BAAC,kBAAQ,IAAC,SAAS,EAAC,MAAM,EAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,GAAI,EAC1F,SAAS,EAAE,8BAAC,kBAAQ,IAAC,SAAS,EAAC,MAAM,EAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,GAAI,EAC7F,OAAO,EACL,8BAAC,iBAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,UAAU,EAAC,QAAQ,QAAC,SAAS,EAAE,OAAO,CAAC,MAAM;YACxE,8BAAC,kBAAQ,IAAC,SAAS,EAAC,MAAM,EAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,GAAI,CACxE,IAEX,CACH,CAAC;AACJ,CAAC;AAfD,mCAeC"}
|
|
@@ -519,7 +519,7 @@ function CommentObject(inProps) {
|
|
|
519
519
|
}
|
|
520
520
|
return (react_1.default.createElement(react_1.default.Fragment, { key: comment.id },
|
|
521
521
|
editComment && editComment.id === comment.id ? (react_1.default.createElement(material_1.Box, { className: classes.comment },
|
|
522
|
-
react_1.default.createElement(ReplyComment_1.default, Object.assign({ text: comment.html, autoFocus: true, id: `edit-${comment.id}`, onSave: handleSave, onCancel: handleCancel,
|
|
522
|
+
react_1.default.createElement(ReplyComment_1.default, Object.assign({ text: comment.html, autoFocus: true, id: `edit-${comment.id}`, onSave: handleSave, onCancel: handleCancel, editable: !isReplying || !isSavingComment }, ReplyCommentObjectProps)))) : (react_1.default.createElement(BaseItem_1.default, { elevation: 0, className: classes.comment, image: react_1.default.createElement(react_core_1.Link, { to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, comment.author) },
|
|
523
523
|
react_1.default.createElement(material_1.Avatar, { alt: obj.author.username, variant: "circular", src: comment.author.avatar, className: classes.avatar })), disableTypography: true, primary: react_1.default.createElement(react_1.default.Fragment, null,
|
|
524
524
|
react_1.default.createElement(Widget_1.default, Object.assign({ className: classes.content, elevation: elevation }, rest),
|
|
525
525
|
react_1.default.createElement(material_1.CardContent, { className: (0, classnames_1.default)({ [classes.deleted]: obj && obj.deleted }) },
|
|
@@ -537,7 +537,7 @@ function CommentObject(inProps) {
|
|
|
537
537
|
renderVotes(comment))) })),
|
|
538
538
|
comment.comment_count > 0 && react_1.default.createElement(material_1.Box, { className: classes.nestedComments }, renderLatestComment(comment)),
|
|
539
539
|
scUserContext.user && replyComment && (replyComment.id === comment.id || replyComment.parent === comment.id) && !comment.parent && (react_1.default.createElement(material_1.Box, { className: classes.nestedComments },
|
|
540
|
-
react_1.default.createElement(ReplyComment_1.default, Object.assign({ text: `@${replyComment.author.username}, `, autoFocus: true, key: `reply-${replyComment.id}`, id: `reply-${replyComment.id}`, onReply: handleReply,
|
|
540
|
+
react_1.default.createElement(ReplyComment_1.default, Object.assign({ text: `@${replyComment.author.username}, `, autoFocus: true, key: `reply-${replyComment.id}`, id: `reply-${replyComment.id}`, onReply: handleReply, editable: !isReplying }, ReplyCommentObjectProps))))));
|
|
541
541
|
}
|
|
542
542
|
/**
|
|
543
543
|
* Render Latest Comment
|