@selfcommunity/react-ui 0.7.50-events.59 → 0.7.50-events.60

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.
@@ -31,7 +31,7 @@ export interface EventHeaderProps {
31
31
  * Props to spread event actions menu
32
32
  * @default {}
33
33
  */
34
- EventActionsProps?: EventActionsMenuProps;
34
+ EventActionsProps?: Omit<EventActionsMenuProps, 'event'>;
35
35
  /**
36
36
  * Any other properties
37
37
  */
@@ -184,7 +184,7 @@ function Events(inProps) {
184
184
  * Renders events list
185
185
  */
186
186
  const filteredEvents = (0, utils_1.sortByAttr)(getFilteredEvents(), 'order');
187
- const c = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general && events.length ? ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick }) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { size: 'small', fullWidth: true, value: search, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ disabled: showPastEvents, size: 'small', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ value: option.value }, { children: [(0, jsx_runtime_1.jsx)(material_1.Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot
187
+ const c = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, autoHide: !events.length }) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { size: 'small', fullWidth: true, value: search, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ disabled: showPastEvents, size: 'small', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ value: option.value }, { children: [(0, jsx_runtime_1.jsx)(material_1.Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot
188
188
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
189
189
  // @ts-ignore
190
190
  , {
@@ -1,5 +1,6 @@
1
1
  import { ChipProps } from '@mui/material';
2
2
  export interface PastEventsFilterProps extends ChipProps {
3
+ autoHide?: boolean;
3
4
  showPastEvents: boolean;
4
5
  handleClick: () => void;
5
6
  handleDeleteClick?: () => void;
@@ -7,13 +7,17 @@ const react_intl_1 = require("react-intl");
7
7
  const system_1 = require("@mui/system");
8
8
  const constants_1 = require("./constants");
9
9
  const Events_1 = require("./Events");
10
+ const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
10
11
  function PastEventsFilter(inProps) {
11
12
  // PROPS
12
13
  const props = (0, system_1.useThemeProps)({
13
14
  props: inProps,
14
15
  name: constants_1.PREFIX
15
16
  });
16
- const { showPastEvents, handleClick, handleDeleteClick } = props, rest = tslib_1.__rest(props, ["showPastEvents", "handleClick", "handleDeleteClick"]);
17
+ const { autoHide = false, showPastEvents, handleClick, handleDeleteClick } = props, rest = tslib_1.__rest(props, ["autoHide", "showPastEvents", "handleClick", "handleDeleteClick"]);
18
+ if (autoHide) {
19
+ return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
20
+ }
17
21
  return ((0, jsx_runtime_1.jsx)(Events_1.EventsChipRoot
18
22
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
19
23
  // @ts-ignore
@@ -31,7 +31,7 @@ export interface EventHeaderProps {
31
31
  * Props to spread event actions menu
32
32
  * @default {}
33
33
  */
34
- EventActionsProps?: EventActionsMenuProps;
34
+ EventActionsProps?: Omit<EventActionsMenuProps, 'event'>;
35
35
  /**
36
36
  * Any other properties
37
37
  */
@@ -181,7 +181,7 @@ export default function Events(inProps) {
181
181
  * Renders events list
182
182
  */
183
183
  const filteredEvents = sortByAttr(getFilteredEvents(), 'order');
184
- const c = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general && events.length ? (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(PastEventsFilter, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick }) }))) : (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, md: 4 }, { children: _jsx(TextField, { size: 'small', fullWidth: true, value: search, label: _jsx(FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(InputLabel, { children: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), _jsx(Select, Object.assign({ disabled: showPastEvents, size: 'small', label: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => (_jsxs(MenuItem, Object.assign({ value: option.value }, { children: [_jsx(Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), _jsx(Grid, Object.assign({ item: true }, { children: _jsx(EventsChipRoot
184
+ const c = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(PastEventsFilter, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, autoHide: !events.length }) }))) : (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, md: 4 }, { children: _jsx(TextField, { size: 'small', fullWidth: true, value: search, label: _jsx(FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(InputLabel, { children: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), _jsx(Select, Object.assign({ disabled: showPastEvents, size: 'small', label: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => (_jsxs(MenuItem, Object.assign({ value: option.value }, { children: [_jsx(Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), _jsx(Grid, Object.assign({ item: true }, { children: _jsx(EventsChipRoot
185
185
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
186
186
  // @ts-ignore
187
187
  , {
@@ -1,5 +1,6 @@
1
1
  import { ChipProps } from '@mui/material';
2
2
  export interface PastEventsFilterProps extends ChipProps {
3
+ autoHide?: boolean;
3
4
  showPastEvents: boolean;
4
5
  handleClick: () => void;
5
6
  handleDeleteClick?: () => void;
@@ -5,13 +5,17 @@ import { FormattedMessage } from 'react-intl';
5
5
  import { useThemeProps } from '@mui/system';
6
6
  import { PREFIX } from './constants';
7
7
  import { EventsChipRoot } from './Events';
8
+ import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
8
9
  export default function PastEventsFilter(inProps) {
9
10
  // PROPS
10
11
  const props = useThemeProps({
11
12
  props: inProps,
12
13
  name: PREFIX
13
14
  });
14
- const { showPastEvents, handleClick, handleDeleteClick } = props, rest = __rest(props, ["showPastEvents", "handleClick", "handleDeleteClick"]);
15
+ const { autoHide = false, showPastEvents, handleClick, handleDeleteClick } = props, rest = __rest(props, ["autoHide", "showPastEvents", "handleClick", "handleDeleteClick"]);
16
+ if (autoHide) {
17
+ return _jsx(HiddenPlaceholder, {});
18
+ }
15
19
  return (_jsx(EventsChipRoot
16
20
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
17
21
  // @ts-ignore