@utrecht/calendar-react 1.0.0 → 1.0.1
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/CalendarButton.d.ts +5 -5
- package/dist/CalendarButton.d.ts.map +1 -1
- package/dist/CalendarIcon.d.ts +4 -4
- package/dist/CalendarIcon.d.ts.map +1 -1
- package/dist/CalendarNavigation.d.ts +4 -4
- package/dist/CalendarNavigation.d.ts.map +1 -1
- package/dist/CalendarNavigationButtons.d.ts +12 -12
- package/dist/CalendarNavigationButtons.d.ts.map +1 -1
- package/dist/CalendarNavigationLabel.d.ts +4 -4
- package/dist/CalendarNavigationLabel.d.ts.map +1 -1
- package/dist/CalendarTableDaysContainer.d.ts +4 -4
- package/dist/CalendarTableDaysContainer.d.ts.map +1 -1
- package/dist/CalendarTableDaysItem.d.ts +4 -4
- package/dist/CalendarTableDaysItem.d.ts.map +1 -1
- package/dist/CalendarTableDaysItemDay.d.ts +11 -11
- package/dist/CalendarTableDaysItemDay.d.ts.map +1 -1
- package/dist/CalendarTableWeeksContainer.d.ts +2 -2
- package/dist/CalendarTableWeeksItem.d.ts +4 -4
- package/dist/CalendarTableWeeksItem.d.ts.map +1 -1
- package/dist/IconArrowLeft.d.ts +7 -7
- package/dist/IconArrowLeft.d.ts.map +1 -1
- package/dist/IconArrowLeftDouble.d.ts +7 -7
- package/dist/IconArrowLeftDouble.d.ts.map +1 -1
- package/dist/IconArrowRight.d.ts +7 -7
- package/dist/IconArrowRight.d.ts.map +1 -1
- package/dist/IconArrowRightDouble.d.ts +7 -7
- package/dist/IconArrowRightDouble.d.ts.map +1 -1
- package/dist/css.d.ts +7 -7
- package/dist/css.js +271 -333
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +276 -338
- package/dist/css.mjs.map +1 -1
- package/dist/index.cjs.js +270 -333
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +41 -41
- package/dist/index.esm.js +275 -338
- package/dist/index.esm.js.map +1 -1
- package/package.json +38 -10
package/dist/index.esm.js
CHANGED
|
@@ -1,217 +1,133 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
1
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import { startOfWeek, endOfWeek, eachDayOfInterval, isSameDay, endOfDay, parseISO, setYear, getYear, addYears, setMonth, addMonths, format, isSameMonth, formatISO, isBefore, startOfDay, isAfter, startOfMonth, addWeeks } from 'date-fns';
|
|
3
4
|
import { enUS } from 'date-fns/locale';
|
|
4
5
|
import chunk from 'lodash.chunk';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
9
|
+
import { Button } from '@utrecht/button-react';
|
|
10
|
+
import clsx$1, { clsx } from 'clsx';
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
16
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
17
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
18
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
19
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
-
***************************************************************************** */
|
|
22
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function __rest$1(s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
38
|
-
var e = new Error(message);
|
|
39
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const CalendarNavigation = _a => {
|
|
43
|
-
var {
|
|
44
|
-
children
|
|
45
|
-
} = _a,
|
|
46
|
-
props = __rest$1(_a, ["children"]);
|
|
47
|
-
return jsx("div", Object.assign({
|
|
12
|
+
var _excluded$c = ["children"];
|
|
13
|
+
function ownKeys$c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
var CalendarNavigation = function CalendarNavigation(_ref) {
|
|
16
|
+
var children = _ref.children,
|
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
18
|
+
return jsx("div", _objectSpread$c(_objectSpread$c({
|
|
48
19
|
className: "utrecht-calendar__navigation"
|
|
49
|
-
}, props, {
|
|
20
|
+
}, props), {}, {
|
|
50
21
|
children: children
|
|
51
22
|
}));
|
|
52
23
|
};
|
|
53
24
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
63
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
64
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
65
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
66
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
67
|
-
***************************************************************************** */
|
|
68
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
function __rest(s, e) {
|
|
72
|
-
var t = {};
|
|
73
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
74
|
-
t[p] = s[p];
|
|
75
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
76
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
77
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
78
|
-
t[p[i]] = s[p[i]];
|
|
79
|
-
}
|
|
80
|
-
return t;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
84
|
-
var e = new Error(message);
|
|
85
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const Button = /*#__PURE__*/forwardRef((_a, ref) => {
|
|
89
|
-
var {
|
|
90
|
-
appearance,
|
|
91
|
-
busy,
|
|
92
|
-
disabled,
|
|
93
|
-
children,
|
|
94
|
-
className,
|
|
95
|
-
hint,
|
|
96
|
-
pressed,
|
|
97
|
-
type
|
|
98
|
-
} = _a,
|
|
99
|
-
restProps = __rest(_a, ["appearance", "busy", "disabled", "children", "className", "hint", "pressed", "type"]);
|
|
100
|
-
return jsx("button", Object.assign({
|
|
101
|
-
ref: ref,
|
|
102
|
-
className: clsx('utrecht-button', busy && 'utrecht-button--busy', disabled && 'utrecht-button--disabled', type === 'submit' && 'utrecht-button--submit', appearance === 'primary-action-button' && 'utrecht-button--primary-action', appearance === 'secondary-action-button' && 'utrecht-button--secondary-action', appearance === 'subtle-button' && 'utrecht-button--subtle', hint === 'danger' && 'utrecht-button--danger', hint === 'warning' && 'utrecht-button--warning', hint === 'ready' && 'utrecht-button--ready', pressed === true && 'utrecht-button--pressed', className),
|
|
103
|
-
"aria-busy": busy || undefined,
|
|
104
|
-
"aria-pressed": typeof pressed === 'boolean' ? pressed : undefined,
|
|
105
|
-
disabled: disabled,
|
|
106
|
-
type: type || 'button'
|
|
107
|
-
}, restProps, {
|
|
108
|
-
children: children
|
|
109
|
-
}));
|
|
110
|
-
});
|
|
111
|
-
Button.displayName = 'Button';
|
|
112
|
-
|
|
113
|
-
const CalendarButton = _a => {
|
|
114
|
-
var {
|
|
115
|
-
children,
|
|
116
|
-
className
|
|
117
|
-
} = _a,
|
|
118
|
-
props = __rest$1(_a, ["children", "className"]);
|
|
119
|
-
return jsx(Button, Object.assign({
|
|
25
|
+
var _excluded$b = ["children", "className"];
|
|
26
|
+
function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
|
+
var CalendarButton = function CalendarButton(_ref) {
|
|
29
|
+
var children = _ref.children,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
32
|
+
return jsx(Button, _objectSpread$b(_objectSpread$b({
|
|
120
33
|
appearance: "subtle-button"
|
|
121
|
-
}, props, {
|
|
122
|
-
className: clsx
|
|
123
|
-
}, {
|
|
34
|
+
}, props), {}, {
|
|
35
|
+
className: clsx('utrecht-calendar__button', className),
|
|
124
36
|
children: children
|
|
125
37
|
}));
|
|
126
38
|
};
|
|
127
39
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
40
|
+
var _excluded$a = ["children"];
|
|
41
|
+
function ownKeys$a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
42
|
+
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
43
|
+
var CalendarIcon = function CalendarIcon(_ref) {
|
|
44
|
+
var children = _ref.children,
|
|
45
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
46
|
+
return jsx("div", _objectSpread$a(_objectSpread$a({
|
|
47
|
+
className: clsx('utrecht-calendar__icon')
|
|
48
|
+
}, props), {}, {
|
|
136
49
|
children: children
|
|
137
50
|
}));
|
|
138
51
|
};
|
|
139
52
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
children: [jsx(CalendarButton,
|
|
53
|
+
var _excluded$9 = ["onPreviousClick", "onNextClick", "previousIcon", "nextIcon", "children"];
|
|
54
|
+
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
55
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
56
|
+
var CalendarNavigationButtons = function CalendarNavigationButtons(_ref) {
|
|
57
|
+
var onPreviousClick = _ref.onPreviousClick,
|
|
58
|
+
onNextClick = _ref.onNextClick,
|
|
59
|
+
previousIcon = _ref.previousIcon,
|
|
60
|
+
nextIcon = _ref.nextIcon,
|
|
61
|
+
children = _ref.children,
|
|
62
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
63
|
+
return jsxs("div", {
|
|
64
|
+
className: "utrecht-calendar__navigation-buttons",
|
|
65
|
+
children: [jsx(CalendarButton, _objectSpread$9(_objectSpread$9({
|
|
153
66
|
onClick: onPreviousClick
|
|
154
|
-
}, props, {
|
|
67
|
+
}, props), {}, {
|
|
155
68
|
children: jsx(CalendarIcon, {
|
|
156
69
|
children: previousIcon
|
|
157
70
|
})
|
|
158
|
-
})), children, jsx(CalendarButton,
|
|
71
|
+
})), children, jsx(CalendarButton, _objectSpread$9(_objectSpread$9({
|
|
159
72
|
onClick: onNextClick
|
|
160
|
-
}, props, {
|
|
73
|
+
}, props), {}, {
|
|
161
74
|
children: jsx(CalendarIcon, {
|
|
162
75
|
children: nextIcon
|
|
163
76
|
})
|
|
164
77
|
}))]
|
|
165
|
-
})
|
|
78
|
+
});
|
|
166
79
|
};
|
|
167
80
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
81
|
+
var _excluded$8 = ["children"];
|
|
82
|
+
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
83
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
84
|
+
var CalendarNavigationLabel = function CalendarNavigationLabel(_ref) {
|
|
85
|
+
var children = _ref.children,
|
|
86
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
87
|
+
return jsx("time", _objectSpread$8(_objectSpread$8({
|
|
174
88
|
className: "utrecht-calendar__navigation-label"
|
|
175
|
-
}, props, {
|
|
89
|
+
}, props), {}, {
|
|
176
90
|
children: children
|
|
177
91
|
}));
|
|
178
92
|
};
|
|
179
93
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
94
|
+
var _excluded$7 = ["children"];
|
|
95
|
+
function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
96
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
97
|
+
var CalendarTableDaysContainer = function CalendarTableDaysContainer(_ref) {
|
|
98
|
+
var children = _ref.children,
|
|
99
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
100
|
+
return jsx("tbody", _objectSpread$7(_objectSpread$7({}, props), {}, {
|
|
101
|
+
className: "utrecht-calendar__table-days-container",
|
|
188
102
|
children: children
|
|
189
103
|
}));
|
|
190
104
|
};
|
|
191
105
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
106
|
+
var _excluded$6 = ["children"];
|
|
107
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
108
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
109
|
+
var CalendarTableDaysItem = function CalendarTableDaysItem(_ref) {
|
|
110
|
+
var children = _ref.children,
|
|
111
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
112
|
+
return jsx("tr", _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
198
113
|
children: children
|
|
199
114
|
}));
|
|
200
115
|
};
|
|
201
116
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
117
|
+
var _excluded$5 = ["day", "dayOutOfTheMonth", "isToday", "emphasis", "selected", "disabled"];
|
|
118
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
119
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
120
|
+
var CalendarTableDaysItemDay = function CalendarTableDaysItemDay(_ref) {
|
|
121
|
+
var day = _ref.day,
|
|
122
|
+
dayOutOfTheMonth = _ref.dayOutOfTheMonth,
|
|
123
|
+
isToday = _ref.isToday,
|
|
124
|
+
emphasis = _ref.emphasis,
|
|
125
|
+
selected = _ref.selected,
|
|
126
|
+
disabled = _ref.disabled,
|
|
127
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
212
128
|
return jsx("td", {
|
|
213
|
-
children: jsx(CalendarButton,
|
|
214
|
-
className: clsx('utrecht-calendar__table-days-item-day', {
|
|
129
|
+
children: jsx(CalendarButton, _objectSpread$5(_objectSpread$5({
|
|
130
|
+
className: clsx$1('utrecht-calendar__table-days-item-day', {
|
|
215
131
|
'utrecht-calendar__table-days-item-day--out-of-the-month': dayOutOfTheMonth
|
|
216
132
|
}, {
|
|
217
133
|
'utrecht-calendar__table-days-item-day--is-today': isToday
|
|
@@ -221,78 +137,77 @@ const CalendarTableDaysItemDay = _a => {
|
|
|
221
137
|
'utrecht-calendar__table-days-item-day--selected': selected
|
|
222
138
|
}),
|
|
223
139
|
disabled: disabled
|
|
224
|
-
}, props, {
|
|
140
|
+
}, props), {}, {
|
|
225
141
|
children: day
|
|
226
142
|
}))
|
|
227
143
|
});
|
|
228
144
|
};
|
|
229
145
|
|
|
230
|
-
|
|
231
|
-
children
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}));
|
|
146
|
+
var CalendarTableWeeksContainer = function CalendarTableWeeksContainer(_ref) {
|
|
147
|
+
var children = _ref.children;
|
|
148
|
+
return jsx("thead", {
|
|
149
|
+
className: "utrecht-calendar__table-weeks-container",
|
|
150
|
+
children: jsx("tr", {
|
|
151
|
+
className: "utrecht-calendar__table-weeks-container-content",
|
|
152
|
+
children: children
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
};
|
|
241
156
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
157
|
+
var _excluded$4 = ["children"];
|
|
158
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
159
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
160
|
+
var CalendarTableWeeksItem = function CalendarTableWeeksItem(_ref) {
|
|
161
|
+
var children = _ref.children,
|
|
162
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
163
|
+
return jsx("th", _objectSpread$4(_objectSpread$4({}, props), {}, {
|
|
164
|
+
className: "utrecht-calendar__table-weeks-item",
|
|
250
165
|
children: children
|
|
251
166
|
}));
|
|
252
167
|
};
|
|
253
168
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
169
|
+
var _excluded$3 = ["title", "titleId"];
|
|
170
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
171
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
172
|
+
var IconArrowLeft = function IconArrowLeft(_ref) {
|
|
173
|
+
var title = _ref.title,
|
|
174
|
+
titleId = _ref.titleId,
|
|
175
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
176
|
+
return jsxs("svg", _objectSpread$3(_objectSpread$3({
|
|
261
177
|
width: "100%",
|
|
262
178
|
height: "100%",
|
|
263
179
|
fill: "none",
|
|
264
180
|
xmlns: "http://www.w3.org/2000/svg",
|
|
265
181
|
"aria-labelledby": titleId
|
|
266
|
-
}, props, {
|
|
267
|
-
children: [title ? jsx("title",
|
|
268
|
-
id: titleId
|
|
269
|
-
}, {
|
|
182
|
+
}, props), {}, {
|
|
183
|
+
children: [title ? jsx("title", {
|
|
184
|
+
id: titleId,
|
|
270
185
|
children: title
|
|
271
|
-
})
|
|
186
|
+
}) : null, jsx("path", {
|
|
272
187
|
d: "M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41Z",
|
|
273
188
|
fill: "currentColor"
|
|
274
189
|
})]
|
|
275
190
|
}));
|
|
276
191
|
};
|
|
277
192
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
193
|
+
var _excluded$2 = ["title", "titleId"];
|
|
194
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
195
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
196
|
+
var IconArrowLeftDouble = function IconArrowLeftDouble(_ref) {
|
|
197
|
+
var title = _ref.title,
|
|
198
|
+
titleId = _ref.titleId,
|
|
199
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
200
|
+
return jsxs("svg", _objectSpread$2(_objectSpread$2({
|
|
285
201
|
width: "100%",
|
|
286
202
|
height: "100%",
|
|
287
203
|
fill: "none",
|
|
288
204
|
xmlns: "http://www.w3.org/2000/svg",
|
|
289
205
|
"aria-labelledby": titleId
|
|
290
|
-
}, props, {
|
|
291
|
-
children: [title ? jsx("title",
|
|
292
|
-
id: titleId
|
|
293
|
-
}, {
|
|
206
|
+
}, props), {}, {
|
|
207
|
+
children: [title ? jsx("title", {
|
|
208
|
+
id: titleId,
|
|
294
209
|
children: title
|
|
295
|
-
})
|
|
210
|
+
}) : null, jsx("path", {
|
|
296
211
|
d: "M17.59 18 19 16.59 14.42 12 19 7.41 17.59 6l-6 6 6 6Z",
|
|
297
212
|
fill: "currentColor"
|
|
298
213
|
}), jsx("path", {
|
|
@@ -302,48 +217,48 @@ const IconArrowLeftDouble = _a => {
|
|
|
302
217
|
}));
|
|
303
218
|
};
|
|
304
219
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
220
|
+
var _excluded$1 = ["title", "titleId"];
|
|
221
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
222
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
223
|
+
var IconArrowRight = function IconArrowRight(_ref) {
|
|
224
|
+
var title = _ref.title,
|
|
225
|
+
titleId = _ref.titleId,
|
|
226
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
227
|
+
return jsxs("svg", _objectSpread$1(_objectSpread$1({
|
|
312
228
|
width: "100%",
|
|
313
229
|
height: "100%",
|
|
314
230
|
fill: "none",
|
|
315
231
|
xmlns: "http://www.w3.org/2000/svg",
|
|
316
232
|
"aria-labelledby": titleId
|
|
317
|
-
}, props, {
|
|
318
|
-
children: [title ? jsx("title",
|
|
319
|
-
id: titleId
|
|
320
|
-
}, {
|
|
233
|
+
}, props), {}, {
|
|
234
|
+
children: [title ? jsx("title", {
|
|
235
|
+
id: titleId,
|
|
321
236
|
children: title
|
|
322
|
-
})
|
|
237
|
+
}) : null, jsx("path", {
|
|
323
238
|
d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41Z",
|
|
324
239
|
fill: "currentColor"
|
|
325
240
|
})]
|
|
326
241
|
}));
|
|
327
242
|
};
|
|
328
243
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
244
|
+
var _excluded = ["title", "titleId"];
|
|
245
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
246
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
247
|
+
var IconArrowRightDouble = function IconArrowRightDouble(_ref) {
|
|
248
|
+
var title = _ref.title,
|
|
249
|
+
titleId = _ref.titleId,
|
|
250
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
251
|
+
return jsxs("svg", _objectSpread(_objectSpread({
|
|
336
252
|
fill: "none",
|
|
337
253
|
width: "100%",
|
|
338
254
|
height: "100%",
|
|
339
255
|
xmlns: "http://www.w3.org/2000/svg",
|
|
340
256
|
"aria-labelledby": titleId
|
|
341
|
-
}, props, {
|
|
342
|
-
children: [title ? jsx("title",
|
|
343
|
-
id: titleId
|
|
344
|
-
}, {
|
|
257
|
+
}, props), {}, {
|
|
258
|
+
children: [title ? jsx("title", {
|
|
259
|
+
id: titleId,
|
|
345
260
|
children: title
|
|
346
|
-
})
|
|
261
|
+
}) : null, jsx("path", {
|
|
347
262
|
d: "M6.41 6 5 7.41 9.58 12 5 16.59 6.41 18l6-6-6-6Z",
|
|
348
263
|
fill: "currentColor"
|
|
349
264
|
}), jsx("path", {
|
|
@@ -354,137 +269,159 @@ const IconArrowRightDouble = _a => {
|
|
|
354
269
|
};
|
|
355
270
|
|
|
356
271
|
function createCalendar(today) {
|
|
357
|
-
|
|
272
|
+
var start = startOfWeek(startOfMonth(today), {
|
|
358
273
|
weekStartsOn: 1 /* Monday */
|
|
359
274
|
});
|
|
360
|
-
|
|
275
|
+
var end = endOfWeek(addWeeks(start, 5), {
|
|
361
276
|
weekStartsOn: 1 /* Monday */
|
|
362
277
|
});
|
|
363
278
|
return eachDayOfInterval({
|
|
364
|
-
start,
|
|
365
|
-
end
|
|
279
|
+
start: start,
|
|
280
|
+
end: end
|
|
366
281
|
});
|
|
367
282
|
}
|
|
368
|
-
/**
|
|
369
|
-
* Calendar Component
|
|
370
|
-
* powered by date-fns, so that make it easy to use the `date-fns` date functions & locale
|
|
283
|
+
/**
|
|
284
|
+
* Calendar Component
|
|
285
|
+
* powered by date-fns, so that make it easy to use the `date-fns` date functions & locale
|
|
371
286
|
* */
|
|
372
|
-
|
|
373
|
-
onCalendarClick,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
287
|
+
var Calendar = function Calendar(_ref) {
|
|
288
|
+
var onCalendarClick = _ref.onCalendarClick,
|
|
289
|
+
events = _ref.events,
|
|
290
|
+
currentDate = _ref.currentDate,
|
|
291
|
+
_ref$locale = _ref.locale,
|
|
292
|
+
locale = _ref$locale === void 0 ? enUS : _ref$locale,
|
|
293
|
+
_ref$previousYearButt = _ref.previousYearButtonTitle,
|
|
294
|
+
previousYearButtonTitle = _ref$previousYearButt === void 0 ? 'Previous year' : _ref$previousYearButt,
|
|
295
|
+
_ref$nextYearButtonTi = _ref.nextYearButtonTitle,
|
|
296
|
+
nextYearButtonTitle = _ref$nextYearButtonTi === void 0 ? 'Next year' : _ref$nextYearButtonTi,
|
|
297
|
+
_ref$previousMonthBut = _ref.previousMonthButtonTitle,
|
|
298
|
+
previousMonthButtonTitle = _ref$previousMonthBut === void 0 ? 'Previous month' : _ref$previousMonthBut,
|
|
299
|
+
_ref$nextMonthButtonT = _ref.nextMonthButtonTitle,
|
|
300
|
+
nextMonthButtonTitle = _ref$nextMonthButtonT === void 0 ? 'Next month' : _ref$nextMonthButtonT,
|
|
301
|
+
minDate = _ref.minDate,
|
|
302
|
+
maxDate = _ref.maxDate;
|
|
303
|
+
var _useState = useState(currentDate || new Date()),
|
|
304
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
305
|
+
visibleMonth = _useState2[0],
|
|
306
|
+
setVisibleMonth = _useState2[1];
|
|
307
|
+
var _useState3 = useState(currentDate),
|
|
308
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
309
|
+
selectedDate = _useState4[0],
|
|
310
|
+
setSelectedDate = _useState4[1];
|
|
311
|
+
var calendar = createCalendar(visibleMonth);
|
|
312
|
+
var start = startOfWeek(visibleMonth, {
|
|
388
313
|
weekStartsOn: 1
|
|
389
314
|
});
|
|
390
|
-
|
|
315
|
+
var end = endOfWeek(visibleMonth, {
|
|
391
316
|
weekStartsOn: 1
|
|
392
317
|
});
|
|
393
|
-
|
|
394
|
-
start,
|
|
395
|
-
end
|
|
396
|
-
}).map(
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
318
|
+
var currentWeek = eachDayOfInterval({
|
|
319
|
+
start: start,
|
|
320
|
+
end: end
|
|
321
|
+
}).map(function (day) {
|
|
322
|
+
return day;
|
|
323
|
+
});
|
|
324
|
+
var chunksWeeks = chunk(calendar, calendar.length / 6);
|
|
325
|
+
var weeks = chunksWeeks.map(function (week) {
|
|
326
|
+
return week.map(function (date) {
|
|
327
|
+
var currentEvent = events && events.length > 0 && events.find(function (e) {
|
|
328
|
+
return isSameDay(endOfDay(parseISO(e.date)), date);
|
|
329
|
+
});
|
|
330
|
+
if (currentEvent) {
|
|
331
|
+
return {
|
|
332
|
+
date: date,
|
|
333
|
+
emphasis: currentEvent.emphasis,
|
|
334
|
+
selected: currentEvent.selected,
|
|
335
|
+
disabled: currentEvent.disabled
|
|
336
|
+
};
|
|
337
|
+
} else {
|
|
338
|
+
return {
|
|
339
|
+
date: date,
|
|
340
|
+
emphasis: false,
|
|
341
|
+
selected: false,
|
|
342
|
+
disabled: false
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
return jsxs("div", {
|
|
348
|
+
className: "utrecht-calendar",
|
|
419
349
|
children: [jsx(CalendarNavigation, {
|
|
420
|
-
children: jsx(CalendarNavigationButtons,
|
|
350
|
+
children: jsx(CalendarNavigationButtons, {
|
|
421
351
|
previousIcon: jsx(IconArrowLeftDouble, {
|
|
422
352
|
title: previousYearButtonTitle
|
|
423
353
|
}),
|
|
424
354
|
nextIcon: jsx(IconArrowRightDouble, {
|
|
425
355
|
title: nextYearButtonTitle
|
|
426
356
|
}),
|
|
427
|
-
onPreviousClick:
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
357
|
+
onPreviousClick: function onPreviousClick() {
|
|
358
|
+
return setVisibleMonth(setYear(visibleMonth, getYear(visibleMonth) - 1));
|
|
359
|
+
},
|
|
360
|
+
onNextClick: function onNextClick() {
|
|
361
|
+
return setVisibleMonth(addYears(visibleMonth, 1));
|
|
362
|
+
},
|
|
363
|
+
children: jsx(CalendarNavigationButtons, {
|
|
431
364
|
previousIcon: jsx(IconArrowLeft, {
|
|
432
365
|
title: previousMonthButtonTitle
|
|
433
366
|
}),
|
|
434
367
|
nextIcon: jsx(IconArrowRight, {
|
|
435
368
|
title: nextMonthButtonTitle
|
|
436
369
|
}),
|
|
437
|
-
onPreviousClick:
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
},
|
|
370
|
+
onPreviousClick: function onPreviousClick() {
|
|
371
|
+
return setVisibleMonth(setMonth(visibleMonth, visibleMonth.getMonth() - 1));
|
|
372
|
+
},
|
|
373
|
+
onNextClick: function onNextClick() {
|
|
374
|
+
return setVisibleMonth(addMonths(visibleMonth, 1));
|
|
375
|
+
},
|
|
376
|
+
children: jsx(CalendarNavigationLabel, {
|
|
377
|
+
dateTime: format(visibleMonth, 'yyyy-mm'),
|
|
443
378
|
children: format(visibleMonth, 'LLLL Y', {
|
|
444
|
-
locale
|
|
379
|
+
locale: locale
|
|
445
380
|
})
|
|
446
|
-
})
|
|
447
|
-
})
|
|
448
|
-
})
|
|
449
|
-
}), jsxs("table",
|
|
381
|
+
})
|
|
382
|
+
})
|
|
383
|
+
})
|
|
384
|
+
}), jsxs("table", {
|
|
450
385
|
className: "utrecht-calendar__table",
|
|
451
|
-
role: "grid"
|
|
452
|
-
}, {
|
|
386
|
+
role: "grid",
|
|
453
387
|
children: [jsx(CalendarTableWeeksContainer, {
|
|
454
|
-
children: currentWeek && currentWeek.length > 0 && currentWeek.map((day, index)
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
388
|
+
children: currentWeek && currentWeek.length > 0 && currentWeek.map(function (day, index) {
|
|
389
|
+
return jsx(CalendarTableWeeksItem, {
|
|
390
|
+
scope: "col",
|
|
391
|
+
abbr: format(day, 'EEEE', {
|
|
392
|
+
locale: locale
|
|
393
|
+
}),
|
|
394
|
+
children: format(day, 'EEEEEE', {
|
|
395
|
+
locale: locale
|
|
396
|
+
})
|
|
397
|
+
}, index);
|
|
398
|
+
})
|
|
464
399
|
}), jsx(CalendarTableDaysContainer, {
|
|
465
|
-
children: weeks && weeks.length > 0 && weeks.map((week, index)
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
400
|
+
children: weeks && weeks.length > 0 && weeks.map(function (week, index) {
|
|
401
|
+
return jsx(CalendarTableDaysItem, {
|
|
402
|
+
children: week.map(function (day, index) {
|
|
403
|
+
return jsx(CalendarTableDaysItemDay, {
|
|
404
|
+
isToday: isSameDay(day.date, Date.now()),
|
|
405
|
+
dayOutOfTheMonth: !isSameMonth(day.date, visibleMonth),
|
|
406
|
+
onClick: function onClick() {
|
|
407
|
+
setVisibleMonth(day.date);
|
|
408
|
+
setSelectedDate(day.date);
|
|
409
|
+
onCalendarClick(formatISO(day.date));
|
|
410
|
+
},
|
|
411
|
+
"aria-label": format(day.date, 'eeee dd LLLL Y', {
|
|
412
|
+
locale: locale
|
|
413
|
+
}),
|
|
414
|
+
day: day.date.getDate().toString(),
|
|
415
|
+
emphasis: day.emphasis,
|
|
416
|
+
selected: day.selected || selectedDate && isSameDay(day.date, selectedDate),
|
|
417
|
+
disabled: day.disabled || minDate && isBefore(day.date, startOfDay(minDate)) || maxDate && isAfter(day.date, endOfDay(maxDate))
|
|
418
|
+
}, index);
|
|
419
|
+
})
|
|
420
|
+
}, index);
|
|
421
|
+
})
|
|
485
422
|
})]
|
|
486
|
-
})
|
|
487
|
-
})
|
|
423
|
+
})]
|
|
424
|
+
});
|
|
488
425
|
};
|
|
489
426
|
|
|
490
427
|
export { Calendar };
|