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