@selfcommunity/react-ui 0.11.0-mui7.39 → 0.11.0-mui7.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +7 -3
- package/lib/cjs/components/EventAutocomplete/EventAutocomplete.js +2 -1
- package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.js +2 -1
- package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.js +11 -12
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +3 -2
- package/lib/cjs/components/SearchAutocomplete/SearchAutocomplete.js +4 -1
- package/lib/cjs/components/TagAutocomplete/TagAutocomplete.js +2 -1
- package/lib/cjs/components/UserAutocomplete/UserAutocomplete.js +8 -6
- package/lib/cjs/shared/CopyTextArea/index.js +0 -1
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +7 -3
- package/lib/esm/components/EventAutocomplete/EventAutocomplete.js +2 -1
- package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.js +2 -1
- package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.js +3 -4
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +3 -2
- package/lib/esm/components/SearchAutocomplete/SearchAutocomplete.js +4 -1
- package/lib/esm/components/TagAutocomplete/TagAutocomplete.js +2 -1
- package/lib/esm/components/UserAutocomplete/UserAutocomplete.js +8 -6
- package/lib/esm/shared/CopyTextArea/index.js +0 -1
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -126,12 +126,16 @@ const AudienceLayer = react_1.default.forwardRef((props, ref) => {
|
|
|
126
126
|
// Disable all tabs except the currently selected type
|
|
127
127
|
return type !== valueType;
|
|
128
128
|
};
|
|
129
|
-
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)(material_1.Icon, { 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)(material_1.DialogContent, 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: [!taggingRequiredEnabled && ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: AudienceTypes.AUDIENCE_ALL, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { 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: isAudienceTypeSelected(AudienceTypes.AUDIENCE_EVENT), value: AudienceTypes.AUDIENCE_EVENT, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "CalendarIcon" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.event", defaultMessage: "ui.composer.layer.audience.event" }) })), groupsEnabled && ((0, jsx_runtime_1.jsx)(material_1.Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_GROUP), value: AudienceTypes.AUDIENCE_GROUP, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "groups" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.group", defaultMessage: "ui.composer.layer.audience.group" }) })), (0, jsx_runtime_1.jsx)(material_1.Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_TAG), value: AudienceTypes.AUDIENCE_TAG, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "label" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.tag", defaultMessage: "ui.composer.layer.audience.tag" }) }), usersTaggingEnabled && ((0, jsx_runtime_1.jsx)(material_1.Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_USERS), value: AudienceTypes.AUDIENCE_USERS, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "people_alt" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.users", defaultMessage: "ui.composer.layer.audience.users" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.message }, { children: [audience === AudienceTypes.AUDIENCE_ALL && !taggingRequiredEnabled && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.all.message", defaultMessage: "ui.composer.layer.audience.all.message" })), audience === AudienceTypes.AUDIENCE_EVENT && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.event.message", defaultMessage: "ui.composer.layer.audience.event.message" })), audience === AudienceTypes.AUDIENCE_GROUP && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.group.message", defaultMessage: "ui.composer.layer.audience.group.message" })), audience === AudienceTypes.AUDIENCE_TAG && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.tag.message", defaultMessage: "ui.composer.layer.audience.tag.message" })), audience === AudienceTypes.AUDIENCE_USERS && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.users.message", defaultMessage: "ui.composer.layer.audience.users.message" }))] })), audience === AudienceTypes.AUDIENCE_TAG && ((0, jsx_runtime_1.jsx)(material_1.Autocomplete, { className: classes.autocomplete, open: autocompleteOpen, onOpen: handleAutocompleteOpen, onClose: handleAutocompleteClose, multiple: true, options: scAddressingTags || [], getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, handleHomeEndKeys: true, clearIcon: null, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.tags.empty", defaultMessage: "ui.composer.layer.audience.tags.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => value.id === option.id,
|
|
130
|
-
return value.map((option, index) =>
|
|
129
|
+
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)(material_1.Icon, { 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)(material_1.DialogContent, 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: [!taggingRequiredEnabled && ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: AudienceTypes.AUDIENCE_ALL, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { 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: isAudienceTypeSelected(AudienceTypes.AUDIENCE_EVENT), value: AudienceTypes.AUDIENCE_EVENT, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "CalendarIcon" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.event", defaultMessage: "ui.composer.layer.audience.event" }) })), groupsEnabled && ((0, jsx_runtime_1.jsx)(material_1.Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_GROUP), value: AudienceTypes.AUDIENCE_GROUP, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "groups" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.group", defaultMessage: "ui.composer.layer.audience.group" }) })), (0, jsx_runtime_1.jsx)(material_1.Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_TAG), value: AudienceTypes.AUDIENCE_TAG, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "label" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.tag", defaultMessage: "ui.composer.layer.audience.tag" }) }), usersTaggingEnabled && ((0, jsx_runtime_1.jsx)(material_1.Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_USERS), value: AudienceTypes.AUDIENCE_USERS, icon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "people_alt" }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.users", defaultMessage: "ui.composer.layer.audience.users" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.message }, { children: [audience === AudienceTypes.AUDIENCE_ALL && !taggingRequiredEnabled && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.all.message", defaultMessage: "ui.composer.layer.audience.all.message" })), audience === AudienceTypes.AUDIENCE_EVENT && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.event.message", defaultMessage: "ui.composer.layer.audience.event.message" })), audience === AudienceTypes.AUDIENCE_GROUP && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.group.message", defaultMessage: "ui.composer.layer.audience.group.message" })), audience === AudienceTypes.AUDIENCE_TAG && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.tag.message", defaultMessage: "ui.composer.layer.audience.tag.message" })), audience === AudienceTypes.AUDIENCE_USERS && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.users.message", defaultMessage: "ui.composer.layer.audience.users.message" }))] })), audience === AudienceTypes.AUDIENCE_TAG && ((0, jsx_runtime_1.jsx)(material_1.Autocomplete, { className: classes.autocomplete, open: autocompleteOpen, onOpen: handleAutocompleteOpen, onClose: handleAutocompleteClose, multiple: true, options: scAddressingTags || [], getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, handleHomeEndKeys: true, clearIcon: null, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.tags.empty", defaultMessage: "ui.composer.layer.audience.tags.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => value.id === option.id, renderValue: (value, getItemProps) => {
|
|
130
|
+
return value.map((option, index) => {
|
|
131
|
+
const _a = getItemProps({ index }), { key } = _a, rest = tslib_1.__rest(_a, ["key"]);
|
|
132
|
+
return (0, jsx_runtime_1.jsx)(TagChip_1.default, Object.assign({ tag: option }, rest, { showDescription: true }), key || option.id);
|
|
133
|
+
});
|
|
131
134
|
}, renderOption: (props, option, { inputValue }) => {
|
|
135
|
+
const { key } = props, rest = tslib_1.__rest(props, ["key"]);
|
|
132
136
|
const matches = (0, match_1.default)(option.name, inputValue);
|
|
133
137
|
const parts = (0, parse_1.default)(option.name, matches);
|
|
134
|
-
return ((0, jsx_runtime_1.jsx)("li", Object.assign({},
|
|
138
|
+
return ((0, jsx_runtime_1.jsx)("li", Object.assign({}, rest, { children: (0, jsx_runtime_1.jsx)(TagChip_1.default, { showDescription: true, disposable: false, 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) }), key));
|
|
135
139
|
}, renderInput: (params) => {
|
|
136
140
|
return ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, TextFieldProps, { slotProps: {
|
|
137
141
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'addressing', endAdornment: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: params.InputProps.endAdornment }) })
|
|
@@ -83,9 +83,10 @@ const EventAutocomplete = (inProps) => {
|
|
|
83
83
|
// ));
|
|
84
84
|
// }}
|
|
85
85
|
renderOption: (props, option, { inputValue }) => {
|
|
86
|
+
const { key } = props, rest = tslib_1.__rest(props, ["key"]);
|
|
86
87
|
const matches = (0, match_1.default)(option.name, inputValue);
|
|
87
88
|
const parts = (0, parse_1.default)(option.name, matches);
|
|
88
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" },
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: option.name, src: option.image_small, sx: { marginRight: 1 } }), (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ sx: { fontWeight: part.highlight ? 700 : 400, marginRight: 0.2 } }, { children: part.text }), index))) })] }), key));
|
|
89
90
|
}, renderInput: (params) => {
|
|
90
91
|
return ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", slotProps: {
|
|
91
92
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'events', endAdornment: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isLoading && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) })
|
|
@@ -83,9 +83,10 @@ const GroupAutocomplete = (inProps) => {
|
|
|
83
83
|
// ));
|
|
84
84
|
// }}
|
|
85
85
|
renderOption: (props, option, { inputValue }) => {
|
|
86
|
+
const { key } = props, rest = tslib_1.__rest(props, ["key"]);
|
|
86
87
|
const matches = (0, match_1.default)(option.name, inputValue);
|
|
87
88
|
const parts = (0, parse_1.default)(option.name, matches);
|
|
88
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" },
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: option.name, src: option.image_small, sx: { marginRight: 1 } }), (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ sx: { fontWeight: part.highlight ? 700 : 400, marginRight: 0.2 } }, { children: part.text }), index))) })] }), key));
|
|
89
90
|
}, renderInput: (params) => {
|
|
90
91
|
return ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", slotProps: {
|
|
91
92
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'groups', endAdornment: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isLoading && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) })
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = require("react");
|
|
5
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const
|
|
5
|
+
const react_1 = require("react");
|
|
7
6
|
const react_intl_1 = require("react-intl");
|
|
8
7
|
const material_1 = require("@mui/material");
|
|
9
8
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
10
9
|
const parse_1 = tslib_1.__importDefault(require("autosuggest-highlight/parse"));
|
|
11
10
|
const match_1 = tslib_1.__importDefault(require("autosuggest-highlight/match"));
|
|
12
|
-
const system_1 = require("@mui/system");
|
|
13
11
|
const PREFIX = 'SCLocationAutocomplete';
|
|
14
12
|
const classes = {
|
|
15
13
|
root: `${PREFIX}-root`
|
|
@@ -45,7 +43,7 @@ const Root = (0, material_1.styled)(material_1.Autocomplete, {
|
|
|
45
43
|
*/
|
|
46
44
|
function LocationAutocomplete(inProps) {
|
|
47
45
|
// Props
|
|
48
|
-
const props = (0,
|
|
46
|
+
const props = (0, material_1.useThemeProps)({
|
|
49
47
|
props: inProps,
|
|
50
48
|
name: PREFIX
|
|
51
49
|
});
|
|
@@ -54,10 +52,10 @@ function LocationAutocomplete(inProps) {
|
|
|
54
52
|
label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.locationAutocomplete.label", defaultMessage: "ui.composer.locations.label" })
|
|
55
53
|
} } = props, rest = tslib_1.__rest(props, ["defaultValue", "disabled", "onChange", "TextFieldProps"]);
|
|
56
54
|
// State
|
|
57
|
-
const [isLoading, setIsLoading] = (0,
|
|
58
|
-
const [locations, setLocations] = (0,
|
|
59
|
-
const [value, setValue] = (0,
|
|
60
|
-
const [search, setSearch] = (0,
|
|
55
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
56
|
+
const [locations, setLocations] = (0, react_1.useState)([]);
|
|
57
|
+
const [value, setValue] = (0, react_1.useState)(defaultValue);
|
|
58
|
+
const [search, setSearch] = (0, react_1.useState)('');
|
|
61
59
|
const load = (offset = 0, limit = 20) => {
|
|
62
60
|
api_services_1.http
|
|
63
61
|
.request({
|
|
@@ -75,12 +73,12 @@ function LocationAutocomplete(inProps) {
|
|
|
75
73
|
.then(() => setIsLoading(false));
|
|
76
74
|
};
|
|
77
75
|
// Component update
|
|
78
|
-
(0,
|
|
76
|
+
(0, react_1.useEffect)(() => {
|
|
79
77
|
if (!isLoading && search.trim().length > 0) {
|
|
80
78
|
load();
|
|
81
79
|
}
|
|
82
80
|
}, [search]);
|
|
83
|
-
(0,
|
|
81
|
+
(0, react_1.useEffect)(() => {
|
|
84
82
|
if (value) {
|
|
85
83
|
onChange && onChange(value);
|
|
86
84
|
}
|
|
@@ -94,7 +92,7 @@ function LocationAutocomplete(inProps) {
|
|
|
94
92
|
setSearch(_search);
|
|
95
93
|
};
|
|
96
94
|
// Render
|
|
97
|
-
const options = (0,
|
|
95
|
+
const options = (0, react_1.useMemo)(() => {
|
|
98
96
|
if (!value || typeof value === 'string' || locations.find((loc) => value.lat === loc.lat && value.lng === loc.lng)) {
|
|
99
97
|
return locations;
|
|
100
98
|
}
|
|
@@ -105,9 +103,10 @@ function LocationAutocomplete(inProps) {
|
|
|
105
103
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'location', endAdornment: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isLoading ? (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 }) : null, params.InputProps.endAdornment] })) })
|
|
106
104
|
} })));
|
|
107
105
|
}, renderOption: (props, option, { inputValue }) => {
|
|
106
|
+
const { key } = props, rest = tslib_1.__rest(props, ["key"]);
|
|
108
107
|
const matches = (0, match_1.default)(option.full_address, inputValue);
|
|
109
108
|
const parts = (0, parse_1.default)(option.full_address, matches);
|
|
110
|
-
return ((0,
|
|
109
|
+
return ((0, jsx_runtime_1.jsx)("li", Object.assign({}, rest, { style: { whiteSpace: 'break-spaces' } }, { children: parts.map((part, index) => part.highlight ? ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: { fontWeight: 700 } }, { children: part.text }), index)) : (part.text)) }), key || `${option.lat}_${option.lng}`));
|
|
111
110
|
} }, rest)));
|
|
112
111
|
}
|
|
113
112
|
exports.default = LocationAutocomplete;
|
|
@@ -82,6 +82,7 @@ function DefaultDrawerContent(inProps) {
|
|
|
82
82
|
};
|
|
83
83
|
const handleClickHome = (0, react_1.useCallback)(() => {
|
|
84
84
|
if (onClickHome) {
|
|
85
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
85
86
|
onClickHome();
|
|
86
87
|
}
|
|
87
88
|
else {
|
|
@@ -90,7 +91,7 @@ function DefaultDrawerContent(inProps) {
|
|
|
90
91
|
(0, seamless_scroll_polyfill_1.scroll)(window, { top: 0, behavior: 'smooth' });
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
}, [onClickHome]);
|
|
94
|
+
}, [onClickHome, onClose]);
|
|
94
95
|
// Order categories
|
|
95
96
|
(0, react_1.useEffect)(() => {
|
|
96
97
|
if (!scUserContext.user || (scUserContext.user && showAllCategories)) {
|
|
@@ -123,7 +124,7 @@ function DefaultDrawerContent(inProps) {
|
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
126
|
//order
|
|
126
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.List, Object.assign({ className: classes.navigation }, { children: [scUserContext.user && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}), onClick: handleClickHome }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "home" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home" }) })] })) }))), coursesEnabled && (scUserContext.user || contentAvailable) && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.COURSES_ROUTE_NAME, {}) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "courses" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses" }) })] })) }))), groupsEnabled && scUserContext.user && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUPS_ROUTE_NAME, {}) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "groups" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups" }) })] })) }))), eventsEnabled && (scUserContext.user || contentAvailable) && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENTS_ROUTE_NAME, {}) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "CalendarIcon" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events" }) })] })) }))), exploreStreamEnabled && (contentAvailable || scUserContext.user) && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EXPLORE_ROUTE_NAME, {}) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "explore" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore" }) })] })) })))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle1", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.title", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.title" }) })), !categoriesOrdered.length && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.noResults }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults" }) }))), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [Object.entries(taggedCategories).map(([tagName, categories]) => {
|
|
127
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.List, Object.assign({ className: classes.navigation }, { children: [scUserContext.user && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}), onClick: handleClickHome }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "home" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home" }) })] })) }))), coursesEnabled && (scUserContext.user || contentAvailable) && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.COURSES_ROUTE_NAME, {}), onClick: onClose }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "courses" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses" }) })] })) }))), groupsEnabled && scUserContext.user && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUPS_ROUTE_NAME, {}), onClick: onClose }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "groups" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups" }) })] })) }))), eventsEnabled && (scUserContext.user || contentAvailable) && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENTS_ROUTE_NAME, {}), onClick: onClose }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "CalendarIcon" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events" }) })] })) }))), exploreStreamEnabled && (contentAvailable || scUserContext.user) && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EXPLORE_ROUTE_NAME, {}), onClick: onClose }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "explore" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore" }) })] })) })))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle1", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.title", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.title" }) })), !categoriesOrdered.length && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.noResults }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults" }) }))), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [Object.entries(taggedCategories).map(([tagName, categories]) => {
|
|
127
128
|
var _a;
|
|
128
129
|
if (!categories.length || !((_a = categories[0].tags) === null || _a === void 0 ? void 0 : _a.length))
|
|
129
130
|
return null;
|
|
@@ -127,7 +127,10 @@ function SearchAutocomplete(inProps) {
|
|
|
127
127
|
return option;
|
|
128
128
|
}
|
|
129
129
|
return optionLabel(option);
|
|
130
|
-
}, renderOption: (props, option) =>
|
|
130
|
+
}, renderOption: (props, option) => {
|
|
131
|
+
const { key } = props, rest = tslib_1.__rest(props, ["key"]);
|
|
132
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: getOptionData(option).name, src: getOptionData(option).image, variant: getOptionData(option).variant }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ ml: 1 }, { children: getOptionData(option).name }))] }), key));
|
|
133
|
+
}, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { placeholder: `${intl.formatMessage(messages.placeholder, {
|
|
131
134
|
community: scPreferences.preferences[react_core_1.SCPreferences.TEXT_APPLICATION_NAME].value
|
|
132
135
|
})}`, slotProps: {
|
|
133
136
|
input: Object.assign(Object.assign({}, params.InputProps), { autoFocus, name: 'search-autocomplete', className: classes.input, startAdornment: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.icon }, { children: "search" })), endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Fade, Object.assign({ in: value.length > 0 || Boolean(onClear), appear: false }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.clear, onClick: handleClear, size: "small" }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) })) }))) })
|
|
@@ -120,9 +120,10 @@ const TagAutocomplete = (inProps) => {
|
|
|
120
120
|
});
|
|
121
121
|
}, []);
|
|
122
122
|
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root, open: open, onOpen: handleOpen, onClose: handleClose, options: tags || [], filterOptions: filterOptions, getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, handleHomeEndKeys: true, clearIcon: null, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.layer.audience.tags.empty", defaultMessage: "ui.composer.layer.audience.tags.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => (value === null || value === void 0 ? void 0 : value.id) === (option === null || option === void 0 ? void 0 : option.id), inputValue: inputValue, onInputChange: (_e, newInputValue) => setInputValue(newInputValue), renderOption: (props, option, { inputValue }) => {
|
|
123
|
+
const { key } = props, rest = tslib_1.__rest(props, ["key"]);
|
|
123
124
|
const matches = (0, match_1.default)(option.name, inputValue);
|
|
124
125
|
const parts = (0, parse_1.default)(option.name, matches);
|
|
125
|
-
return ((0, jsx_runtime_1.jsx)("li", Object.assign({},
|
|
126
|
+
return ((0, jsx_runtime_1.jsx)("li", Object.assign({}, rest, { children: (0, jsx_runtime_1.jsx)(TagChip_1.default, Object.assign({ showDescription: true, disposable: false, 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) }), key));
|
|
126
127
|
}, renderInput: (params) => {
|
|
127
128
|
return ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, TextFieldProps, { slotProps: {
|
|
128
129
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'tags', endAdornment: value || tags.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [loading && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) : null })
|
|
@@ -99,15 +99,17 @@ const UserAutocomplete = (inProps) => {
|
|
|
99
99
|
}, []);
|
|
100
100
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(AutocompleteRoot, Object.assign({ multiple: true, className: classes.autocompleteRoot, open: open, onOpen: handleOpen, onClose: handleClose, options: filteredUsers || [], filterOptions: filterOptions, getOptionLabel: (option) => option.username || '', value: value, inputValue: inputValue, onInputChange: (_event, newInputValue) => {
|
|
101
101
|
setInputValue(newInputValue);
|
|
102
|
-
}, selectOnFocus: true, clearOnBlur: true, blurOnSelect: true, handleHomeEndKeys: true, clearIcon: null, disabled: disabled || isLoading, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userAutocomplete.empty", defaultMessage: "ui.userAutocomplete.empty" }), onChange: handleChange, isOptionEqualToValue: (option, val) => (option ? val.id === option.id : false),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
}, selectOnFocus: true, clearOnBlur: true, blurOnSelect: true, handleHomeEndKeys: true, clearIcon: null, disabled: disabled || isLoading, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userAutocomplete.empty", defaultMessage: "ui.userAutocomplete.empty" }), onChange: handleChange, isOptionEqualToValue: (option, val) => (option ? val.id === option.id : false), renderValue: (value, getItemProps) => value.map((option, index) => {
|
|
103
|
+
if (typeof option === 'object') {
|
|
104
|
+
const _a = getItemProps({ index }), { key } = _a, rest = tslib_1.__rest(_a, ["key"]);
|
|
105
|
+
return (0, jsx_runtime_1.jsx)(material_1.Chip, Object.assign({ avatar: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: option.avatar }), label: option.username }, rest), key || option.id);
|
|
106
|
+
}
|
|
107
|
+
return (0, jsx_runtime_1.jsx)(material_1.Chip, Object.assign({ avatar: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: "" }), label: option }, getItemProps), `fallback-${option}`);
|
|
107
108
|
}), renderOption: (props, option, { inputValue }) => {
|
|
109
|
+
const { key } = props, rest = tslib_1.__rest(props, ["key"]);
|
|
108
110
|
const matches = (0, match_1.default)(option.username, inputValue);
|
|
109
111
|
const parts = (0, parse_1.default)(option.username, matches);
|
|
110
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" },
|
|
112
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: option.username, src: option.avatar, sx: { marginRight: 1 } }), (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)(material_1.Typography, { children: part.text }, index))) })] }), key));
|
|
111
113
|
}, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", slotProps: {
|
|
112
114
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'off', endAdornment: filteredUsers.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isLoading && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) : null })
|
|
113
115
|
} }))) }, rest)), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "primary", className: classes.info }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userAutocomplete.textarea.info", defaultMessage: "ui.userAutocomplete.textarea.info", values: {
|
|
@@ -68,7 +68,6 @@ function CopyTextField(inProps) {
|
|
|
68
68
|
// RENDER
|
|
69
69
|
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), label: label ? label : (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.shared.copyTextField.textToCopy", defaultMessage: "ui.shared.copyTextField.textToCopy" }), margin: "normal", variant: "outlined", disabled: true, fullWidth: true, value: value, multiline: true, onChange: handleChange, slotProps: {
|
|
70
70
|
input: {
|
|
71
|
-
disableUnderline: true,
|
|
72
71
|
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: openConfirm ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ open: openConfirm, slotProps: {
|
|
73
72
|
popper: {
|
|
74
73
|
open: true
|
|
@@ -123,12 +123,16 @@ const AudienceLayer = React.forwardRef((props, ref) => {
|
|
|
123
123
|
// Disable all tabs except the currently selected type
|
|
124
124
|
return type !== valueType;
|
|
125
125
|
};
|
|
126
|
-
return (_jsxs(Root, Object.assign({ ref: ref, className: classNames(className, classes.root) }, rest, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: onClose }, { children: _jsx(Icon, { children: "arrow_back" }) })), _jsx(Typography, { children: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.title", defaultMessage: "ui.composer.layer.audience.title" }) }), _jsx(Button, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSave }, { children: _jsx(FormattedMessage, { id: "ui.composer.layer.save", defaultMessage: "ui.composer.layer.save" }) }))] })), _jsxs(DialogContent, Object.assign({ className: classes.content }, { children: [_jsxs(Tabs, Object.assign({ value: audience, onChange: handleChangeAudience, "aria-label": "audience type" }, { children: [!taggingRequiredEnabled && (_jsx(Tab, { value: AudienceTypes.AUDIENCE_ALL, icon: _jsx(Icon, { children: "public" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.all", defaultMessage: "ui.composer.layer.audience.all" }) })), eventsEnabled && (_jsx(Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_EVENT), value: AudienceTypes.AUDIENCE_EVENT, icon: _jsx(Icon, { children: "CalendarIcon" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.event", defaultMessage: "ui.composer.layer.audience.event" }) })), groupsEnabled && (_jsx(Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_GROUP), value: AudienceTypes.AUDIENCE_GROUP, icon: _jsx(Icon, { children: "groups" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.group", defaultMessage: "ui.composer.layer.audience.group" }) })), _jsx(Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_TAG), value: AudienceTypes.AUDIENCE_TAG, icon: _jsx(Icon, { children: "label" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tag", defaultMessage: "ui.composer.layer.audience.tag" }) }), usersTaggingEnabled && (_jsx(Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_USERS), value: AudienceTypes.AUDIENCE_USERS, icon: _jsx(Icon, { children: "people_alt" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.users", defaultMessage: "ui.composer.layer.audience.users" }) }))] })), _jsxs(Typography, Object.assign({ className: classes.message }, { children: [audience === AudienceTypes.AUDIENCE_ALL && !taggingRequiredEnabled && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.all.message", defaultMessage: "ui.composer.layer.audience.all.message" })), audience === AudienceTypes.AUDIENCE_EVENT && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.event.message", defaultMessage: "ui.composer.layer.audience.event.message" })), audience === AudienceTypes.AUDIENCE_GROUP && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.group.message", defaultMessage: "ui.composer.layer.audience.group.message" })), audience === AudienceTypes.AUDIENCE_TAG && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.tag.message", defaultMessage: "ui.composer.layer.audience.tag.message" })), audience === AudienceTypes.AUDIENCE_USERS && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.users.message", defaultMessage: "ui.composer.layer.audience.users.message" }))] })), audience === AudienceTypes.AUDIENCE_TAG && (_jsx(Autocomplete, { className: classes.autocomplete, open: autocompleteOpen, onOpen: handleAutocompleteOpen, onClose: handleAutocompleteClose, multiple: true, options: scAddressingTags || [], getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, handleHomeEndKeys: true, clearIcon: null, noOptionsText: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tags.empty", defaultMessage: "ui.composer.layer.audience.tags.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => value.id === option.id,
|
|
127
|
-
return value.map((option, index) =>
|
|
126
|
+
return (_jsxs(Root, Object.assign({ ref: ref, className: classNames(className, classes.root) }, rest, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: onClose }, { children: _jsx(Icon, { children: "arrow_back" }) })), _jsx(Typography, { children: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.title", defaultMessage: "ui.composer.layer.audience.title" }) }), _jsx(Button, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSave }, { children: _jsx(FormattedMessage, { id: "ui.composer.layer.save", defaultMessage: "ui.composer.layer.save" }) }))] })), _jsxs(DialogContent, Object.assign({ className: classes.content }, { children: [_jsxs(Tabs, Object.assign({ value: audience, onChange: handleChangeAudience, "aria-label": "audience type" }, { children: [!taggingRequiredEnabled && (_jsx(Tab, { value: AudienceTypes.AUDIENCE_ALL, icon: _jsx(Icon, { children: "public" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.all", defaultMessage: "ui.composer.layer.audience.all" }) })), eventsEnabled && (_jsx(Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_EVENT), value: AudienceTypes.AUDIENCE_EVENT, icon: _jsx(Icon, { children: "CalendarIcon" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.event", defaultMessage: "ui.composer.layer.audience.event" }) })), groupsEnabled && (_jsx(Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_GROUP), value: AudienceTypes.AUDIENCE_GROUP, icon: _jsx(Icon, { children: "groups" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.group", defaultMessage: "ui.composer.layer.audience.group" }) })), _jsx(Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_TAG), value: AudienceTypes.AUDIENCE_TAG, icon: _jsx(Icon, { children: "label" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tag", defaultMessage: "ui.composer.layer.audience.tag" }) }), usersTaggingEnabled && (_jsx(Tab, { disabled: isAudienceTypeSelected(AudienceTypes.AUDIENCE_USERS), value: AudienceTypes.AUDIENCE_USERS, icon: _jsx(Icon, { children: "people_alt" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.users", defaultMessage: "ui.composer.layer.audience.users" }) }))] })), _jsxs(Typography, Object.assign({ className: classes.message }, { children: [audience === AudienceTypes.AUDIENCE_ALL && !taggingRequiredEnabled && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.all.message", defaultMessage: "ui.composer.layer.audience.all.message" })), audience === AudienceTypes.AUDIENCE_EVENT && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.event.message", defaultMessage: "ui.composer.layer.audience.event.message" })), audience === AudienceTypes.AUDIENCE_GROUP && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.group.message", defaultMessage: "ui.composer.layer.audience.group.message" })), audience === AudienceTypes.AUDIENCE_TAG && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.tag.message", defaultMessage: "ui.composer.layer.audience.tag.message" })), audience === AudienceTypes.AUDIENCE_USERS && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.users.message", defaultMessage: "ui.composer.layer.audience.users.message" }))] })), audience === AudienceTypes.AUDIENCE_TAG && (_jsx(Autocomplete, { className: classes.autocomplete, open: autocompleteOpen, onOpen: handleAutocompleteOpen, onClose: handleAutocompleteClose, multiple: true, options: scAddressingTags || [], getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, handleHomeEndKeys: true, clearIcon: null, noOptionsText: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tags.empty", defaultMessage: "ui.composer.layer.audience.tags.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => value.id === option.id, renderValue: (value, getItemProps) => {
|
|
127
|
+
return value.map((option, index) => {
|
|
128
|
+
const _a = getItemProps({ index }), { key } = _a, rest = __rest(_a, ["key"]);
|
|
129
|
+
return _jsx(TagChip, Object.assign({ tag: option }, rest, { showDescription: true }), key || option.id);
|
|
130
|
+
});
|
|
128
131
|
}, renderOption: (props, option, { inputValue }) => {
|
|
132
|
+
const { key } = props, rest = __rest(props, ["key"]);
|
|
129
133
|
const matches = match(option.name, inputValue);
|
|
130
134
|
const parts = parse(option.name, matches);
|
|
131
|
-
return (_jsx("li", Object.assign({},
|
|
135
|
+
return (_jsx("li", Object.assign({}, rest, { children: _jsx(TagChip, { showDescription: true, disposable: false, tag: option, label: _jsx(React.Fragment, { children: parts.map((part, index) => (_jsx("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) }, option.id) }), key));
|
|
132
136
|
}, renderInput: (params) => {
|
|
133
137
|
return (_jsx(TextField, Object.assign({}, params, TextFieldProps, { slotProps: {
|
|
134
138
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'addressing', endAdornment: _jsx(_Fragment, { children: params.InputProps.endAdornment }) })
|
|
@@ -81,9 +81,10 @@ const EventAutocomplete = (inProps) => {
|
|
|
81
81
|
// ));
|
|
82
82
|
// }}
|
|
83
83
|
renderOption: (props, option, { inputValue }) => {
|
|
84
|
+
const { key } = props, rest = __rest(props, ["key"]);
|
|
84
85
|
const matches = match(option.name, inputValue);
|
|
85
86
|
const parts = parse(option.name, matches);
|
|
86
|
-
return (_jsxs(Box, Object.assign({ component: "li" },
|
|
87
|
+
return (_jsxs(Box, Object.assign({ component: "li" }, rest, { children: [_jsx(Avatar, { alt: option.name, src: option.image_small, sx: { marginRight: 1 } }), _jsx(React.Fragment, { children: parts.map((part, index) => (_jsx(Typography, Object.assign({ sx: { fontWeight: part.highlight ? 700 : 400, marginRight: 0.2 } }, { children: part.text }), index))) })] }), key));
|
|
87
88
|
}, renderInput: (params) => {
|
|
88
89
|
return (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", slotProps: {
|
|
89
90
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'events', endAdornment: (_jsxs(_Fragment, { children: [isLoading && _jsx(CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) })
|
|
@@ -81,9 +81,10 @@ const GroupAutocomplete = (inProps) => {
|
|
|
81
81
|
// ));
|
|
82
82
|
// }}
|
|
83
83
|
renderOption: (props, option, { inputValue }) => {
|
|
84
|
+
const { key } = props, rest = __rest(props, ["key"]);
|
|
84
85
|
const matches = match(option.name, inputValue);
|
|
85
86
|
const parts = parse(option.name, matches);
|
|
86
|
-
return (_jsxs(Box, Object.assign({ component: "li" },
|
|
87
|
+
return (_jsxs(Box, Object.assign({ component: "li" }, rest, { children: [_jsx(Avatar, { alt: option.name, src: option.image_small, sx: { marginRight: 1 } }), _jsx(React.Fragment, { children: parts.map((part, index) => (_jsx(Typography, Object.assign({ sx: { fontWeight: part.highlight ? 700 : 400, marginRight: 0.2 } }, { children: part.text }), index))) })] }), key));
|
|
87
88
|
}, renderInput: (params) => {
|
|
88
89
|
return (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", slotProps: {
|
|
89
90
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'groups', endAdornment: (_jsxs(_Fragment, { children: [isLoading && _jsx(CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) })
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import { createElement as _createElement } from "react";
|
|
3
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
4
|
import { FormattedMessage } from 'react-intl';
|
|
6
|
-
import { Autocomplete, TextField, CircularProgress, styled } from '@mui/material';
|
|
5
|
+
import { Autocomplete, TextField, CircularProgress, styled, useThemeProps } from '@mui/material';
|
|
7
6
|
import { Endpoints, http } from '@selfcommunity/api-services';
|
|
8
7
|
import parse from 'autosuggest-highlight/parse';
|
|
9
8
|
import match from 'autosuggest-highlight/match';
|
|
10
|
-
import { useThemeProps } from '@mui/system';
|
|
11
9
|
const PREFIX = 'SCLocationAutocomplete';
|
|
12
10
|
const classes = {
|
|
13
11
|
root: `${PREFIX}-root`
|
|
@@ -103,8 +101,9 @@ export default function LocationAutocomplete(inProps) {
|
|
|
103
101
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'location', endAdornment: (_jsxs(_Fragment, { children: [isLoading ? _jsx(CircularProgress, { color: "inherit", size: 20 }) : null, params.InputProps.endAdornment] })) })
|
|
104
102
|
} })));
|
|
105
103
|
}, renderOption: (props, option, { inputValue }) => {
|
|
104
|
+
const { key } = props, rest = __rest(props, ["key"]);
|
|
106
105
|
const matches = match(option.full_address, inputValue);
|
|
107
106
|
const parts = parse(option.full_address, matches);
|
|
108
|
-
return (
|
|
107
|
+
return (_jsx("li", Object.assign({}, rest, { style: { whiteSpace: 'break-spaces' } }, { children: parts.map((part, index) => part.highlight ? (_jsx("span", Object.assign({ style: { fontWeight: 700 } }, { children: part.text }), index)) : (part.text)) }), key || `${option.lat}_${option.lng}`));
|
|
109
108
|
} }, rest)));
|
|
110
109
|
}
|
|
@@ -80,6 +80,7 @@ export default function DefaultDrawerContent(inProps) {
|
|
|
80
80
|
};
|
|
81
81
|
const handleClickHome = useCallback(() => {
|
|
82
82
|
if (onClickHome) {
|
|
83
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
83
84
|
onClickHome();
|
|
84
85
|
}
|
|
85
86
|
else {
|
|
@@ -88,7 +89,7 @@ export default function DefaultDrawerContent(inProps) {
|
|
|
88
89
|
scroll(window, { top: 0, behavior: 'smooth' });
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
|
-
}, [onClickHome]);
|
|
92
|
+
}, [onClickHome, onClose]);
|
|
92
93
|
// Order categories
|
|
93
94
|
useEffect(() => {
|
|
94
95
|
if (!scUserContext.user || (scUserContext.user && showAllCategories)) {
|
|
@@ -121,7 +122,7 @@ export default function DefaultDrawerContent(inProps) {
|
|
|
121
122
|
}
|
|
122
123
|
});
|
|
123
124
|
//order
|
|
124
|
-
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_jsxs(List, Object.assign({ className: classes.navigation }, { children: [scUserContext.user && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}), onClick: handleClickHome }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "home" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home" }) })] })) }))), coursesEnabled && (scUserContext.user || contentAvailable) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.COURSES_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "courses" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses" }) })] })) }))), groupsEnabled && scUserContext.user && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.GROUPS_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "groups" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups" }) })] })) }))), eventsEnabled && (scUserContext.user || contentAvailable) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.EVENTS_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "CalendarIcon" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events" }) })] })) }))), exploreStreamEnabled && (contentAvailable || scUserContext.user) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.EXPLORE_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "explore" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore" }) })] })) })))] })), _jsx(Divider, {}), _jsx(Typography, Object.assign({ variant: "subtitle1", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.title", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.title" }) })), !categoriesOrdered.length && (_jsx(Typography, Object.assign({ variant: "body1", className: classes.noResults }, { children: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults" }) }))), _jsxs(_Fragment, { children: [Object.entries(taggedCategories).map(([tagName, categories]) => {
|
|
125
|
+
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_jsxs(List, Object.assign({ className: classes.navigation }, { children: [scUserContext.user && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}), onClick: handleClickHome }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "home" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home" }) })] })) }))), coursesEnabled && (scUserContext.user || contentAvailable) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.COURSES_ROUTE_NAME, {}), onClick: onClose }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "courses" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses" }) })] })) }))), groupsEnabled && scUserContext.user && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.GROUPS_ROUTE_NAME, {}), onClick: onClose }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "groups" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups" }) })] })) }))), eventsEnabled && (scUserContext.user || contentAvailable) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.EVENTS_ROUTE_NAME, {}), onClick: onClose }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "CalendarIcon" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events" }) })] })) }))), exploreStreamEnabled && (contentAvailable || scUserContext.user) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.EXPLORE_ROUTE_NAME, {}), onClick: onClose }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "explore" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore" }) })] })) })))] })), _jsx(Divider, {}), _jsx(Typography, Object.assign({ variant: "subtitle1", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.title", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.title" }) })), !categoriesOrdered.length && (_jsx(Typography, Object.assign({ variant: "body1", className: classes.noResults }, { children: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults" }) }))), _jsxs(_Fragment, { children: [Object.entries(taggedCategories).map(([tagName, categories]) => {
|
|
125
126
|
var _a;
|
|
126
127
|
if (!categories.length || !((_a = categories[0].tags) === null || _a === void 0 ? void 0 : _a.length))
|
|
127
128
|
return null;
|
|
@@ -125,7 +125,10 @@ export default function SearchAutocomplete(inProps) {
|
|
|
125
125
|
return option;
|
|
126
126
|
}
|
|
127
127
|
return optionLabel(option);
|
|
128
|
-
}, renderOption: (props, option) =>
|
|
128
|
+
}, renderOption: (props, option) => {
|
|
129
|
+
const { key } = props, rest = __rest(props, ["key"]);
|
|
130
|
+
return (_jsxs(Box, Object.assign({ component: "li" }, rest, { children: [_jsx(Avatar, { alt: getOptionData(option).name, src: getOptionData(option).image, variant: getOptionData(option).variant }), _jsx(Typography, Object.assign({ ml: 1 }, { children: getOptionData(option).name }))] }), key));
|
|
131
|
+
}, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { placeholder: `${intl.formatMessage(messages.placeholder, {
|
|
129
132
|
community: scPreferences.preferences[SCPreferences.TEXT_APPLICATION_NAME].value
|
|
130
133
|
})}`, slotProps: {
|
|
131
134
|
input: Object.assign(Object.assign({}, params.InputProps), { autoFocus, name: 'search-autocomplete', className: classes.input, startAdornment: _jsx(Icon, Object.assign({ className: classes.icon }, { children: "search" })), endAdornment: (_jsx(Fade, Object.assign({ in: value.length > 0 || Boolean(onClear), appear: false }, { children: _jsx(IconButton, Object.assign({ className: classes.clear, onClick: handleClear, size: "small" }, { children: _jsx(Icon, { children: "close" }) })) }))) })
|
|
@@ -118,9 +118,10 @@ const TagAutocomplete = (inProps) => {
|
|
|
118
118
|
});
|
|
119
119
|
}, []);
|
|
120
120
|
return (_jsx(Root, Object.assign({ className: classes.root, open: open, onOpen: handleOpen, onClose: handleClose, options: tags || [], filterOptions: filterOptions, getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, handleHomeEndKeys: true, clearIcon: null, noOptionsText: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tags.empty", defaultMessage: "ui.composer.layer.audience.tags.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => (value === null || value === void 0 ? void 0 : value.id) === (option === null || option === void 0 ? void 0 : option.id), inputValue: inputValue, onInputChange: (_e, newInputValue) => setInputValue(newInputValue), renderOption: (props, option, { inputValue }) => {
|
|
121
|
+
const { key } = props, rest = __rest(props, ["key"]);
|
|
121
122
|
const matches = match(option.name, inputValue);
|
|
122
123
|
const parts = parse(option.name, matches);
|
|
123
|
-
return (_jsx("li", Object.assign({},
|
|
124
|
+
return (_jsx("li", Object.assign({}, rest, { children: _jsx(TagChip, Object.assign({ showDescription: true, disposable: false, tag: option, label: _jsx(React.Fragment, { children: parts.map((part, index) => (_jsx("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) }, TagChipProps), option.id) }), key));
|
|
124
125
|
}, renderInput: (params) => {
|
|
125
126
|
return (_jsx(TextField, Object.assign({}, params, TextFieldProps, { slotProps: {
|
|
126
127
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'tags', endAdornment: value || tags.length > 0 ? (_jsxs(_Fragment, { children: [loading && _jsx(CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) : null })
|
|
@@ -97,15 +97,17 @@ const UserAutocomplete = (inProps) => {
|
|
|
97
97
|
}, []);
|
|
98
98
|
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsx(AutocompleteRoot, Object.assign({ multiple: true, className: classes.autocompleteRoot, open: open, onOpen: handleOpen, onClose: handleClose, options: filteredUsers || [], filterOptions: filterOptions, getOptionLabel: (option) => option.username || '', value: value, inputValue: inputValue, onInputChange: (_event, newInputValue) => {
|
|
99
99
|
setInputValue(newInputValue);
|
|
100
|
-
}, selectOnFocus: true, clearOnBlur: true, blurOnSelect: true, handleHomeEndKeys: true, clearIcon: null, disabled: disabled || isLoading, noOptionsText: _jsx(FormattedMessage, { id: "ui.userAutocomplete.empty", defaultMessage: "ui.userAutocomplete.empty" }), onChange: handleChange, isOptionEqualToValue: (option, val) => (option ? val.id === option.id : false),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
}, selectOnFocus: true, clearOnBlur: true, blurOnSelect: true, handleHomeEndKeys: true, clearIcon: null, disabled: disabled || isLoading, noOptionsText: _jsx(FormattedMessage, { id: "ui.userAutocomplete.empty", defaultMessage: "ui.userAutocomplete.empty" }), onChange: handleChange, isOptionEqualToValue: (option, val) => (option ? val.id === option.id : false), renderValue: (value, getItemProps) => value.map((option, index) => {
|
|
101
|
+
if (typeof option === 'object') {
|
|
102
|
+
const _a = getItemProps({ index }), { key } = _a, rest = __rest(_a, ["key"]);
|
|
103
|
+
return _jsx(Chip, Object.assign({ avatar: _jsx(Avatar, { src: option.avatar }), label: option.username }, rest), key || option.id);
|
|
104
|
+
}
|
|
105
|
+
return _jsx(Chip, Object.assign({ avatar: _jsx(Avatar, { src: "" }), label: option }, getItemProps), `fallback-${option}`);
|
|
105
106
|
}), renderOption: (props, option, { inputValue }) => {
|
|
107
|
+
const { key } = props, rest = __rest(props, ["key"]);
|
|
106
108
|
const matches = match(option.username, inputValue);
|
|
107
109
|
const parts = parse(option.username, matches);
|
|
108
|
-
return (_jsxs(Box, Object.assign({ component: "li" },
|
|
110
|
+
return (_jsxs(Box, Object.assign({ component: "li" }, rest, { children: [_jsx(Avatar, { alt: option.username, src: option.avatar, sx: { marginRight: 1 } }), _jsx(React.Fragment, { children: parts.map((part, index) => (_jsx(Typography, { children: part.text }, index))) })] }), key));
|
|
109
111
|
}, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", slotProps: {
|
|
110
112
|
input: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'off', endAdornment: filteredUsers.length > 0 ? (_jsxs(_Fragment, { children: [isLoading && _jsx(CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) : null })
|
|
111
113
|
} }))) }, rest)), _jsx(Typography, Object.assign({ variant: "body2", color: "primary", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userAutocomplete.textarea.info", defaultMessage: "ui.userAutocomplete.textarea.info", values: {
|
|
@@ -66,7 +66,6 @@ export default function CopyTextField(inProps) {
|
|
|
66
66
|
// RENDER
|
|
67
67
|
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), label: label ? label : _jsx(FormattedMessage, { id: "ui.shared.copyTextField.textToCopy", defaultMessage: "ui.shared.copyTextField.textToCopy" }), margin: "normal", variant: "outlined", disabled: true, fullWidth: true, value: value, multiline: true, onChange: handleChange, slotProps: {
|
|
68
68
|
input: {
|
|
69
|
-
disableUnderline: true,
|
|
70
69
|
endAdornment: (_jsx(InputAdornment, Object.assign({ position: "end" }, { children: openConfirm ? (_jsx(Tooltip, Object.assign({ open: openConfirm, slotProps: {
|
|
71
70
|
popper: {
|
|
72
71
|
open: true
|