@selfcommunity/react-ui 0.10.2-courses.107 → 0.10.2-courses.109
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/CategoryAutocomplete/CategoryAutocomplete.js +6 -8
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +3 -3
- package/lib/cjs/components/Courses/Courses.js +2 -2
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +5 -5
- package/lib/cjs/components/EditCourse/EditCourse.d.ts +3 -3
- package/lib/cjs/components/EditCourse/types.d.ts +0 -1
- package/lib/cjs/components/EventForm/EventForm.js +8 -6
- package/lib/cjs/components/LessonObject/LessonObject.js +1 -1
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +6 -4
- package/lib/cjs/components/TagAutocomplete/TagAutocomplete.js +3 -3
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/index.js +7 -6
- package/lib/cjs/types/course.d.ts +8 -0
- package/lib/cjs/types/course.js +9 -1
- package/lib/cjs/types/index.d.ts +4 -2
- package/lib/cjs/types/index.js +2 -1
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +6 -8
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +3 -3
- package/lib/esm/components/Courses/Courses.js +2 -2
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +5 -5
- package/lib/esm/components/EditCourse/EditCourse.d.ts +3 -3
- package/lib/esm/components/EditCourse/types.d.ts +0 -1
- package/lib/esm/components/EventForm/EventForm.js +9 -7
- package/lib/esm/components/LessonObject/LessonObject.js +1 -1
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +6 -4
- package/lib/esm/components/TagAutocomplete/TagAutocomplete.js +3 -3
- package/lib/esm/index.d.ts +2 -2
- package/lib/esm/index.js +2 -2
- package/lib/esm/types/course.d.ts +8 -0
- package/lib/esm/types/course.js +8 -0
- package/lib/esm/types/index.d.ts +4 -2
- package/lib/esm/types/index.js +2 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 =
|
|
5
|
+
const react_1 = require("react");
|
|
6
6
|
const react_intl_1 = require("react-intl");
|
|
7
7
|
const Autocomplete_1 = tslib_1.__importDefault(require("@mui/material/Autocomplete"));
|
|
8
8
|
const TextField_1 = tslib_1.__importDefault(require("@mui/material/TextField"));
|
|
@@ -21,7 +21,7 @@ const classes = {
|
|
|
21
21
|
const Root = (0, styles_1.styled)(Autocomplete_1.default, {
|
|
22
22
|
name: PREFIX,
|
|
23
23
|
slot: 'Root',
|
|
24
|
-
overridesResolver: (
|
|
24
|
+
overridesResolver: (_props, styles) => styles.root
|
|
25
25
|
})(() => ({}));
|
|
26
26
|
/**
|
|
27
27
|
* > API documentation for the Community-JS Category Autocomplete component. Learn about the available props and the CSS API.
|
|
@@ -57,8 +57,6 @@ const CategoryAutocomplete = (inProps) => {
|
|
|
57
57
|
} } = props, rest = tslib_1.__rest(props, ["onChange", "multiple", "defaultValue", "limitCountCategories", "checkboxSelect", "disabled", "TextFieldProps"]);
|
|
58
58
|
// State
|
|
59
59
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
61
|
-
// @ts-ignore
|
|
62
60
|
const [value, setValue] = (0, react_1.useState)(typeof defaultValue === 'string' ? null : defaultValue);
|
|
63
61
|
// HOOKS
|
|
64
62
|
const { categories, isLoading } = (0, react_core_1.useSCFetchCategories)();
|
|
@@ -66,7 +64,7 @@ const CategoryAutocomplete = (inProps) => {
|
|
|
66
64
|
if (value === null) {
|
|
67
65
|
return;
|
|
68
66
|
}
|
|
69
|
-
onChange
|
|
67
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
70
68
|
}, [value]);
|
|
71
69
|
(0, react_1.useEffect)(() => {
|
|
72
70
|
if (!isLoading && typeof defaultValue === 'string') {
|
|
@@ -80,7 +78,7 @@ const CategoryAutocomplete = (inProps) => {
|
|
|
80
78
|
const handleClose = () => {
|
|
81
79
|
setOpen(false);
|
|
82
80
|
};
|
|
83
|
-
const handleChange = (
|
|
81
|
+
const handleChange = (_event, value) => {
|
|
84
82
|
let newValue = null;
|
|
85
83
|
if (multiple && limitCountCategories > 0) {
|
|
86
84
|
const [...rest] = value;
|
|
@@ -97,9 +95,9 @@ const CategoryAutocomplete = (inProps) => {
|
|
|
97
95
|
}, renderOption: (props, option, { selected, inputValue }) => {
|
|
98
96
|
const matches = (0, match_1.default)(option.name, inputValue);
|
|
99
97
|
const parts = (0, parse_1.default)(option.name, matches);
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)("li", Object.assign({}, props, { children: [checkboxSelect && (0, jsx_runtime_1.jsx)(Checkbox_1.default, { style: { marginRight: 8 }, checked: selected }), (0, jsx_runtime_1.jsx)(material_1.Chip, { label: (0, jsx_runtime_1.jsx)(react_1.
|
|
98
|
+
return ((0, jsx_runtime_1.jsxs)("li", Object.assign({}, props, { children: [checkboxSelect && (0, jsx_runtime_1.jsx)(Checkbox_1.default, { style: { marginRight: 8 }, checked: selected }), (0, jsx_runtime_1.jsx)(material_1.Chip, { label: (0, jsx_runtime_1.jsx)(react_1.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) })] }), props['key']));
|
|
101
99
|
}, renderInput: (params) => {
|
|
102
|
-
return ((0, jsx_runtime_1.jsx)(TextField_1.default, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'categories', endAdornment: ((0, jsx_runtime_1.jsxs)(react_1.
|
|
100
|
+
return ((0, jsx_runtime_1.jsx)(TextField_1.default, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'categories', endAdornment: ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [isLoading ? (0, jsx_runtime_1.jsx)(CircularProgress_1.default, { color: "inherit", size: 20 }) : null, params.InputProps.endAdornment] })) }) })));
|
|
103
101
|
} }, rest)));
|
|
104
102
|
};
|
|
105
103
|
exports.default = CategoryAutocomplete;
|
|
@@ -79,10 +79,10 @@ const AudienceLayer = react_1.default.forwardRef((props, ref) => {
|
|
|
79
79
|
? onSave(value)
|
|
80
80
|
: onSave((value === null || value === void 0 ? void 0 : value.length) && (value === null || value === void 0 ? void 0 : value.length) > 0 ? value : null);
|
|
81
81
|
}, [value, onSave, audience]);
|
|
82
|
-
const handleChange = (0, react_1.useCallback)((
|
|
82
|
+
const handleChange = (0, react_1.useCallback)((_event, tags) => setValue(tags), []);
|
|
83
83
|
const handleEventChange = (0, react_1.useCallback)((event) => setValue(event), []);
|
|
84
84
|
const handleGroupChange = (0, react_1.useCallback)((group) => setValue(group), []);
|
|
85
|
-
const handleChangeAudience = (0, react_1.useCallback)((
|
|
85
|
+
const handleChangeAudience = (0, react_1.useCallback)((_event, data) => setAudience(data), []);
|
|
86
86
|
const handleAutocompleteOpen = (0, react_1.useCallback)(() => setAutocompleteOpen(true), []);
|
|
87
87
|
const handleAutocompleteClose = (0, react_1.useCallback)(() => setAutocompleteOpen(false), []);
|
|
88
88
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ ref: ref, className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, Object.assign({ className: classes.title }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "arrow_back" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.title", defaultMessage: "ui.composer.layer.audience.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSave }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.save", defaultMessage: "ui.composer.layer.save" }) }))] })), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Tabs, Object.assign({ value: audience, onChange: handleChangeAudience, "aria-label": "audience type" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { value: AudienceTypes.AUDIENCE_ALL, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "public" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.all", defaultMessage: "ui.composer.layer.audience.all" }) }), eventsEnabled && ((0, jsx_runtime_1.jsx)(material_1.Tab, { disabled: (Boolean(value === null || value === void 0 ? void 0 : value.length) && !Object.prototype.hasOwnProperty.call(value, 'recurring')) ||
|
|
@@ -94,7 +94,7 @@ const AudienceLayer = react_1.default.forwardRef((props, ref) => {
|
|
|
94
94
|
}, renderOption: (props, option, { selected, inputValue }) => {
|
|
95
95
|
const matches = (0, match_1.default)(option.name, inputValue);
|
|
96
96
|
const parts = (0, parse_1.default)(option.name, matches);
|
|
97
|
-
return ((0, jsx_runtime_1.jsx)("li", Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(TagChip_1.default, { tag: option, label: (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) }, option.id) })));
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)("li", Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(TagChip_1.default, { tag: option, label: (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) }, option.id) }), props['key']));
|
|
98
98
|
}, renderInput: (params) => {
|
|
99
99
|
return ((0, jsx_runtime_1.jsx)(TextField_1.default, Object.assign({}, params, TextFieldProps, { InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'addressing', endAdornment: (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: params.InputProps.endAdornment }) }) })));
|
|
100
100
|
} })), audience === AudienceTypes.AUDIENCE_GROUP && (0, jsx_runtime_1.jsx)(GroupAutocomplete_1.default, { onChange: handleGroupChange, defaultValue: defaultValue }), audience === AudienceTypes.AUDIENCE_EVENT && (0, jsx_runtime_1.jsx)(EventAutocomplete_1.default, { onChange: handleEventChange, defaultValue: defaultValue })] }))] })));
|
|
@@ -135,7 +135,7 @@ function Courses(inProps) {
|
|
|
135
135
|
.request({
|
|
136
136
|
url: endpoint.url({}),
|
|
137
137
|
method: endpoint.method,
|
|
138
|
-
params: Object.assign(Object.assign(Object.assign(Object.assign({}, endpointQueryParams), (_categories.length && { categories: JSON.stringify(_categories) })), (query && { search: query })), (showMyCourses && {
|
|
138
|
+
params: Object.assign(Object.assign(Object.assign(Object.assign({}, endpointQueryParams), (_categories.length && { categories: JSON.stringify(_categories) })), (query && { search: query })), (showMyCourses && { statuses: JSON.stringify(['creator']) }))
|
|
139
139
|
})
|
|
140
140
|
.then((res) => {
|
|
141
141
|
setCourses(res.data.results);
|
|
@@ -224,7 +224,7 @@ function Courses(inProps) {
|
|
|
224
224
|
// @ts-expect-error this is needed to use showForMe into SCCourses
|
|
225
225
|
showForMe: showMyCourses, deleteIcon: showMyCourses ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showMyCourses ? () => setShowMyCourses(false) : null, disabled: loading || showForMe }) }))), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: "auto" }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(CategoryAutocomplete_1.default, { onChange: handleOnChangeCategory, className: classes.category, size: "small", multiple: true }) })) })), authUserId && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.CoursesChipRoot, { color: showForMe ? 'primary' : 'default', variant: showForMe ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.filterByCoursesForMe", defaultMessage: "ui.courses.filterByCoursesForMe" }), onClick: handleChipClick,
|
|
226
226
|
// @ts-expect-error this is needed to use showForMe into SCCourses
|
|
227
|
-
showForMe: showForMe, deleteIcon: showForMe ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showForMe ? handleDeleteClick : null, disabled: loading || showMyCourses }) })))] })) }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({}, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !courses.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: !canCreateCourse && onlyStaffEnabled ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.studentEmptyView }, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.emptyBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.emptyRotatedBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.emptyIcon, color: "disabled", fontSize: "large" }, { children: "courses" })) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.empty.title", defaultMessage: "ui.courses.empty.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.empty.info", defaultMessage: "ui.courses.empty.info" }) })), (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ coursesNumber: 4 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps }))] }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.teacherEmptyView }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ teacherView: (onlyStaffEnabled && canCreateCourse) || !onlyStaffEnabled, coursesNumber: 1 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps })) }))) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.courses }, GridContainerComponentProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [courses.map((course) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3, className: classes.item }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Course_1.default, Object.assign({ courseId: course.id }, CourseComponentProps)) }), course.id))), authUserId && courses.length % 2 !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3, className: classes.itemPlaceholder }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(CreatePlaceholder_1.default, { CreateCourseButtonComponentProps: CreateCourseButtonComponentProps }) }),
|
|
227
|
+
showForMe: showForMe, deleteIcon: showForMe ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showForMe ? handleDeleteClick : null, disabled: loading || showMyCourses }) })))] })) }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({}, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !courses.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: !canCreateCourse && onlyStaffEnabled ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.studentEmptyView }, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.emptyBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.emptyRotatedBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.emptyIcon, color: "disabled", fontSize: "large" }, { children: "courses" })) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.empty.title", defaultMessage: "ui.courses.empty.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.empty.info", defaultMessage: "ui.courses.empty.info" }) })), !isMobile && ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ coursesNumber: 4 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps })))] }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.teacherEmptyView }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ teacherView: (onlyStaffEnabled && canCreateCourse) || !onlyStaffEnabled, coursesNumber: 1 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps })) }))) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.courses }, GridContainerComponentProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [courses.map((course) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3, className: classes.item }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Course_1.default, Object.assign({ courseId: course.id }, CourseComponentProps)) }), course.id))), authUserId && courses.length % 2 !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3, className: classes.itemPlaceholder }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(CreatePlaceholder_1.default, { CreateCourseButtonComponentProps: CreateCourseButtonComponentProps }) }), "placeholder-item"))] }) })), Boolean(next) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.button.seeMore", defaultMessage: "ui.courses.button.seeMore" }) })))] })) })) })] }));
|
|
228
228
|
/**
|
|
229
229
|
* Renders root object (if content availability community option is false and user is anonymous, component is hidden)
|
|
230
230
|
*/
|
|
@@ -59,7 +59,7 @@ const Transition = react_1.default.forwardRef(function Transition(props, ref) {
|
|
|
59
59
|
* @param inProps
|
|
60
60
|
*/
|
|
61
61
|
function CreateLiveStreamDialog(inProps) {
|
|
62
|
-
var _a
|
|
62
|
+
var _a;
|
|
63
63
|
//PROPS
|
|
64
64
|
const props = (0, system_1.useThemeProps)({
|
|
65
65
|
props: inProps,
|
|
@@ -68,8 +68,8 @@ function CreateLiveStreamDialog(inProps) {
|
|
|
68
68
|
const { className, open = true, onClose, onSuccess } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "onSuccess"]);
|
|
69
69
|
// CONTEXT
|
|
70
70
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
71
|
-
|
|
72
|
-
const canCreateEvent = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_event; }, [(
|
|
71
|
+
// PERMISSION
|
|
72
|
+
const canCreateEvent = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_event; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
|
|
73
73
|
// STATE
|
|
74
74
|
const [step, setStep] = (0, react_1.useState)(canCreateEvent ? types_2.CreateLiveStreamStep.SELECT_TYPE : types_2.CreateLiveStreamStep.CREATE_LIVE);
|
|
75
75
|
const [liveType, setLiveType] = (0, react_1.useState)(canCreateEvent ? null : types_2.LiveStreamType.DIRECT_LIVE);
|
|
@@ -87,14 +87,14 @@ function CreateLiveStreamDialog(inProps) {
|
|
|
87
87
|
}, []);
|
|
88
88
|
const handleSubmit = (0, react_1.useCallback)((e) => {
|
|
89
89
|
onSuccess && onSuccess(e);
|
|
90
|
-
}, []);
|
|
90
|
+
}, [onSuccess]);
|
|
91
91
|
(0, react_1.useEffect)(() => {
|
|
92
92
|
if (!canCreateEvent) {
|
|
93
93
|
setLiveType(types_2.LiveStreamType.DIRECT_LIVE);
|
|
94
94
|
}
|
|
95
95
|
}, [canCreateEvent]);
|
|
96
96
|
// user must be logged
|
|
97
|
-
if (!scUserContext.user
|
|
97
|
+
if (!scUserContext.user) {
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { CoursePage } from './types';
|
|
3
2
|
import { SCCourseType } from '@selfcommunity/types';
|
|
3
|
+
import { SCCourseEditTabType } from '../../types/course';
|
|
4
4
|
export interface EditCourseProps {
|
|
5
5
|
courseId?: number;
|
|
6
6
|
course?: SCCourseType;
|
|
7
|
-
page:
|
|
8
|
-
onTabChange: (page:
|
|
7
|
+
page: SCCourseEditTabType;
|
|
8
|
+
onTabChange: (page: SCCourseEditTabType) => void;
|
|
9
9
|
className?: HTMLAttributes<HTMLDivElement>['className'];
|
|
10
10
|
[p: string]: any;
|
|
11
11
|
}
|
|
@@ -121,7 +121,7 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
121
121
|
* @param inProps
|
|
122
122
|
*/
|
|
123
123
|
function EventForm(inProps) {
|
|
124
|
-
var _a, _b, _c, _d, _e;
|
|
124
|
+
var _a, _b, _c, _d, _e, _f;
|
|
125
125
|
//PROPS
|
|
126
126
|
const props = (0, system_1.useThemeProps)({
|
|
127
127
|
props: inProps,
|
|
@@ -130,6 +130,7 @@ function EventForm(inProps) {
|
|
|
130
130
|
const { className, onSuccess, onError, event, presetLocation, EventAddressComponentProps = {} } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "event", "presetLocation", "EventAddressComponentProps"]);
|
|
131
131
|
// CONTEXT
|
|
132
132
|
const scContext = (0, react_core_1.useSCContext)();
|
|
133
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
133
134
|
// INTL
|
|
134
135
|
const intl = (0, react_intl_1.useIntl)();
|
|
135
136
|
const startDateTime = (0, react_1.useMemo)(() => (0, utils_2.getNewDate)(event === null || event === void 0 ? void 0 : event.start_date), [event]);
|
|
@@ -172,6 +173,7 @@ function EventForm(inProps) {
|
|
|
172
173
|
scPreferences.features.includes(types_1.SCFeatureName.LIVE_STREAM) &&
|
|
173
174
|
react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in scPreferences.preferences &&
|
|
174
175
|
scPreferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [scPreferences.preferences, scPreferences.features]);
|
|
176
|
+
const canCreateLiveStream = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_live_stream; }, [(_b = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _b === void 0 ? void 0 : _b.permission]);
|
|
175
177
|
const privateEnabled = (0, react_1.useMemo)(() => scPreferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED].value, [scPreferences.preferences]);
|
|
176
178
|
const visibilityEnabled = (0, react_1.useMemo)(() => scPreferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED].value, [scPreferences.preferences]);
|
|
177
179
|
const disablePastStartTime = (0, react_1.useMemo)(() => field.startDate.getDate() === (0, utils_2.getNewDate)().getDate(), [field]);
|
|
@@ -279,7 +281,7 @@ function EventForm(inProps) {
|
|
|
279
281
|
}
|
|
280
282
|
let __errors = {};
|
|
281
283
|
if ('coverError' in _error) {
|
|
282
|
-
__errors = Object.assign(Object.assign({}, __errors), { ['coverError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.
|
|
284
|
+
__errors = Object.assign(Object.assign({}, __errors), { ['coverError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.cover.error", defaultMessage: "ui.eventForm.cover.error" }) });
|
|
283
285
|
}
|
|
284
286
|
if ('nameError' in _error || ('nonFieldErrorsError' in _error && _error['nonFieldErrorsError'].error === 'unique')) {
|
|
285
287
|
__errors = Object.assign(Object.assign({}, __errors), { ['nameError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.name.error.unique", defaultMessage: "ui.eventForm.name.error.unique" }) });
|
|
@@ -384,7 +386,7 @@ function EventForm(inProps) {
|
|
|
384
386
|
start_date: field.startDate,
|
|
385
387
|
location: field.location,
|
|
386
388
|
geolocation: field.geolocation,
|
|
387
|
-
live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && ((
|
|
389
|
+
live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && ((_c = event.live_stream) === null || _c === void 0 ? void 0 : _c.created_at) && { created_at: field.startDate })), { settings: field.liveStreamSettings })
|
|
388
390
|
}) }, EventAddressComponentProps)), privateEnabled && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.privacySection }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", justifyContent: "center" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: !field.isPublic }) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "private" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.private", defaultMessage: "ui.eventForm.privacy.private" })] })), (0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: field.isPublic, onChange: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['isPublic']: !field.isPublic }))), disabled: event && !field.isPublic }), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: field.isPublic }) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "public" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.public", defaultMessage: "ui.eventForm.privacy.public" })] }))] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", textAlign: "center", className: classes.privacySectionInfo }, { children: field.isPublic ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.public.info", defaultMessage: "ui.eventForm.privacy.public.info", values: {
|
|
389
391
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
390
392
|
// @ts-ignores
|
|
@@ -394,8 +396,8 @@ function EventForm(inProps) {
|
|
|
394
396
|
// @ts-ignore
|
|
395
397
|
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
396
398
|
} })) }))] }))), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
397
|
-
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((
|
|
398
|
-
}, error: Boolean(((
|
|
399
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) ? Event_1.EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : Event_1.EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
400
|
+
}, error: Boolean(((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_f = field.description) === null || _f === void 0 ? void 0 : _f.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), genericError && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.genericError }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
|
|
399
401
|
!field.startDate ||
|
|
400
402
|
!field.startTime ||
|
|
401
403
|
!field.endDate ||
|
|
@@ -407,6 +409,6 @@ function EventForm(inProps) {
|
|
|
407
409
|
field.isSubmitting ||
|
|
408
410
|
field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH ||
|
|
409
411
|
field.description.length > Event_1.EVENT_DESCRIPTION_MAX_LENGTH ||
|
|
410
|
-
(field.location === types_1.SCEventLocationType.LIVESTREAM && !liveStreamEnabled), variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: event ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.button.edit", defaultMessage: "ui.eventForm.button.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.button.create", defaultMessage: "ui.eventForm.button.create" })) })) }))] }))] })));
|
|
412
|
+
(field.location === types_1.SCEventLocationType.LIVESTREAM && (!liveStreamEnabled || !canCreateLiveStream)), variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: event ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.button.edit", defaultMessage: "ui.eventForm.button.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.button.create", defaultMessage: "ui.eventForm.button.create" })) })) }))] }))] })));
|
|
411
413
|
}
|
|
412
414
|
exports.default = EventForm;
|
|
@@ -42,7 +42,7 @@ function LessonObject(inProps) {
|
|
|
42
42
|
});
|
|
43
43
|
const { className = null, course, lesson, editMode, EditorProps = {}, onContentChange, onMediaChange, isSubmitting } = props, rest = tslib_1.__rest(props, ["className", "course", "lesson", "editMode", "EditorProps", "onContentChange", "onMediaChange", "isSubmitting"]);
|
|
44
44
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
45
|
-
const [completed, setCompleted] = (0, react_1.useState)(lesson.completion_status === types_1.SCCourseLessonCompletionStatusType.COMPLETED);
|
|
45
|
+
const [completed, setCompleted] = (0, react_1.useState)((lesson === null || lesson === void 0 ? void 0 : lesson.completion_status) === types_1.SCCourseLessonCompletionStatusType.COMPLETED);
|
|
46
46
|
const [openDialog, setOpenDialog] = (0, react_1.useState)(false);
|
|
47
47
|
// CONTEXT
|
|
48
48
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
@@ -79,7 +79,7 @@ const messages = (0, react_intl_1.defineMessages)({
|
|
|
79
79
|
* @param inProps
|
|
80
80
|
*/
|
|
81
81
|
function LiveStreamForm(inProps) {
|
|
82
|
-
var _a, _b, _c;
|
|
82
|
+
var _a, _b, _c, _d;
|
|
83
83
|
//PROPS
|
|
84
84
|
const props = (0, system_1.useThemeProps)({
|
|
85
85
|
props: inProps,
|
|
@@ -102,6 +102,7 @@ function LiveStreamForm(inProps) {
|
|
|
102
102
|
react_core_1.SCPreferences.STATIC_ENVIRONMENT in preferences &&
|
|
103
103
|
preferences[react_core_1.SCPreferences.STATIC_ENVIRONMENT].value === types_1.SCCommunityEnvironment.STAGE, [preferences]);
|
|
104
104
|
const communityStackId = (0, react_1.useMemo)(() => preferences && react_core_1.SCPreferences.STATIC_ENVIRONMENT in preferences && preferences[react_core_1.SCPreferences.STATIC_STACKID].value, [preferences]);
|
|
105
|
+
const canCreateLiveStream = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_live_stream; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
|
|
105
106
|
const intl = (0, react_intl_1.useIntl)();
|
|
106
107
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
107
108
|
// @ts-ignore
|
|
@@ -238,12 +239,13 @@ function LiveStreamForm(inProps) {
|
|
|
238
239
|
}, error: Boolean(field.title.length > LiveStream_1.LIVE_STREAM_TITLE_MAX_LENGTH) || Boolean(error['titleError']), helperText: field.title.length > LiveStream_1.LIVE_STREAM_TITLE_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.title.error.maxLength", defaultMessage: "ui.liveStreamForm.title.error.maxLength" })) : error['titleError'] ? (error['titleError']) : null }), (0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.slug, placeholder: `${intl.formatMessage(messages.slug)}`, margin: "normal", value: field.slug, name: "slug", onChange: handleChange, InputProps: {
|
|
239
240
|
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: LiveStream_1.LIVE_STREAM_SLUG_MAX_LENGTH - field.slug.length }))
|
|
240
241
|
}, error: Boolean(field.slug.length > LiveStream_1.LIVE_STREAM_SLUG_MAX_LENGTH) || Boolean(error['slugError']), helperText: field.title.length > LiveStream_1.LIVE_STREAM_SLUG_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.slug.error.maxLength", defaultMessage: "ui.liveStreamForm.slug.error.maxLength" })) : error['slugError'] ? (error['slugError']) : null }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, rows: 4, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
241
|
-
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((
|
|
242
|
-
}, error: Boolean(((
|
|
242
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) ? LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH - field.description.length : LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH })))
|
|
243
|
+
}, error: Boolean(((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH), helperText: ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.description.error.maxLength", defaultMessage: "ui.liveStreamForm.description.error.maxLength" })) : null }), (0, jsx_runtime_1.jsx)(LiveStreamFormSettings_1.default, { settings: field.settings, onChange: handleChangeSettings }), genericError && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.genericError }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.title ||
|
|
243
244
|
field.isSubmitting ||
|
|
244
245
|
field.title.length > LiveStream_1.LIVE_STREAM_TITLE_MAX_LENGTH ||
|
|
245
246
|
field.description.length > LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH ||
|
|
246
247
|
isFreeTrialTier ||
|
|
247
|
-
timeRemaining <= constants_3.WARNING_THRESHOLD_EXPIRING_SOON
|
|
248
|
+
timeRemaining <= constants_3.WARNING_THRESHOLD_EXPIRING_SOON ||
|
|
249
|
+
!canCreateLiveStream, variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: liveStream ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.button.edit", defaultMessage: "ui.liveStreamForm.button.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.button.create", defaultMessage: "ui.liveStreamForm.button.create" })) })) }))] }))] })));
|
|
248
250
|
}
|
|
249
251
|
exports.default = LiveStreamForm;
|
|
@@ -19,7 +19,7 @@ const classes = {
|
|
|
19
19
|
const Root = (0, styles_1.styled)(Autocomplete_1.default, {
|
|
20
20
|
name: PREFIX,
|
|
21
21
|
slot: 'Root',
|
|
22
|
-
overridesResolver: (
|
|
22
|
+
overridesResolver: (_props, styles) => styles.root
|
|
23
23
|
})(() => ({}));
|
|
24
24
|
/**
|
|
25
25
|
* > API documentation for the Community-JS Tag Autocomplete component. Learn about the available props and the CSS API.
|
|
@@ -75,7 +75,7 @@ const TagAutocomplete = (inProps) => {
|
|
|
75
75
|
const handleClose = () => {
|
|
76
76
|
setOpen(false);
|
|
77
77
|
};
|
|
78
|
-
const handleChange = (
|
|
78
|
+
const handleChange = (_event, newValue) => {
|
|
79
79
|
setValue(newValue);
|
|
80
80
|
};
|
|
81
81
|
// Render
|
|
@@ -84,7 +84,7 @@ const TagAutocomplete = (inProps) => {
|
|
|
84
84
|
}, renderOption: (props, option, { selected, inputValue }) => {
|
|
85
85
|
const matches = (0, match_1.default)(option.name, inputValue);
|
|
86
86
|
const parts = (0, parse_1.default)(option.name, matches);
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)("li", Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(TagChip_1.default, Object.assign({ tag: option, label: (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) }, TagChipProps), option.id) })));
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)("li", Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(TagChip_1.default, Object.assign({ tag: option, label: (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) }, TagChipProps), option.id) }), props['key']));
|
|
88
88
|
}, renderInput: (params) => {
|
|
89
89
|
return ((0, jsx_runtime_1.jsx)(TextField_1.default, Object.assign({}, params, TextFieldProps, { InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'addressing', endAdornment: (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: params.InputProps.endAdornment }) }) })));
|
|
90
90
|
} }, rest)));
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -175,7 +175,7 @@ import UrlTextField from './shared/UrlTextField';
|
|
|
175
175
|
import UserAvatar, { UserAvatarProps } from './shared/UserAvatar';
|
|
176
176
|
import UserDeletedSnackBar, { UserDeletedSnackBarProps } from './shared/UserDeletedSnackBar';
|
|
177
177
|
import UsernameTextField from './shared/UsernameTextField';
|
|
178
|
-
import { PlatformWidgetActionType, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, VirtualScrollerItemProps, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType } from './types';
|
|
178
|
+
import { PlatformWidgetActionType, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, VirtualScrollerItemProps, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, SCCourseEditTabEnum, type SCCourseEditTabType } from './types';
|
|
179
179
|
/**
|
|
180
180
|
* Constants
|
|
181
181
|
*/
|
|
@@ -209,4 +209,4 @@ import DefaultCoverSelfCommunity from './assets/deafultCover';
|
|
|
209
209
|
/**
|
|
210
210
|
* List all exports
|
|
211
211
|
*/
|
|
212
|
-
export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, generateRoomId, randomString, decodePassphrase, encodePassphrase, getCurrentSectionAndLessonIndex, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, Course, CourseProps, CourseSkeleton, CourseSkeletonProps, CourseJoinButton, CourseJoinButtonProps, Courses, CreateCourseButton, CreateCourseButtonProps, CoursesProps, CoursesSkeleton, CoursesSkeletonProps, CourseContentMenu, CourseContentMenuProps, CourseDashboard, TeacherCourseDashboardProps, StudentCourseDashboardProps, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, EventForm, EventFormProps, EventFormDialog, EventFormDialogProps, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, DefaultDrawerSkeleton, DefaultDrawerSkeletonProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, EditCourse, EditCourseProps, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, AccordionLessons, AccordionLessonsProps, AddUsersButton, AddUsersButtonProps, CourseUsersTable, CourseUsersTableProps, CourseUsersTableSkeleton, EmptyStatus, EmptyStatusProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, ScrollContainer, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, LessonAppbar, LessonAppbarProps, LessonDrawer, LessonDrawerProps, LessonEditForm, LessonEditFormProps, LessonObject, LessonObjectProps, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, CourseCompletedDialog, CourseCompletedDialogProps, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, DefaultCoverSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, SCCourseFormStepType, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, TagAutocomplete, TagAutocompleteProps, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, UserLiveStreamWidget, UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton, useStickyBox, UseStickyBoxProps, LiveStream, LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton, LiveStreamInfoDetails, LiveStreamInfoDetailsProps, UpScalingTierBadge, UpScalingTierProps, CreateLiveStreamDialog, CreateLiveStreamDialogProps, CreateLiveStreamButton, CreateLiveStreamButtonProps, LiveStreamForm, LiveStreamFormProps, LiveStreamRoom, LiveStreamRoomProps, LiveStreamVideoConference, LiveStreamVideoConferenceProps, VirtualScrollerItemProps, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, Widget, WidgetProps, X_SHARE, PROVIDER_ICONS_CONTAINED, PROVIDER_ICONS_OUTLINED };
|
|
212
|
+
export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, generateRoomId, randomString, decodePassphrase, encodePassphrase, getCurrentSectionAndLessonIndex, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, SCCourseEditTabEnum, SCCourseEditTabType, Course, CourseProps, CourseSkeleton, CourseSkeletonProps, CourseJoinButton, CourseJoinButtonProps, Courses, CreateCourseButton, CreateCourseButtonProps, CoursesProps, CoursesSkeleton, CoursesSkeletonProps, CourseContentMenu, CourseContentMenuProps, CourseDashboard, TeacherCourseDashboardProps, StudentCourseDashboardProps, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, EventForm, EventFormProps, EventFormDialog, EventFormDialogProps, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, DefaultDrawerSkeleton, DefaultDrawerSkeletonProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, EditCourse, EditCourseProps, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, AccordionLessons, AccordionLessonsProps, AddUsersButton, AddUsersButtonProps, CourseUsersTable, CourseUsersTableProps, CourseUsersTableSkeleton, EmptyStatus, EmptyStatusProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, ScrollContainer, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, LessonAppbar, LessonAppbarProps, LessonDrawer, LessonDrawerProps, LessonEditForm, LessonEditFormProps, LessonObject, LessonObjectProps, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, CourseCompletedDialog, CourseCompletedDialogProps, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, DefaultCoverSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, SCCourseFormStepType, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, TagAutocomplete, TagAutocompleteProps, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, UserLiveStreamWidget, UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton, useStickyBox, UseStickyBoxProps, LiveStream, LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton, LiveStreamInfoDetails, LiveStreamInfoDetailsProps, UpScalingTierBadge, UpScalingTierProps, CreateLiveStreamDialog, CreateLiveStreamDialogProps, CreateLiveStreamButton, CreateLiveStreamButtonProps, LiveStreamForm, LiveStreamFormProps, LiveStreamRoom, LiveStreamRoomProps, LiveStreamVideoConference, LiveStreamVideoConferenceProps, VirtualScrollerItemProps, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, Widget, WidgetProps, X_SHARE, PROVIDER_ICONS_CONTAINED, PROVIDER_ICONS_OUTLINED };
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommentsFeedObjectSkeleton = exports.CommentsFeedObject = exports.CommentObjectSkeleton = exports.CommentObjectReply = exports.CommentObject = exports.ChangePicture = exports.ChangeGroupPicture = exports.ChangeGroupCover = exports.ChangeCover = exports.CentralProgress = exports.CategoryTrendingUsersWidget = exports.CategoryTrendingPeopleWidgetSkeleton = exports.CategoryTrendingFeedWidgetSkeleton = exports.CategoryTrendingFeedWidget = exports.CategorySkeleton = exports.CategoryHeaderSkeleton = exports.CategoryHeader = exports.CategoryFollowersButton = exports.CategoryFollowButton = exports.CategoryAutocomplete = exports.Category = exports.CategoriesSuggestionWidgetSkeleton = exports.CategoriesSuggestionWidget = exports.CategoriesSkeleton = exports.CategoriesPopularWidgetSkeleton = exports.CategoriesPopularWidget = exports.Categories = exports.Calendar = exports.getCurrentSectionAndLessonIndex = exports.encodePassphrase = exports.decodePassphrase = exports.randomString = exports.generateRoomId = exports.bytesToSize = exports.BroadcastMessagesSkeleton = exports.BroadcastMessages = exports.BottomNavigation = exports.BaseLightbox = exports.BaseItem = exports.BaseDialog = exports.AvatarGroupSkeleton = exports.AccountVerify = exports.AccountReset = exports.AccountRecover = exports.AccountDeleteButton = exports.AccountDelete = exports.AccountDataPortabilityButton = exports.AccountDataPortability = exports.AccountChangeMailValidation = exports.AcceptRequestUserEventButton = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.PROVIDER_ICONS_OUTLINED = exports.PROVIDER_ICONS_CONTAINED = exports.X_SHARE = exports.Widget = exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = exports.LiveStreamVideoConference = void 0;
|
|
4
|
+
exports.EventLocationWidget = exports.EventInviteButton = exports.EventInfoWidget = exports.EventInfoDetails = exports.EventHeaderSkeleton = exports.EventHeader = exports.EventActionsMenu = exports.Event = exports.EditCourse = exports.EmailTextField = exports.EditorSkeleton = exports.Editor = exports.EditGroupButton = exports.EditEventButton = exports.DefaultDrawerSkeleton = exports.DefaultHeaderContent = exports.DefaultDrawerContent = exports.DEFAULT_WIDGETS_NUMBER = exports.DEFAULT_PRELOAD_OFFSET_VIEWPORT = exports.DEFAULT_PAGINATION_QUERY_PARAM_NAME = exports.DEFAULT_PAGINATION_OFFSET = exports.DEFAULT_PAGINATION_LIMIT = exports.DEFAULT_FIELDS = exports.CustomAdvSkeleton = exports.CustomAdv = exports.EventFormDialog = exports.EventForm = exports.CreateGroupButton = exports.CreateEventWidgetSkeleton = exports.CreateEventWidget = exports.CreateEventButton = exports.CourseDashboard = exports.CourseContentMenu = exports.CoursesSkeleton = exports.CreateCourseButton = exports.Courses = exports.CourseJoinButton = exports.CourseSkeleton = exports.Course = exports.SCCourseEditTabEnum = exports.ContributionUtils = exports.ConsentSolutionSkeleton = exports.ConsentSolutionButton = exports.ConsentSolution = exports.ConnectionUserButton = exports.ConfirmDialog = exports.ComposerIconButton = exports.Composer = exports.CommentsObjectSkeleton = exports.CommentsObject = void 0;
|
|
5
|
+
exports.CourseUsersTableSkeleton = exports.CourseUsersTable = exports.AddUsersButton = exports.AccordionLessons = exports.GroupSubscribeButton = exports.GroupsSkeleton = exports.GroupSkeleton = exports.GroupSettingsIconButton = exports.Groups = exports.GroupRequestsWidgetSkeleton = exports.GroupRequestsWidget = exports.GroupMembersWidgetSkeleton = exports.GroupMembersWidget = exports.GroupMembersButton = exports.GroupInvitedWidgetSkeleton = exports.GroupInvitedWidget = exports.GroupInviteButton = exports.GroupInfoWidgetSkeleton = exports.GroupInfoWidget = exports.GroupHeaderSkeleton = exports.GroupHeader = exports.GroupForm = exports.GroupActionsMenu = exports.Group = exports.getUnseenNotificationCounter = exports.getUnseenNotification = exports.getRelativeTime = exports.GenericSkeleton = exports.FriendshipUserButton = exports.FooterSkeleton = exports.Footer = exports.FollowUserButton = exports.File = exports.FeedUpdatesWidgetSkeleton = exports.FeedUpdatesWidget = exports.FeedSkeleton = exports.FeedObjectSkeleton = exports.FeedObjectMediaPreview = exports.FeedObject = exports.Feed = exports.FACEBOOK_SHARE = exports.EventsSkeleton = exports.EventSkeleton = exports.Events = exports.EventParticipantsButton = exports.EventMembersWidgetSkeleton = exports.EventMembersWidget = exports.EventMediaWidgetSkeleton = exports.EventMediaWidget = exports.EventLocationWidgetSkeleton = void 0;
|
|
6
|
+
exports.NavigationMenuIconButton = exports.NavigationMenuHeader = exports.NavigationMenuDrawer = exports.NavigationMenuContent = exports.MyEventsWidgetSkeleton = exports.MyEventsWidget = exports.MIN_PRELOAD_OFFSET_VIEWPORT = exports.MetadataField = exports.MessageUploaderUtils = exports.MediaChunkUploader = exports.SCCourseFormStepType = exports.MEDIA_TYPE_VIDEO = exports.MEDIA_TYPE_URL = exports.MEDIA_TYPE_SHARE = exports.MEDIA_TYPE_LINK = exports.MEDIA_TYPE_IMAGE = exports.MEDIA_TYPE_EVENT = exports.MEDIA_TYPE_EMBED = exports.MEDIA_TYPE_DOCUMENT = exports.MEDIA_EMBED_SC_SHARED_OBJECT = exports.MEDIA_EMBED_SC_SHARED_EVENT = exports.MEDIA_EMBED_SC_LINK_TYPE = exports.MAX_PRELOAD_OFFSET_VIEWPORT = exports.LoyaltyProgramWidgetSkeleton = exports.LoyaltyProgramWidget = exports.DefaultCoverSelfCommunity = exports.LogoSelfCommunity = exports.LocationAutocomplete = exports.LINKEDIN_SHARE = exports.Link = exports.Lightbox = exports.CourseCompletedDialog = exports.LEGAL_POLICIES = exports.LanguageSwitcher = exports.LessonObject = exports.LessonEditForm = exports.LessonDrawer = exports.LessonAppbar = exports.InviteUserEventButton = exports.InlineComposerWidgetSkeleton = exports.InlineComposerWidget = exports.ScrollContainer = exports.InfiniteScroll = exports.IncubatorSuggestionWidget = exports.IncubatorSubscribeButton = exports.IncubatorListWidget = exports.IncubatorDetail = exports.Incubator = exports.HiddenPlaceholder = exports.EmptyStatus = void 0;
|
|
7
|
+
exports.TagAutocomplete = exports.SuggestedEventsWidget = exports.StickyBox = exports.SnippetNotificationsSkeleton = exports.SnippetNotifications = exports.Share = exports.SearchDialog = exports.SearchAutocomplete = exports.SCUserSocialAssociations = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectTemplateType = exports.SCFeedObjectActivitiesType = exports.SCEventTemplateType = exports.SCCommentsOrderBy = exports.SCBroadcastMessageTemplateType = exports.ReplyComment = exports.RelatedFeedObjectsWidgetSkeleton = exports.RelatedFeedObjectsWidget = exports.RelatedEventsWidgetSkeleton = exports.RelatedEventsWidget = exports.ProgressBar = exports.PrivateMessageThreadSkeleton = exports.PrivateMessageThreadItemSkeleton = exports.PrivateMessageThreadItem = exports.PrivateMessageThread = exports.PrivateMessageSnippetsSkeleton = exports.PrivateMessageSnippets = exports.PrivateMessageSnippetItemSkeleton = exports.PrivateMessageSnippetItem = exports.PrivateMessageSettingsIconButton = exports.PrivateMessageEditorSkeleton = exports.PrivateMessageEditor = exports.PrivateMessageComponentSkeleton = exports.PrivateMessageComponent = exports.PollSuggestionWidget = exports.PlatformWidgetSkeleton = exports.PlatformWidget = exports.PhoneTextField = exports.PasswordTextField = exports.OnBoardingWidgetSkeleton = exports.OnBoardingWidget = exports.NotificationSkeleton = exports.Notification = exports.NavigationToolbarSkeleton = exports.NavigationToolbarMobileSkeleton = exports.NavigationToolbarMobile = exports.NavigationToolbar = exports.NavigationSettingsIconButton = void 0;
|
|
8
|
+
exports.LiveStreamForm = exports.CreateLiveStreamButton = exports.CreateLiveStreamDialog = exports.UpScalingTierBadge = exports.LiveStreamInfoDetails = exports.LiveStreamSkeleton = exports.LiveStream = exports.useStickyBox = exports.UserLiveStreamWidgetSkeleton = exports.UserLiveStreamWidget = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = exports.UserSubscribedGroupsWidgetSkeleton = exports.UserSubscribedGroupsWidget = exports.UserSocialAssociation = exports.UserSkeleton = exports.UserProfileHeaderSkeleton = exports.UserProfileHeader = exports.UserProfileEditSkeleton = exports.UserProfileEditSectionSettings = exports.UserProfileEditSectionPublicInfo = exports.UserProfileEditSectionAccount = exports.UserProfileEdit = exports.UserProfileBlocked = exports.UsernameTextField = exports.UserInfoSkeleton = exports.UserInfoDialog = exports.UserInfo = exports.UserFollowersWidgetSkeleton = exports.UserFollowersWidget = exports.UserFollowedUsersWidgetSkeleton = exports.UserFollowedUsersWidget = exports.UserFollowedCategoriesWidgetSkeleton = exports.UserFollowedCategoriesWidget = exports.UserDeletedSnackBar = exports.UserCounters = exports.UserConnectionsWidgetSkeleton = exports.UserConnectionsWidget = exports.UserConnectionsRequestsWidgetSkeleton = exports.UserConnectionsRequestsWidget = exports.UserConnectionsRequestsSentWidgetSkeleton = exports.UserConnectionsRequestsSentWidget = exports.UserAvatar = exports.UserActionIconButton = exports.User = exports.UrlTextField = exports.ToastNotificationsSkeleton = exports.ToastNotifications = exports.TagChip = exports.SuggestedEventsWidgetSkeleton = void 0;
|
|
9
|
+
exports.PROVIDER_ICONS_OUTLINED = exports.PROVIDER_ICONS_CONTAINED = exports.X_SHARE = exports.Widget = exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = exports.LiveStreamVideoConference = exports.LiveStreamRoom = void 0;
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
11
|
/**
|
|
12
12
|
* Components
|
|
@@ -462,6 +462,7 @@ Object.defineProperty(exports, "SCUserSocialAssociations", { enumerable: true, g
|
|
|
462
462
|
Object.defineProperty(exports, "SCCourseTemplateType", { enumerable: true, get: function () { return types_1.SCCourseTemplateType; } });
|
|
463
463
|
Object.defineProperty(exports, "SCLessonActionsType", { enumerable: true, get: function () { return types_1.SCLessonActionsType; } });
|
|
464
464
|
Object.defineProperty(exports, "SCLessonModeType", { enumerable: true, get: function () { return types_1.SCLessonModeType; } });
|
|
465
|
+
Object.defineProperty(exports, "SCCourseEditTabEnum", { enumerable: true, get: function () { return types_1.SCCourseEditTabEnum; } });
|
|
465
466
|
/**
|
|
466
467
|
* Constants
|
|
467
468
|
*/
|
|
@@ -11,3 +11,11 @@ export declare enum SCLessonModeType {
|
|
|
11
11
|
VIEW = "view",
|
|
12
12
|
EDIT = "edit"
|
|
13
13
|
}
|
|
14
|
+
export declare type SCCourseEditTabType = 'lessons' | 'customize' | 'users' | 'requests' | 'options';
|
|
15
|
+
export declare enum SCCourseEditTabEnum {
|
|
16
|
+
LESSONS = "lessons",
|
|
17
|
+
CUSTOMIZE = "customize",
|
|
18
|
+
USERS = "users",
|
|
19
|
+
REQUESTS = "requests",
|
|
20
|
+
OPTIONS = "options"
|
|
21
|
+
}
|
package/lib/cjs/types/course.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = void 0;
|
|
3
|
+
exports.SCCourseEditTabEnum = exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = void 0;
|
|
4
4
|
var SCCourseTemplateType;
|
|
5
5
|
(function (SCCourseTemplateType) {
|
|
6
6
|
SCCourseTemplateType["SNIPPET"] = "snippet";
|
|
@@ -17,3 +17,11 @@ var SCLessonModeType;
|
|
|
17
17
|
SCLessonModeType["VIEW"] = "view";
|
|
18
18
|
SCLessonModeType["EDIT"] = "edit";
|
|
19
19
|
})(SCLessonModeType = exports.SCLessonModeType || (exports.SCLessonModeType = {}));
|
|
20
|
+
var SCCourseEditTabEnum;
|
|
21
|
+
(function (SCCourseEditTabEnum) {
|
|
22
|
+
SCCourseEditTabEnum["LESSONS"] = "lessons";
|
|
23
|
+
SCCourseEditTabEnum["CUSTOMIZE"] = "customize";
|
|
24
|
+
SCCourseEditTabEnum["USERS"] = "users";
|
|
25
|
+
SCCourseEditTabEnum["REQUESTS"] = "requests";
|
|
26
|
+
SCCourseEditTabEnum["OPTIONS"] = "options";
|
|
27
|
+
})(SCCourseEditTabEnum = exports.SCCourseEditTabEnum || (exports.SCCourseEditTabEnum = {}));
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -8,5 +8,7 @@ import { VirtualScrollerItemProps } from './virtualScroller';
|
|
|
8
8
|
import { SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations } from './user';
|
|
9
9
|
import { PlatformWidgetActionType } from './platformWidget';
|
|
10
10
|
import { SCEventTemplateType } from './event';
|
|
11
|
-
import { SCCourseTemplateType, SCLessonActionsType, SCLessonModeType } from './course';
|
|
12
|
-
|
|
11
|
+
import { SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, SCCourseEditTabEnum } from './course';
|
|
12
|
+
import type { SCCourseEditTabType } from './course';
|
|
13
|
+
export type { SCCourseEditTabType };
|
|
14
|
+
export { SCFeedWidgetType, SCMediaObjectType, SCMediaChunkType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCNotificationObjectTemplateType, SCBroadcastMessageTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, VirtualScrollerItemProps, PlatformWidgetActionType, SCEventTemplateType, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, SCCourseEditTabEnum };
|
package/lib/cjs/types/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = exports.SCEventTemplateType = exports.SCUserSocialAssociations = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.SCBroadcastMessageTemplateType = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectTemplateType = exports.SCFeedObjectActivitiesType = exports.SCCommentsOrderBy = void 0;
|
|
3
|
+
exports.SCCourseEditTabEnum = exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = exports.SCEventTemplateType = exports.SCUserSocialAssociations = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.SCBroadcastMessageTemplateType = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectTemplateType = exports.SCFeedObjectActivitiesType = exports.SCCommentsOrderBy = void 0;
|
|
4
4
|
const comments_1 = require("./comments");
|
|
5
5
|
Object.defineProperty(exports, "SCCommentsOrderBy", { enumerable: true, get: function () { return comments_1.SCCommentsOrderBy; } });
|
|
6
6
|
const feedObject_1 = require("./feedObject");
|
|
@@ -20,3 +20,4 @@ const course_1 = require("./course");
|
|
|
20
20
|
Object.defineProperty(exports, "SCCourseTemplateType", { enumerable: true, get: function () { return course_1.SCCourseTemplateType; } });
|
|
21
21
|
Object.defineProperty(exports, "SCLessonActionsType", { enumerable: true, get: function () { return course_1.SCLessonActionsType; } });
|
|
22
22
|
Object.defineProperty(exports, "SCLessonModeType", { enumerable: true, get: function () { return course_1.SCLessonModeType; } });
|
|
23
|
+
Object.defineProperty(exports, "SCCourseEditTabEnum", { enumerable: true, get: function () { return course_1.SCCourseEditTabEnum; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl';
|
|
5
5
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
6
6
|
import TextField from '@mui/material/TextField';
|
|
@@ -19,7 +19,7 @@ const classes = {
|
|
|
19
19
|
const Root = styled(Autocomplete, {
|
|
20
20
|
name: PREFIX,
|
|
21
21
|
slot: 'Root',
|
|
22
|
-
overridesResolver: (
|
|
22
|
+
overridesResolver: (_props, styles) => styles.root
|
|
23
23
|
})(() => ({}));
|
|
24
24
|
/**
|
|
25
25
|
* > API documentation for the Community-JS Category Autocomplete component. Learn about the available props and the CSS API.
|
|
@@ -55,8 +55,6 @@ const CategoryAutocomplete = (inProps) => {
|
|
|
55
55
|
} } = props, rest = __rest(props, ["onChange", "multiple", "defaultValue", "limitCountCategories", "checkboxSelect", "disabled", "TextFieldProps"]);
|
|
56
56
|
// State
|
|
57
57
|
const [open, setOpen] = useState(false);
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
59
|
-
// @ts-ignore
|
|
60
58
|
const [value, setValue] = useState(typeof defaultValue === 'string' ? null : defaultValue);
|
|
61
59
|
// HOOKS
|
|
62
60
|
const { categories, isLoading } = useSCFetchCategories();
|
|
@@ -64,7 +62,7 @@ const CategoryAutocomplete = (inProps) => {
|
|
|
64
62
|
if (value === null) {
|
|
65
63
|
return;
|
|
66
64
|
}
|
|
67
|
-
onChange
|
|
65
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
68
66
|
}, [value]);
|
|
69
67
|
useEffect(() => {
|
|
70
68
|
if (!isLoading && typeof defaultValue === 'string') {
|
|
@@ -78,7 +76,7 @@ const CategoryAutocomplete = (inProps) => {
|
|
|
78
76
|
const handleClose = () => {
|
|
79
77
|
setOpen(false);
|
|
80
78
|
};
|
|
81
|
-
const handleChange = (
|
|
79
|
+
const handleChange = (_event, value) => {
|
|
82
80
|
let newValue = null;
|
|
83
81
|
if (multiple && limitCountCategories > 0) {
|
|
84
82
|
const [...rest] = value;
|
|
@@ -95,9 +93,9 @@ const CategoryAutocomplete = (inProps) => {
|
|
|
95
93
|
}, renderOption: (props, option, { selected, inputValue }) => {
|
|
96
94
|
const matches = match(option.name, inputValue);
|
|
97
95
|
const parts = parse(option.name, matches);
|
|
98
|
-
return (_jsxs("li", Object.assign({}, props, { children: [checkboxSelect && _jsx(Checkbox, { style: { marginRight: 8 }, checked: selected }), _jsx(Chip, { label: _jsx(
|
|
96
|
+
return (_jsxs("li", Object.assign({}, props, { children: [checkboxSelect && _jsx(Checkbox, { style: { marginRight: 8 }, checked: selected }), _jsx(Chip, { label: _jsx(Fragment, { children: parts.map((part, index) => (_jsx("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) })] }), props['key']));
|
|
99
97
|
}, renderInput: (params) => {
|
|
100
|
-
return (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'categories', endAdornment: (_jsxs(
|
|
98
|
+
return (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'categories', endAdornment: (_jsxs(Fragment, { children: [isLoading ? _jsx(CircularProgress, { color: "inherit", size: 20 }) : null, params.InputProps.endAdornment] })) }) })));
|
|
101
99
|
} }, rest)));
|
|
102
100
|
};
|
|
103
101
|
export default CategoryAutocomplete;
|