loon-bulma-react 2023.0.22 → 2023.0.23
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/dist/components/Calendar/CalendarItems/CalendarColoredItem.d.ts +2 -3
- package/dist/components/Calendar/CalendarItems/CalendarItem.d.ts +2 -3
- package/dist/components/Calendar/DayContainer.d.ts +3 -1
- package/dist/components/Calendar/Week/AlldayContainer.d.ts +3 -1
- package/dist/components/Calendar/Week/HourRow.d.ts +3 -1
- package/dist/components/Calendar/base-styles.d.ts +1 -12
- package/dist/components/Tooltip/Tooltip.d.ts +4 -1
- package/dist/index.js +152 -131
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +152 -131
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/styles/tooltip.scss +9 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
2
|
import { EventOptions, BaseEventProps } from '../Props';
|
|
3
3
|
declare type CalendarColoredItemProps<T extends BaseEventProps> = {
|
|
4
4
|
/** Het event */
|
|
@@ -8,12 +8,11 @@ declare type CalendarColoredItemProps<T extends BaseEventProps> = {
|
|
|
8
8
|
options?: EventOptions<T>;
|
|
9
9
|
/** Onclick handler voor het event */
|
|
10
10
|
onClick?: (event: T, clickEvent: MouseEvent<HTMLElement>) => void;
|
|
11
|
-
tooltip?: React.ReactNode;
|
|
12
11
|
};
|
|
13
12
|
/**
|
|
14
13
|
* Component voor een event dat de hele dag duurt
|
|
15
14
|
* @param props
|
|
16
15
|
* @returns
|
|
17
16
|
*/
|
|
18
|
-
export declare function CalendarColoredItem<T extends BaseEventProps>({ event, options,
|
|
17
|
+
export declare function CalendarColoredItem<T extends BaseEventProps>({ event, options, onClick, desc, }: CalendarColoredItemProps<T>): JSX.Element;
|
|
19
18
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
2
|
import { EventOptions, BaseEventProps } from '../Props';
|
|
3
3
|
declare type CalendarItemProps<T extends BaseEventProps> = {
|
|
4
4
|
desc: (event: T) => JSX.Element;
|
|
@@ -8,12 +8,11 @@ declare type CalendarItemProps<T extends BaseEventProps> = {
|
|
|
8
8
|
options?: EventOptions<T>;
|
|
9
9
|
/** Onclick handler */
|
|
10
10
|
onClick?: (event: T, clickEvent: MouseEvent<HTMLElement>) => void;
|
|
11
|
-
tooltip?: React.ReactNode;
|
|
12
11
|
};
|
|
13
12
|
/**
|
|
14
13
|
* Component voor een event met een tijdstip en NIET de hele dag duurt
|
|
15
14
|
* @param props
|
|
16
15
|
* @returns
|
|
17
16
|
*/
|
|
18
|
-
export declare function CalendarItem<T extends BaseEventProps>({ event, options,
|
|
17
|
+
export declare function CalendarItem<T extends BaseEventProps>({ event, options, onClick, desc, }: CalendarItemProps<T>): JSX.Element;
|
|
19
18
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseEventProps, CalendarOptions } from './Props';
|
|
3
3
|
import { JSDateTime } from '~/utils';
|
|
4
|
+
import { ColorProp } from '~/loon-react-bulma-types';
|
|
4
5
|
declare type DayContainerProps<T extends BaseEventProps> = {
|
|
5
6
|
/** Events op deze dag */
|
|
6
7
|
events: T[];
|
|
@@ -14,11 +15,12 @@ declare type DayContainerProps<T extends BaseEventProps> = {
|
|
|
14
15
|
date: JSDateTime;
|
|
15
16
|
/** Behoort deze dag tot de huidige maand ? */
|
|
16
17
|
isCurrentMonth?: boolean;
|
|
18
|
+
tooltipColor: ColorProp;
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
19
21
|
* Component voor de dag-container in de maand-view
|
|
20
22
|
* @param props
|
|
21
23
|
* @returns
|
|
22
24
|
*/
|
|
23
|
-
export declare function DayContainer<T extends BaseEventProps>({ options, date, onDayClick, onEventClick, events, isCurrentMonth, }: DayContainerProps<T>): JSX.Element;
|
|
25
|
+
export declare function DayContainer<T extends BaseEventProps>({ options, date, onDayClick, onEventClick, events, tooltipColor, isCurrentMonth, }: DayContainerProps<T>): JSX.Element;
|
|
24
26
|
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
3
|
+
import { ColorProp } from '~/loon-react-bulma-types';
|
|
3
4
|
declare type AlldayContainerProps<T extends BaseEventProps> = {
|
|
4
5
|
events: T[];
|
|
5
6
|
/** Wat te doen als een event aangeklikt wordt */
|
|
6
7
|
onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
7
8
|
/** Wat te doen als een dag aangeklikt wordt */
|
|
8
9
|
options?: CalendarOptions<T>;
|
|
10
|
+
tooltipColor: ColorProp;
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* Component voor allday objects in de calendar
|
|
12
14
|
* @param props
|
|
13
15
|
* @returns
|
|
14
16
|
*/
|
|
15
|
-
export declare function AlldayContainer<T extends BaseEventProps>({ options, events, onEventClick }: AlldayContainerProps<T>): JSX.Element;
|
|
17
|
+
export declare function AlldayContainer<T extends BaseEventProps>({ options, events, onEventClick, tooltipColor, }: AlldayContainerProps<T>): JSX.Element;
|
|
16
18
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ColorProp } from '../../../loon-react-bulma-types';
|
|
2
3
|
import { BaseEventProps, CalendarOptions } from '../Props';
|
|
3
4
|
/**
|
|
4
5
|
* Component om een uur-nummer weer te geven.
|
|
@@ -15,11 +16,12 @@ declare type HourSlotProps<T extends BaseEventProps> = {
|
|
|
15
16
|
onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
|
|
16
17
|
/** Options bij de calendar */
|
|
17
18
|
options?: CalendarOptions<T>;
|
|
19
|
+
tooltipColor?: ColorProp;
|
|
18
20
|
};
|
|
19
21
|
/**
|
|
20
22
|
* Component voor een uur-slot.
|
|
21
23
|
* @param param0
|
|
22
24
|
* @returns
|
|
23
25
|
*/
|
|
24
|
-
export declare function HourSlot<T extends BaseEventProps>({ events, onEventClick, options }: HourSlotProps<T>): JSX.Element;
|
|
26
|
+
export declare function HourSlot<T extends BaseEventProps>({ events, onEventClick, options, tooltipColor, }: HourSlotProps<T>): JSX.Element;
|
|
25
27
|
export {};
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from "react";
|
|
2
2
|
/** default style van events */
|
|
3
|
-
export declare const eventStylesBase:
|
|
4
|
-
transition: string;
|
|
5
|
-
fontSize: string;
|
|
6
|
-
height: string;
|
|
7
|
-
margin: string;
|
|
8
|
-
borderRadius: string;
|
|
9
|
-
textAlign: string;
|
|
10
|
-
paddingLeft: string;
|
|
11
|
-
paddingRight: string;
|
|
12
|
-
overflow: string;
|
|
13
|
-
textOverflow: string;
|
|
14
|
-
};
|
|
3
|
+
export declare const eventStylesBase: CSSProperties;
|
|
15
4
|
/** default styling van de header */
|
|
16
5
|
export declare const headerContainerStylesBase: CSSProperties;
|
|
17
6
|
/** default styling van de grid */
|
|
@@ -2,13 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import { ColorProp } from '~/loon-react-bulma-types';
|
|
3
3
|
declare type PositionProp = 'bottom';
|
|
4
4
|
export declare class Tooltip extends React.Component<{
|
|
5
|
-
content
|
|
5
|
+
content?: React.ReactNode;
|
|
6
6
|
color?: ColorProp;
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
display?: 'block' | 'inline';
|
|
8
9
|
}> {
|
|
9
10
|
static defaultProps: {
|
|
10
11
|
position: PositionProp;
|
|
11
12
|
color: ColorProp;
|
|
13
|
+
content: React.ReactNode;
|
|
14
|
+
display: 'block' | 'inline';
|
|
12
15
|
};
|
|
13
16
|
state: {
|
|
14
17
|
active: boolean;
|
package/dist/index.js
CHANGED
|
@@ -3509,78 +3509,9 @@ var eventKleurBlockStyleBase = {
|
|
|
3509
3509
|
transition: 'background-color .2s ease-in-out'
|
|
3510
3510
|
};
|
|
3511
3511
|
|
|
3512
|
-
var Tooltip = /*#__PURE__*/function (_React$Component) {
|
|
3513
|
-
_inheritsLoose(Tooltip, _React$Component);
|
|
3514
|
-
function Tooltip() {
|
|
3515
|
-
var _this;
|
|
3516
|
-
_this = _React$Component.apply(this, arguments) || this;
|
|
3517
|
-
_this.state = {
|
|
3518
|
-
active: false
|
|
3519
|
-
};
|
|
3520
|
-
_this.show = function () {
|
|
3521
|
-
return _this.setState({
|
|
3522
|
-
active: true
|
|
3523
|
-
});
|
|
3524
|
-
};
|
|
3525
|
-
_this.hide = function () {
|
|
3526
|
-
return _this.setState({
|
|
3527
|
-
active: false
|
|
3528
|
-
});
|
|
3529
|
-
};
|
|
3530
|
-
return _this;
|
|
3531
|
-
}
|
|
3532
|
-
var _proto = Tooltip.prototype;
|
|
3533
|
-
_proto.render = function render() {
|
|
3534
|
-
var _this$props = this.props,
|
|
3535
|
-
content = _this$props.content,
|
|
3536
|
-
children = _this$props.children,
|
|
3537
|
-
color = _this$props.color;
|
|
3538
|
-
var active = this.state.active;
|
|
3539
|
-
var className = "tooltip is-bottom";
|
|
3540
|
-
var arrowClassName = 'tooltip-arrow';
|
|
3541
|
-
if (color === 'p') {
|
|
3542
|
-
className += ' is-primary';
|
|
3543
|
-
arrowClassName += ' is-primary';
|
|
3544
|
-
} else if (color === 'i') {
|
|
3545
|
-
className += ' is-info';
|
|
3546
|
-
arrowClassName += ' is-info';
|
|
3547
|
-
} else if (color === 'l') {
|
|
3548
|
-
className += ' is-link';
|
|
3549
|
-
arrowClassName += ' is-link';
|
|
3550
|
-
} else if (color === 'd') {
|
|
3551
|
-
className += ' is-danger';
|
|
3552
|
-
arrowClassName += ' is-danger';
|
|
3553
|
-
} else if (color === 's') {
|
|
3554
|
-
className += ' is-success';
|
|
3555
|
-
arrowClassName += ' is-success';
|
|
3556
|
-
} else if (color === 'w') {
|
|
3557
|
-
className += ' is-warning';
|
|
3558
|
-
arrowClassName += ' is-warning';
|
|
3559
|
-
} else {
|
|
3560
|
-
className += " " + color;
|
|
3561
|
-
arrowClassName += " " + color;
|
|
3562
|
-
}
|
|
3563
|
-
return React__default.createElement("span", {
|
|
3564
|
-
className: "tooltip-wrapper",
|
|
3565
|
-
onMouseEnter: this.show,
|
|
3566
|
-
onMouseLeave: this.hide
|
|
3567
|
-
}, children, active && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
3568
|
-
className: className
|
|
3569
|
-
}, content), React__default.createElement("div", {
|
|
3570
|
-
className: arrowClassName
|
|
3571
|
-
})));
|
|
3572
|
-
};
|
|
3573
|
-
return Tooltip;
|
|
3574
|
-
}(React__default.Component);
|
|
3575
|
-
Tooltip.defaultProps = {
|
|
3576
|
-
position: 'bottom',
|
|
3577
|
-
color: 'l'
|
|
3578
|
-
};
|
|
3579
|
-
|
|
3580
3512
|
function CalendarColoredItem(_ref) {
|
|
3581
3513
|
var event = _ref.event,
|
|
3582
3514
|
options = _ref.options,
|
|
3583
|
-
tooltip = _ref.tooltip,
|
|
3584
3515
|
_onClick = _ref.onClick,
|
|
3585
3516
|
desc = _ref.desc;
|
|
3586
3517
|
var _React$useState = React__default.useState(false),
|
|
@@ -3601,22 +3532,7 @@ function CalendarColoredItem(_ref) {
|
|
|
3601
3532
|
});
|
|
3602
3533
|
}, [event, isHovered]);
|
|
3603
3534
|
var ref = React__default.useRef(null);
|
|
3604
|
-
|
|
3605
|
-
content: tooltip,
|
|
3606
|
-
color: "is-light"
|
|
3607
|
-
}, React__default.createElement("div", {
|
|
3608
|
-
ref: ref,
|
|
3609
|
-
onClick: function onClick(e) {
|
|
3610
|
-
return _onClick && _onClick(event, e);
|
|
3611
|
-
},
|
|
3612
|
-
style: eventStyle,
|
|
3613
|
-
onMouseEnter: function onMouseEnter() {
|
|
3614
|
-
return setHovered(true);
|
|
3615
|
-
},
|
|
3616
|
-
onMouseLeave: function onMouseLeave() {
|
|
3617
|
-
return setHovered(false);
|
|
3618
|
-
}
|
|
3619
|
-
}, React__default.createElement("span", null, desc(event))));else return React__default.createElement("div", {
|
|
3535
|
+
return React__default.createElement("div", {
|
|
3620
3536
|
ref: ref,
|
|
3621
3537
|
onClick: function onClick(e) {
|
|
3622
3538
|
return _onClick && _onClick(event, e);
|
|
@@ -3634,7 +3550,6 @@ function CalendarColoredItem(_ref) {
|
|
|
3634
3550
|
function CalendarItem(_ref) {
|
|
3635
3551
|
var event = _ref.event,
|
|
3636
3552
|
options = _ref.options,
|
|
3637
|
-
tooltip = _ref.tooltip,
|
|
3638
3553
|
_onClick = _ref.onClick,
|
|
3639
3554
|
desc = _ref.desc;
|
|
3640
3555
|
var _React$useState = React__default.useState(false),
|
|
@@ -3659,24 +3574,7 @@ function CalendarItem(_ref) {
|
|
|
3659
3574
|
});
|
|
3660
3575
|
}, [event, isHovered]);
|
|
3661
3576
|
var ref = React__default.useRef(null);
|
|
3662
|
-
|
|
3663
|
-
color: "is-light",
|
|
3664
|
-
content: tooltip
|
|
3665
|
-
}, React__default.createElement("div", {
|
|
3666
|
-
ref: ref,
|
|
3667
|
-
onClick: function onClick(e) {
|
|
3668
|
-
return _onClick && _onClick(event, e);
|
|
3669
|
-
},
|
|
3670
|
-
style: eventStyle,
|
|
3671
|
-
onMouseEnter: function onMouseEnter() {
|
|
3672
|
-
return setHovered(true);
|
|
3673
|
-
},
|
|
3674
|
-
onMouseLeave: function onMouseLeave() {
|
|
3675
|
-
return setHovered(false);
|
|
3676
|
-
}
|
|
3677
|
-
}, React__default.createElement("span", {
|
|
3678
|
-
style: eventSpan
|
|
3679
|
-
}), desc(event)));else return React__default.createElement("div", {
|
|
3577
|
+
return React__default.createElement("div", {
|
|
3680
3578
|
ref: ref,
|
|
3681
3579
|
onClick: function onClick(e) {
|
|
3682
3580
|
return _onClick && _onClick(event, e);
|
|
@@ -3772,12 +3670,87 @@ function MoreEventsView(_ref) {
|
|
|
3772
3670
|
}), React__default.createElement("span", null, "Toon minder"))));
|
|
3773
3671
|
}
|
|
3774
3672
|
|
|
3673
|
+
var Tooltip = /*#__PURE__*/function (_React$Component) {
|
|
3674
|
+
_inheritsLoose(Tooltip, _React$Component);
|
|
3675
|
+
function Tooltip() {
|
|
3676
|
+
var _this;
|
|
3677
|
+
_this = _React$Component.apply(this, arguments) || this;
|
|
3678
|
+
_this.state = {
|
|
3679
|
+
active: false
|
|
3680
|
+
};
|
|
3681
|
+
_this.show = function () {
|
|
3682
|
+
return _this.setState({
|
|
3683
|
+
active: true
|
|
3684
|
+
});
|
|
3685
|
+
};
|
|
3686
|
+
_this.hide = function () {
|
|
3687
|
+
return _this.setState({
|
|
3688
|
+
active: false
|
|
3689
|
+
});
|
|
3690
|
+
};
|
|
3691
|
+
return _this;
|
|
3692
|
+
}
|
|
3693
|
+
var _proto = Tooltip.prototype;
|
|
3694
|
+
_proto.render = function render() {
|
|
3695
|
+
var _this$props = this.props,
|
|
3696
|
+
content = _this$props.content,
|
|
3697
|
+
children = _this$props.children,
|
|
3698
|
+
color = _this$props.color,
|
|
3699
|
+
display = _this$props.display;
|
|
3700
|
+
var active = this.state.active;
|
|
3701
|
+
if (!content) return React__default.createElement(React__default.Fragment, null, children);else {
|
|
3702
|
+
var className = "tooltip is-bottom";
|
|
3703
|
+
var arrowClassName = 'tooltip-arrow';
|
|
3704
|
+
if (color === 'p') {
|
|
3705
|
+
className += ' is-primary';
|
|
3706
|
+
arrowClassName += ' is-primary';
|
|
3707
|
+
} else if (color === 'i') {
|
|
3708
|
+
className += ' is-info';
|
|
3709
|
+
arrowClassName += ' is-info';
|
|
3710
|
+
} else if (color === 'l') {
|
|
3711
|
+
className += ' is-link';
|
|
3712
|
+
arrowClassName += ' is-link';
|
|
3713
|
+
} else if (color === 'd') {
|
|
3714
|
+
className += ' is-danger';
|
|
3715
|
+
arrowClassName += ' is-danger';
|
|
3716
|
+
} else if (color === 's') {
|
|
3717
|
+
className += ' is-success';
|
|
3718
|
+
arrowClassName += ' is-success';
|
|
3719
|
+
} else if (color === 'w') {
|
|
3720
|
+
className += ' is-warning';
|
|
3721
|
+
arrowClassName += ' is-warning';
|
|
3722
|
+
} else {
|
|
3723
|
+
className += " " + color;
|
|
3724
|
+
arrowClassName += " " + color;
|
|
3725
|
+
}
|
|
3726
|
+
return React__default.createElement("div", {
|
|
3727
|
+
className: display === 'block' ? 'tooltip-wrapper-block' : 'tooltip-wrapper-inline',
|
|
3728
|
+
onMouseEnter: this.show,
|
|
3729
|
+
onMouseLeave: this.hide
|
|
3730
|
+
}, children, active && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
3731
|
+
className: className
|
|
3732
|
+
}, content), React__default.createElement("div", {
|
|
3733
|
+
className: arrowClassName
|
|
3734
|
+
})));
|
|
3735
|
+
}
|
|
3736
|
+
};
|
|
3737
|
+
return Tooltip;
|
|
3738
|
+
}(React__default.Component);
|
|
3739
|
+
Tooltip.defaultProps = {
|
|
3740
|
+
position: 'bottom',
|
|
3741
|
+
color: 'l',
|
|
3742
|
+
content: undefined,
|
|
3743
|
+
display: 'inline'
|
|
3744
|
+
};
|
|
3745
|
+
|
|
3775
3746
|
function DayContainer(_ref) {
|
|
3776
3747
|
var options = _ref.options,
|
|
3777
3748
|
date = _ref.date,
|
|
3778
3749
|
onDayClick = _ref.onDayClick,
|
|
3779
3750
|
onEventClick = _ref.onEventClick,
|
|
3780
3751
|
events = _ref.events,
|
|
3752
|
+
_ref$tooltipColor = _ref.tooltipColor,
|
|
3753
|
+
tooltipColor = _ref$tooltipColor === void 0 ? 'is-light' : _ref$tooltipColor,
|
|
3781
3754
|
_ref$isCurrentMonth = _ref.isCurrentMonth,
|
|
3782
3755
|
isCurrentMonth = _ref$isCurrentMonth === void 0 ? true : _ref$isCurrentMonth;
|
|
3783
3756
|
var _React$useState = React__default.useState(false),
|
|
@@ -3829,16 +3802,24 @@ function DayContainer(_ref) {
|
|
|
3829
3802
|
}, " ", date.monthLong)), React__default.createElement("div", null, events.map(function (evt, index) {
|
|
3830
3803
|
var _ref2, _options$event, _options$event2, _options$event3, _options$event4;
|
|
3831
3804
|
var key = (_ref2 = "" + (typeof evt.id === 'function' ? evt.id() : evt.id)) != null ? _ref2 : index;
|
|
3832
|
-
if (evt.allDay && index < 4) return React__default.createElement(
|
|
3805
|
+
if (evt.allDay && index < 4) return React__default.createElement(Tooltip, {
|
|
3806
|
+
key: key,
|
|
3807
|
+
display: "block",
|
|
3808
|
+
color: tooltipColor,
|
|
3809
|
+
content: typeof evt.description === 'function' ? evt.description() : evt.description
|
|
3810
|
+
}, React__default.createElement(CalendarColoredItem, {
|
|
3833
3811
|
desc: function desc(evt) {
|
|
3834
3812
|
return React__default.createElement("span", null, typeof evt.title === 'string' ? evt.title : evt.title());
|
|
3835
3813
|
},
|
|
3836
|
-
tooltip: typeof evt.description === 'function' ? evt.description() : evt.description,
|
|
3837
|
-
key: key,
|
|
3838
3814
|
event: evt,
|
|
3839
3815
|
options: options === null || options === void 0 ? void 0 : (_options$event = options.event) === null || _options$event === void 0 ? void 0 : _options$event.allday,
|
|
3840
3816
|
onClick: onEventClick
|
|
3841
|
-
});else if (!evt.allDay && index < 4) return React__default.createElement(
|
|
3817
|
+
}));else if (!evt.allDay && index < 4) return React__default.createElement(Tooltip, {
|
|
3818
|
+
key: key,
|
|
3819
|
+
display: "block",
|
|
3820
|
+
color: tooltipColor,
|
|
3821
|
+
content: typeof evt.description === 'function' ? evt.description() : evt.description
|
|
3822
|
+
}, React__default.createElement(CalendarItem, {
|
|
3842
3823
|
desc: function desc(evt) {
|
|
3843
3824
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("strong", null, evt.startDateTime.timeHM), React__default.createElement("span", {
|
|
3844
3825
|
style: {
|
|
@@ -3846,26 +3827,32 @@ function DayContainer(_ref) {
|
|
|
3846
3827
|
}
|
|
3847
3828
|
}, typeof evt.title === 'string' ? evt.title : evt.title()));
|
|
3848
3829
|
},
|
|
3849
|
-
tooltip: typeof evt.description === 'function' ? evt.description() : evt.description,
|
|
3850
|
-
key: key,
|
|
3851
3830
|
event: evt,
|
|
3852
3831
|
options: options === null || options === void 0 ? void 0 : (_options$event2 = options.event) === null || _options$event2 === void 0 ? void 0 : _options$event2.timed,
|
|
3853
3832
|
onClick: onEventClick
|
|
3854
|
-
});else if (index === 4 && events.length > 5) return React__default.createElement(MoreEventsView, {
|
|
3833
|
+
}));else if (index === 4 && events.length > 5) return React__default.createElement(MoreEventsView, {
|
|
3855
3834
|
key: date.dateShort + '-more',
|
|
3856
3835
|
events: events,
|
|
3857
3836
|
onEventClick: onEventClick,
|
|
3858
3837
|
options: options === null || options === void 0 ? void 0 : options.event
|
|
3859
|
-
});else if (index === 4 && evt.allDay) return React__default.createElement(
|
|
3838
|
+
});else if (index === 4 && evt.allDay) return React__default.createElement(Tooltip, {
|
|
3839
|
+
key: key,
|
|
3840
|
+
display: "block",
|
|
3841
|
+
color: tooltipColor,
|
|
3842
|
+
content: typeof evt.description === 'function' ? evt.description() : evt.description
|
|
3843
|
+
}, React__default.createElement(CalendarColoredItem, {
|
|
3860
3844
|
desc: function desc(evt) {
|
|
3861
3845
|
return React__default.createElement("span", null, typeof evt.title === 'string' ? evt.title : evt.title());
|
|
3862
3846
|
},
|
|
3863
|
-
tooltip: typeof evt.description === 'function' ? evt.description() : evt.description,
|
|
3864
|
-
key: key,
|
|
3865
3847
|
event: evt,
|
|
3866
3848
|
options: options === null || options === void 0 ? void 0 : (_options$event3 = options.event) === null || _options$event3 === void 0 ? void 0 : _options$event3.allday,
|
|
3867
3849
|
onClick: onEventClick
|
|
3868
|
-
});else if (index === 4 && !evt.allDay) return React__default.createElement(
|
|
3850
|
+
}));else if (index === 4 && !evt.allDay) return React__default.createElement(Tooltip, {
|
|
3851
|
+
key: key,
|
|
3852
|
+
display: "block",
|
|
3853
|
+
color: tooltipColor,
|
|
3854
|
+
content: typeof evt.description === 'function' ? evt.description() : evt.description
|
|
3855
|
+
}, React__default.createElement(CalendarItem, {
|
|
3869
3856
|
desc: function desc(evt) {
|
|
3870
3857
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("strong", null, evt.startDateTime.timeHM), React__default.createElement("span", {
|
|
3871
3858
|
style: {
|
|
@@ -3873,12 +3860,10 @@ function DayContainer(_ref) {
|
|
|
3873
3860
|
}
|
|
3874
3861
|
}, typeof evt.title === 'string' ? evt.title : evt.title()));
|
|
3875
3862
|
},
|
|
3876
|
-
tooltip: typeof evt.description === 'function' ? evt.description() : evt.description,
|
|
3877
|
-
key: key,
|
|
3878
3863
|
event: evt,
|
|
3879
3864
|
options: options === null || options === void 0 ? void 0 : (_options$event4 = options.event) === null || _options$event4 === void 0 ? void 0 : _options$event4.timed,
|
|
3880
3865
|
onClick: onEventClick
|
|
3881
|
-
});else return null;
|
|
3866
|
+
}));else return null;
|
|
3882
3867
|
})));
|
|
3883
3868
|
}
|
|
3884
3869
|
|
|
@@ -4012,6 +3997,7 @@ function FourweeksViewDayBlocks(_ref4) {
|
|
|
4012
3997
|
var weekLength = visibleDays.size;
|
|
4013
3998
|
var counter = 0;
|
|
4014
3999
|
return React__default.createElement(React__default.Fragment, null, datesWithEvents.map(function (_ref5) {
|
|
4000
|
+
var _options$tooltipColor;
|
|
4015
4001
|
var date = _ref5[0],
|
|
4016
4002
|
events = _ref5[1];
|
|
4017
4003
|
if (counter == weekLength) counter = 0;
|
|
@@ -4023,6 +4009,7 @@ function FourweeksViewDayBlocks(_ref4) {
|
|
|
4023
4009
|
key: date.ISO,
|
|
4024
4010
|
date: date,
|
|
4025
4011
|
events: events,
|
|
4012
|
+
tooltipColor: (_options$tooltipColor = options === null || options === void 0 ? void 0 : options.tooltipColor) != null ? _options$tooltipColor : 'is-light',
|
|
4026
4013
|
onEventClick: onEventClick,
|
|
4027
4014
|
onDayClick: onDayClick,
|
|
4028
4015
|
options: options
|
|
@@ -4157,6 +4144,7 @@ function MonthViewDayBlocks(_ref4) {
|
|
|
4157
4144
|
var weekLength = visibleDays.size;
|
|
4158
4145
|
var counter = 0;
|
|
4159
4146
|
return React__default.createElement(React__default.Fragment, null, datesWithEvents.map(function (_ref5) {
|
|
4147
|
+
var _options$tooltipColor;
|
|
4160
4148
|
var date = _ref5[0],
|
|
4161
4149
|
events = _ref5[1];
|
|
4162
4150
|
if (counter === weekLength) counter = 0;
|
|
@@ -4168,6 +4156,7 @@ function MonthViewDayBlocks(_ref4) {
|
|
|
4168
4156
|
key: date.ISO,
|
|
4169
4157
|
date: date,
|
|
4170
4158
|
events: events,
|
|
4159
|
+
tooltipColor: (_options$tooltipColor = options === null || options === void 0 ? void 0 : options.tooltipColor) != null ? _options$tooltipColor : 'is-light',
|
|
4171
4160
|
onEventClick: onEventClick,
|
|
4172
4161
|
onDayClick: onDayClick,
|
|
4173
4162
|
options: options,
|
|
@@ -4190,7 +4179,8 @@ function WeekNumberCell$1(_ref6) {
|
|
|
4190
4179
|
function AlldayContainer(_ref) {
|
|
4191
4180
|
var options = _ref.options,
|
|
4192
4181
|
events = _ref.events,
|
|
4193
|
-
onEventClick = _ref.onEventClick
|
|
4182
|
+
onEventClick = _ref.onEventClick,
|
|
4183
|
+
tooltipColor = _ref.tooltipColor;
|
|
4194
4184
|
var dayContainerStyle = React__default.useMemo(function () {
|
|
4195
4185
|
return _extends({}, dayContainerStyleBase);
|
|
4196
4186
|
}, []);
|
|
@@ -4198,15 +4188,19 @@ function AlldayContainer(_ref) {
|
|
|
4198
4188
|
style: dayContainerStyle
|
|
4199
4189
|
}, events.map(function (e) {
|
|
4200
4190
|
var _options$event;
|
|
4201
|
-
return React__default.createElement(
|
|
4191
|
+
return React__default.createElement(Tooltip, {
|
|
4202
4192
|
key: "" + (typeof e.id === 'function' ? e.id() : e.id),
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4193
|
+
display: "block",
|
|
4194
|
+
color: tooltipColor,
|
|
4195
|
+
content: typeof e.description === 'function' ? e.description() : e.description
|
|
4196
|
+
}, React__default.createElement(CalendarItem, {
|
|
4206
4197
|
desc: function desc(e) {
|
|
4207
4198
|
return React__default.createElement("span", null, typeof e.title == 'function' ? e.title() : e.title);
|
|
4208
|
-
}
|
|
4209
|
-
|
|
4199
|
+
},
|
|
4200
|
+
event: e,
|
|
4201
|
+
options: options === null || options === void 0 ? void 0 : (_options$event = options.event) === null || _options$event === void 0 ? void 0 : _options$event.allday,
|
|
4202
|
+
onClick: onEventClick
|
|
4203
|
+
}));
|
|
4210
4204
|
}));
|
|
4211
4205
|
}
|
|
4212
4206
|
|
|
@@ -4227,7 +4221,8 @@ function HourSlot(_ref2) {
|
|
|
4227
4221
|
var _ref$current;
|
|
4228
4222
|
var events = _ref2.events,
|
|
4229
4223
|
onEventClick = _ref2.onEventClick,
|
|
4230
|
-
options = _ref2.options
|
|
4224
|
+
options = _ref2.options,
|
|
4225
|
+
tooltipColor = _ref2.tooltipColor;
|
|
4231
4226
|
var hourSlotStyle = React__default.useMemo(function () {
|
|
4232
4227
|
return {
|
|
4233
4228
|
maxHeight: '60px',
|
|
@@ -4247,12 +4242,15 @@ function HourSlot(_ref2) {
|
|
|
4247
4242
|
}, events.map(function (evt, i) {
|
|
4248
4243
|
var _options$event;
|
|
4249
4244
|
return React__default.createElement(WeekTimedItem, {
|
|
4245
|
+
tooltipColor: tooltipColor,
|
|
4246
|
+
key: "" + (typeof evt.id === 'function' ? evt.id() : evt.id),
|
|
4250
4247
|
options: options === null || options === void 0 ? void 0 : (_options$event = options.event) === null || _options$event === void 0 ? void 0 : _options$event.timed,
|
|
4251
4248
|
event: evt,
|
|
4252
4249
|
eventIndex: i,
|
|
4253
|
-
key: "" + (typeof evt.id === 'function' ? evt.id() : evt.id),
|
|
4254
4250
|
desc: function desc(e) {
|
|
4255
|
-
|
|
4251
|
+
var title = typeof e.title === 'function' ? e.title() : e.title;
|
|
4252
|
+
if (title.length > 80) title = title.substring(0, 80) + '...';
|
|
4253
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", null, React__default.createElement("b", null, e.startDateTime.timeHM)), React__default.createElement("div", null, title));
|
|
4256
4254
|
},
|
|
4257
4255
|
onClick: onEventClick,
|
|
4258
4256
|
eventWidth: eventWidth
|
|
@@ -4264,6 +4262,7 @@ function WeekTimedItem(_ref3) {
|
|
|
4264
4262
|
options = _ref3.options,
|
|
4265
4263
|
eventWidth = _ref3.eventWidth,
|
|
4266
4264
|
eventIndex = _ref3.eventIndex,
|
|
4265
|
+
tooltipColor = _ref3.tooltipColor,
|
|
4267
4266
|
_onClick = _ref3.onClick,
|
|
4268
4267
|
desc = _ref3.desc;
|
|
4269
4268
|
var _React$useState = React__default.useState(false),
|
|
@@ -4288,15 +4287,19 @@ function WeekTimedItem(_ref3) {
|
|
|
4288
4287
|
color: txtColor,
|
|
4289
4288
|
margin: '0',
|
|
4290
4289
|
marginX: '2px',
|
|
4290
|
+
paddingLeft: '3px',
|
|
4291
|
+
paddingTop: '3px',
|
|
4291
4292
|
marginTop: start.minute + "px",
|
|
4292
|
-
height: minutesAsPixels + "px",
|
|
4293
|
+
height: (minutesAsPixels < 30 ? 30 : minutesAsPixels) + "px",
|
|
4293
4294
|
width: eventWidth,
|
|
4294
4295
|
lineHeight: '1.05em',
|
|
4296
|
+
overflow: 'visible',
|
|
4295
4297
|
marginLeft: eventIndex * eventWidth + "px",
|
|
4296
4298
|
cursor: _onClick ? 'pointer' : 'default'
|
|
4297
4299
|
});
|
|
4298
4300
|
}, [event, isHovered, eventWidth, eventIndex]);
|
|
4299
4301
|
return React__default.createElement("div", {
|
|
4302
|
+
key: "" + (typeof event.id === 'function' ? event.id() : event.id),
|
|
4300
4303
|
ref: ref,
|
|
4301
4304
|
onClick: function onClick(e) {
|
|
4302
4305
|
return _onClick && _onClick(event, e);
|
|
@@ -4308,7 +4311,21 @@ function WeekTimedItem(_ref3) {
|
|
|
4308
4311
|
onMouseLeave: function onMouseLeave() {
|
|
4309
4312
|
return setHovered(false);
|
|
4310
4313
|
}
|
|
4311
|
-
}, React__default.createElement(
|
|
4314
|
+
}, React__default.createElement(Tooltip, {
|
|
4315
|
+
key: "" + (typeof event.id === 'function' ? event.id() : event.id),
|
|
4316
|
+
display: "block",
|
|
4317
|
+
color: tooltipColor,
|
|
4318
|
+
content: typeof event.description === 'function' ? event.description() : event.description
|
|
4319
|
+
}, React__default.createElement("span", {
|
|
4320
|
+
style: {
|
|
4321
|
+
overflow: 'clip',
|
|
4322
|
+
textOverflow: 'ellipsis',
|
|
4323
|
+
position: 'absolute',
|
|
4324
|
+
left: '3px',
|
|
4325
|
+
right: '3px',
|
|
4326
|
+
top: '3px'
|
|
4327
|
+
}
|
|
4328
|
+
}, desc(event))));
|
|
4312
4329
|
}
|
|
4313
4330
|
|
|
4314
4331
|
function WeekView(_ref) {
|
|
@@ -4408,13 +4425,15 @@ function WeekView(_ref) {
|
|
|
4408
4425
|
borderBottom: 'thin solid #e1e1e1'
|
|
4409
4426
|
})
|
|
4410
4427
|
}), datesWithEvents.allday.map(function (_ref5) {
|
|
4428
|
+
var _options$tooltipColor;
|
|
4411
4429
|
var date = _ref5[0],
|
|
4412
4430
|
events = _ref5[1];
|
|
4413
4431
|
return React__default.createElement(AlldayContainer, {
|
|
4414
4432
|
key: date.dayShort,
|
|
4415
4433
|
events: events,
|
|
4416
4434
|
onEventClick: onEventClick,
|
|
4417
|
-
options: options
|
|
4435
|
+
options: options,
|
|
4436
|
+
tooltipColor: (_options$tooltipColor = options === null || options === void 0 ? void 0 : options.tooltipColor) != null ? _options$tooltipColor : 'is-light'
|
|
4418
4437
|
});
|
|
4419
4438
|
}), hours.map(function (hour) {
|
|
4420
4439
|
return React__default.createElement(React__default.Fragment, {
|
|
@@ -4422,12 +4441,14 @@ function WeekView(_ref) {
|
|
|
4422
4441
|
}, React__default.createElement(HourNumber, {
|
|
4423
4442
|
hour: hour
|
|
4424
4443
|
}), datesWithEvents.timed.map(function (_ref6) {
|
|
4444
|
+
var _options$tooltipColor2;
|
|
4425
4445
|
var date = _ref6[0],
|
|
4426
4446
|
events = _ref6[1];
|
|
4427
4447
|
var filteredEvts = events.filter(function (e) {
|
|
4428
4448
|
return e.startDateTime.hour === hour;
|
|
4429
4449
|
});
|
|
4430
4450
|
return React__default.createElement(HourSlot, {
|
|
4451
|
+
tooltipColor: (_options$tooltipColor2 = options === null || options === void 0 ? void 0 : options.tooltipColor) != null ? _options$tooltipColor2 : 'is-light',
|
|
4431
4452
|
key: date.dayShort + '-' + hour,
|
|
4432
4453
|
events: filteredEvts,
|
|
4433
4454
|
onEventClick: onEventClick,
|