@selfcommunity/react-ui 0.11.0-mui7.27 → 0.11.0-mui7.30
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/EventLocationWidget/EventMap.js +8 -2
- package/lib/cjs/components/PlatformWidget/PlatformWidget.js +1 -1
- package/lib/cjs/shared/Tags/index.js +9 -9
- package/lib/esm/components/EventLocationWidget/EventMap.js +9 -3
- package/lib/esm/components/PlatformWidget/PlatformWidget.js +1 -1
- package/lib/esm/shared/Tags/index.js +9 -9
- package/lib/umd/484.js +1 -1
- package/lib/umd/484.js.LICENSE.txt +1 -1
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -11,10 +11,16 @@ function EventMap(props) {
|
|
|
11
11
|
if (!isLoaded) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Valid mapId for AdvancedMarker
|
|
16
|
+
* https://visgl.github.io/react-google-maps/docs/guides/ssr-and-frameworks
|
|
17
|
+
* https://developers.google.com/maps/deprecations
|
|
18
|
+
* https://developers.google.com/maps/documentation/javascript/advanced-markers/migration
|
|
19
|
+
*/
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(react_google_maps_1.Map, Object.assign({ className: className, mapId: "aef14f6caa750c5616b23934", defaultCenter: {
|
|
15
21
|
lat: event.geolocation_lat,
|
|
16
22
|
lng: event.geolocation_lng
|
|
17
|
-
}, zoom: 15, fullscreenControl: false, mapTypeControl: false, streetViewControl: false, zoomControl: false }, { children: (0, jsx_runtime_1.jsx)(react_google_maps_1.
|
|
23
|
+
}, zoom: 15, gestureHandling: "greedy", fullscreenControl: false, mapTypeControl: false, streetViewControl: false, zoomControl: false }, { children: (0, jsx_runtime_1.jsx)(react_google_maps_1.AdvancedMarker, { position: {
|
|
18
24
|
lat: event.geolocation_lat,
|
|
19
25
|
lng: event.geolocation_lng
|
|
20
26
|
} }) })));
|
|
@@ -297,7 +297,7 @@ function PlatformWidget(inProps) {
|
|
|
297
297
|
/**
|
|
298
298
|
* Renders platform card
|
|
299
299
|
*/
|
|
300
|
-
const content = ((0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true, width: "100%", spacing: isAdmin ? 1 : 3, justifyContent: "center", className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ size: "grow" }, { children: title ? (title) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.title }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.platformWidget.title.tooltip", defaultMessage: "ui.platformWidget.title.tooltip" }), placement: "top" }, { children: (0, jsx_runtime_1.jsx)("img", { src: logo_1.default, alt: "logo" }) })) }))) })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ className: classes.actions }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { size: 1, className: classes.action }), actions.map((a, i) => {
|
|
300
|
+
const content = ((0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true, width: "100%", spacing: isAdmin ? 1 : 3, justifyContent: "center", className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ size: "grow" }, { children: title ? (title) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.title }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.platformWidget.title.tooltip", defaultMessage: "ui.platformWidget.title.tooltip" }), placement: "top" }, { children: (0, jsx_runtime_1.jsx)("img", { src: logo_1.default, alt: "logo" }) })) }))) })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ size: 12, className: classes.actions }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { size: 1, className: classes.action }), actions.map((a, i) => {
|
|
301
301
|
return ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ size: "auto", className: (0, classnames_1.default)(classes.action, { [classes.actionHighlighted]: tutorialIndex === i && isTutorialOpen }) }, { children: a.render }), i));
|
|
302
302
|
}), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: 1, className: classes.action })] }))] })));
|
|
303
303
|
/**
|
|
@@ -10,7 +10,7 @@ const PREFIX = 'SCTags';
|
|
|
10
10
|
const TagsPopperRoot = (0, material_1.styled)(material_1.Box, {
|
|
11
11
|
name: `${PREFIX}`,
|
|
12
12
|
slot: 'Root',
|
|
13
|
-
overridesResolver: (
|
|
13
|
+
overridesResolver: (_props, styles) => styles.root
|
|
14
14
|
})(() => ({
|
|
15
15
|
cursor: 'pointer'
|
|
16
16
|
}));
|
|
@@ -23,7 +23,7 @@ const classes = {
|
|
|
23
23
|
const TagsPopper = (0, material_1.styled)(material_1.Popper, {
|
|
24
24
|
name: `${PREFIX}Popper`,
|
|
25
25
|
slot: 'Root',
|
|
26
|
-
overridesResolver: (
|
|
26
|
+
overridesResolver: (_props, styles) => styles.root
|
|
27
27
|
})(() => ({
|
|
28
28
|
zIndex: 2,
|
|
29
29
|
[`& .${classes.paper}`]: {
|
|
@@ -36,12 +36,12 @@ const TagsPopper = (0, material_1.styled)(material_1.Popper, {
|
|
|
36
36
|
const ListRoot = (0, material_1.styled)(material_1.Stack, {
|
|
37
37
|
name: `${PREFIX}List`,
|
|
38
38
|
slot: 'Root',
|
|
39
|
-
overridesResolver: (
|
|
39
|
+
overridesResolver: (_props, styles) => styles.root
|
|
40
40
|
})({});
|
|
41
41
|
const StackList = (0, material_1.styled)(material_1.Stack, {
|
|
42
42
|
name: `${PREFIX}Stack`,
|
|
43
43
|
slot: 'Root',
|
|
44
|
-
overridesResolver: (
|
|
44
|
+
overridesResolver: (_props, styles) => styles.root
|
|
45
45
|
})({
|
|
46
46
|
flexWrap: 'wrap',
|
|
47
47
|
justifyContent: 'flex-start',
|
|
@@ -53,7 +53,7 @@ const StackList = (0, material_1.styled)(material_1.Stack, {
|
|
|
53
53
|
const ItemList = (0, material_1.styled)(material_1.Box, {
|
|
54
54
|
name: `${PREFIX}ItemList`,
|
|
55
55
|
slot: 'Root',
|
|
56
|
-
overridesResolver: (
|
|
56
|
+
overridesResolver: (_props, styles) => styles.root
|
|
57
57
|
})(({ theme }) => ({
|
|
58
58
|
padding: theme.spacing(0.2),
|
|
59
59
|
textAlign: 'center',
|
|
@@ -66,7 +66,7 @@ var TagsComponentType;
|
|
|
66
66
|
})(TagsComponentType = exports.TagsComponentType || (exports.TagsComponentType = {}));
|
|
67
67
|
function Tags(props) {
|
|
68
68
|
// PROPS
|
|
69
|
-
const { tags = [], title = null, type = TagsComponentType.POPPER,
|
|
69
|
+
const { tags = [], title = null, type = TagsComponentType.POPPER, onClickTag = null, TagChipProps = {} } = props, rest = tslib_1.__rest(props, ["tags", "title", "type", "onClickTag", "TagChipProps"]);
|
|
70
70
|
// STATE
|
|
71
71
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
72
72
|
let popperRef = (0, react_1.useRef)(null);
|
|
@@ -77,13 +77,13 @@ function Tags(props) {
|
|
|
77
77
|
rest.onOpen(!open);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function handleClose() {
|
|
80
|
+
function handleClose(event) {
|
|
81
81
|
if (popperRef.current && popperRef.current.contains(event.target)) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
setOpen(false);
|
|
85
85
|
if (rest.onClose) {
|
|
86
|
-
rest.onClose();
|
|
86
|
+
rest.onClose(event);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
@@ -112,7 +112,7 @@ function Tags(props) {
|
|
|
112
112
|
}
|
|
113
113
|
] }, { children: (_a) => {
|
|
114
114
|
var { TransitionProps, placement } = _a, rest = tslib_1.__rest(_a, ["TransitionProps", "placement"]);
|
|
115
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Grow, Object.assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ variant: "outlined", className: classes.paper }, { children: (0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, Object.assign({ onClickAway: handleClose }, { children: (0, jsx_runtime_1.jsxs)(
|
|
115
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Grow, Object.assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ variant: "outlined", className: classes.paper }, { children: (0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, Object.assign({ onClickAway: handleClose }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [renderTitle(), (0, jsx_runtime_1.jsx)(StackList, Object.assign({ spacing: 2 }, rest, { children: tags
|
|
116
116
|
.filter((tag) => tag.visible)
|
|
117
117
|
.map((tag) => ((0, jsx_runtime_1.jsx)(ItemList, { children: (0, jsx_runtime_1.jsx)(TagChip_1.default, Object.assign({ tag: tag, onClick: onClickTag }, TagChipProps, { showDescription: true })) }, tag.id))) }))] }) })) })) })));
|
|
118
118
|
} }))] }))) : ((0, jsx_runtime_1.jsxs)(ListRoot, { children: [renderTitle(), (0, jsx_runtime_1.jsx)(StackList, Object.assign({ spacing: 1, direction: rest.direction ? rest.direction : 'column' }, { children: tags
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useSCGoogleApiLoader } from '@selfcommunity/react-core';
|
|
3
|
-
import { Map,
|
|
3
|
+
import { Map, AdvancedMarker } from '@vis.gl/react-google-maps';
|
|
4
4
|
export default function EventMap(props) {
|
|
5
5
|
// PROPS
|
|
6
6
|
const { event, className } = props;
|
|
@@ -9,10 +9,16 @@ export default function EventMap(props) {
|
|
|
9
9
|
if (!isLoaded) {
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Valid mapId for AdvancedMarker
|
|
14
|
+
* https://visgl.github.io/react-google-maps/docs/guides/ssr-and-frameworks
|
|
15
|
+
* https://developers.google.com/maps/deprecations
|
|
16
|
+
* https://developers.google.com/maps/documentation/javascript/advanced-markers/migration
|
|
17
|
+
*/
|
|
18
|
+
return (_jsx(Map, Object.assign({ className: className, mapId: "aef14f6caa750c5616b23934", defaultCenter: {
|
|
13
19
|
lat: event.geolocation_lat,
|
|
14
20
|
lng: event.geolocation_lng
|
|
15
|
-
}, zoom: 15, fullscreenControl: false, mapTypeControl: false, streetViewControl: false, zoomControl: false }, { children: _jsx(
|
|
21
|
+
}, zoom: 15, gestureHandling: "greedy", fullscreenControl: false, mapTypeControl: false, streetViewControl: false, zoomControl: false }, { children: _jsx(AdvancedMarker, { position: {
|
|
16
22
|
lat: event.geolocation_lat,
|
|
17
23
|
lng: event.geolocation_lng
|
|
18
24
|
} }) })));
|
|
@@ -295,7 +295,7 @@ export default function PlatformWidget(inProps) {
|
|
|
295
295
|
/**
|
|
296
296
|
* Renders platform card
|
|
297
297
|
*/
|
|
298
|
-
const content = (_jsxs(Grid, Object.assign({ container: true, width: "100%", spacing: isAdmin ? 1 : 3, justifyContent: "center", className: classes.content }, { children: [_jsx(Grid, Object.assign({ size: "grow" }, { children: title ? (title) : (_jsx(Box, Object.assign({ className: classes.title }, { children: _jsx(Tooltip, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.platformWidget.title.tooltip", defaultMessage: "ui.platformWidget.title.tooltip" }), placement: "top" }, { children: _jsx("img", { src: LogoPlaceholder, alt: "logo" }) })) }))) })), _jsxs(Grid, Object.assign({ className: classes.actions }, { children: [_jsx(Grid, { size: 1, className: classes.action }), actions.map((a, i) => {
|
|
298
|
+
const content = (_jsxs(Grid, Object.assign({ container: true, width: "100%", spacing: isAdmin ? 1 : 3, justifyContent: "center", className: classes.content }, { children: [_jsx(Grid, Object.assign({ size: "grow" }, { children: title ? (title) : (_jsx(Box, Object.assign({ className: classes.title }, { children: _jsx(Tooltip, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.platformWidget.title.tooltip", defaultMessage: "ui.platformWidget.title.tooltip" }), placement: "top" }, { children: _jsx("img", { src: LogoPlaceholder, alt: "logo" }) })) }))) })), _jsxs(Grid, Object.assign({ size: 12, className: classes.actions }, { children: [_jsx(Grid, { size: 1, className: classes.action }), actions.map((a, i) => {
|
|
299
299
|
return (_jsx(Grid, Object.assign({ size: "auto", className: classNames(classes.action, { [classes.actionHighlighted]: tutorialIndex === i && isTutorialOpen }) }, { children: a.render }), i));
|
|
300
300
|
}), _jsx(Grid, { size: 1, className: classes.action })] }))] })));
|
|
301
301
|
/**
|
|
@@ -7,7 +7,7 @@ const PREFIX = 'SCTags';
|
|
|
7
7
|
const TagsPopperRoot = styled(Box, {
|
|
8
8
|
name: `${PREFIX}`,
|
|
9
9
|
slot: 'Root',
|
|
10
|
-
overridesResolver: (
|
|
10
|
+
overridesResolver: (_props, styles) => styles.root
|
|
11
11
|
})(() => ({
|
|
12
12
|
cursor: 'pointer'
|
|
13
13
|
}));
|
|
@@ -20,7 +20,7 @@ const classes = {
|
|
|
20
20
|
const TagsPopper = styled(Popper, {
|
|
21
21
|
name: `${PREFIX}Popper`,
|
|
22
22
|
slot: 'Root',
|
|
23
|
-
overridesResolver: (
|
|
23
|
+
overridesResolver: (_props, styles) => styles.root
|
|
24
24
|
})(() => ({
|
|
25
25
|
zIndex: 2,
|
|
26
26
|
[`& .${classes.paper}`]: {
|
|
@@ -33,12 +33,12 @@ const TagsPopper = styled(Popper, {
|
|
|
33
33
|
const ListRoot = styled(Stack, {
|
|
34
34
|
name: `${PREFIX}List`,
|
|
35
35
|
slot: 'Root',
|
|
36
|
-
overridesResolver: (
|
|
36
|
+
overridesResolver: (_props, styles) => styles.root
|
|
37
37
|
})({});
|
|
38
38
|
const StackList = styled(Stack, {
|
|
39
39
|
name: `${PREFIX}Stack`,
|
|
40
40
|
slot: 'Root',
|
|
41
|
-
overridesResolver: (
|
|
41
|
+
overridesResolver: (_props, styles) => styles.root
|
|
42
42
|
})({
|
|
43
43
|
flexWrap: 'wrap',
|
|
44
44
|
justifyContent: 'flex-start',
|
|
@@ -50,7 +50,7 @@ const StackList = styled(Stack, {
|
|
|
50
50
|
const ItemList = styled(Box, {
|
|
51
51
|
name: `${PREFIX}ItemList`,
|
|
52
52
|
slot: 'Root',
|
|
53
|
-
overridesResolver: (
|
|
53
|
+
overridesResolver: (_props, styles) => styles.root
|
|
54
54
|
})(({ theme }) => ({
|
|
55
55
|
padding: theme.spacing(0.2),
|
|
56
56
|
textAlign: 'center',
|
|
@@ -63,7 +63,7 @@ export var TagsComponentType;
|
|
|
63
63
|
})(TagsComponentType || (TagsComponentType = {}));
|
|
64
64
|
export default function Tags(props) {
|
|
65
65
|
// PROPS
|
|
66
|
-
const { tags = [], title = null, type = TagsComponentType.POPPER,
|
|
66
|
+
const { tags = [], title = null, type = TagsComponentType.POPPER, onClickTag = null, TagChipProps = {} } = props, rest = __rest(props, ["tags", "title", "type", "onClickTag", "TagChipProps"]);
|
|
67
67
|
// STATE
|
|
68
68
|
const [open, setOpen] = useState(false);
|
|
69
69
|
let popperRef = useRef(null);
|
|
@@ -74,13 +74,13 @@ export default function Tags(props) {
|
|
|
74
74
|
rest.onOpen(!open);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
function handleClose() {
|
|
77
|
+
function handleClose(event) {
|
|
78
78
|
if (popperRef.current && popperRef.current.contains(event.target)) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
setOpen(false);
|
|
82
82
|
if (rest.onClose) {
|
|
83
|
-
rest.onClose();
|
|
83
|
+
rest.onClose(event);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
@@ -109,7 +109,7 @@ export default function Tags(props) {
|
|
|
109
109
|
}
|
|
110
110
|
] }, { children: (_a) => {
|
|
111
111
|
var { TransitionProps, placement } = _a, rest = __rest(_a, ["TransitionProps", "placement"]);
|
|
112
|
-
return (_jsx(Grow, Object.assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom' } }, { children: _jsx(Paper, Object.assign({ variant: "outlined", className: classes.paper }, { children: _jsx(ClickAwayListener, Object.assign({ onClickAway: handleClose }, { children: _jsxs(
|
|
112
|
+
return (_jsx(Grow, Object.assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom' } }, { children: _jsx(Paper, Object.assign({ variant: "outlined", className: classes.paper }, { children: _jsx(ClickAwayListener, Object.assign({ onClickAway: handleClose }, { children: _jsxs(Box, { children: [renderTitle(), _jsx(StackList, Object.assign({ spacing: 2 }, rest, { children: tags
|
|
113
113
|
.filter((tag) => tag.visible)
|
|
114
114
|
.map((tag) => (_jsx(ItemList, { children: _jsx(TagChip, Object.assign({ tag: tag, onClick: onClickTag }, TagChipProps, { showDescription: true })) }, tag.id))) }))] }) })) })) })));
|
|
115
115
|
} }))] }))) : (_jsxs(ListRoot, { children: [renderTitle(), _jsx(StackList, Object.assign({ spacing: 1, direction: rest.direction ? rest.direction : 'column' }, { children: tags
|