react-asc 25.12.1 → 25.13.0
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/index.d.ts +1 -1
- package/index.es.js +805 -874
- package/index.js +804 -873
- package/package.json +8 -8
- package/vite.config.d.ts +1 -1
package/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
-
import React, { useEffect, useRef, useState, useMemo, createContext, useContext,
|
|
2
|
+
import React, { useEffect, useRef, useState, useMemo, createContext, useContext, forwardRef, useCallback, useImperativeHandle, Fragment as Fragment$2, Component, createRef, cloneElement } from 'react';
|
|
3
3
|
import reactDom, { createPortal } from 'react-dom';
|
|
4
4
|
import { createPopper } from '@popperjs/core';
|
|
5
5
|
import saveAs from 'file-saver';
|
|
@@ -960,51 +960,69 @@ const CssTransition = (props) => {
|
|
|
960
960
|
jsx("div", { ref: transitionConainter, className: getCssClasses(), children: children }) }));
|
|
961
961
|
};
|
|
962
962
|
|
|
963
|
-
/**
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
963
|
+
/**
|
|
964
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
967
965
|
*
|
|
968
966
|
* This source code is licensed under the MIT license found in the
|
|
969
967
|
* LICENSE file in the root directory of this source tree.
|
|
970
968
|
*/
|
|
971
969
|
|
|
972
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
973
|
-
Symbol.for("react.suspense_list"):60120,r$1=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
974
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r$1:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r$1;var Portal=d;
|
|
975
|
-
var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
|
|
976
|
-
var isMemo=function(a){return z(a)===r$1};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
|
|
977
|
-
var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r$1||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
|
|
978
970
|
|
|
979
|
-
var
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
971
|
+
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
972
|
+
|
|
973
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
974
|
+
|
|
975
|
+
function emptyFunction() {}
|
|
976
|
+
function emptyFunctionWithReset() {}
|
|
977
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
978
|
+
|
|
979
|
+
var factoryWithThrowingShims = function() {
|
|
980
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
981
|
+
if (secret === ReactPropTypesSecret_1) {
|
|
982
|
+
// It is still safe when called from React.
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
var err = new Error(
|
|
986
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
987
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
988
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
989
|
+
);
|
|
990
|
+
err.name = 'Invariant Violation';
|
|
991
|
+
throw err;
|
|
992
|
+
} shim.isRequired = shim;
|
|
993
|
+
function getShim() {
|
|
994
|
+
return shim;
|
|
995
|
+
} // Important!
|
|
996
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
997
|
+
var ReactPropTypes = {
|
|
998
|
+
array: shim,
|
|
999
|
+
bigint: shim,
|
|
1000
|
+
bool: shim,
|
|
1001
|
+
func: shim,
|
|
1002
|
+
number: shim,
|
|
1003
|
+
object: shim,
|
|
1004
|
+
string: shim,
|
|
1005
|
+
symbol: shim,
|
|
1006
|
+
|
|
1007
|
+
any: shim,
|
|
1008
|
+
arrayOf: getShim,
|
|
1009
|
+
element: shim,
|
|
1010
|
+
elementType: shim,
|
|
1011
|
+
instanceOf: getShim,
|
|
1012
|
+
node: shim,
|
|
1013
|
+
objectOf: getShim,
|
|
1014
|
+
oneOf: getShim,
|
|
1015
|
+
oneOfType: getShim,
|
|
1016
|
+
shape: getShim,
|
|
1017
|
+
exact: getShim,
|
|
1018
|
+
|
|
1019
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
1020
|
+
resetWarningCache: emptyFunction
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1024
|
+
|
|
1025
|
+
return ReactPropTypes;
|
|
1008
1026
|
};
|
|
1009
1027
|
|
|
1010
1028
|
var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
@@ -1208,6 +1226,53 @@ reactIs_development.isSuspense;
|
|
|
1208
1226
|
reactIs_development.isValidElementType;
|
|
1209
1227
|
reactIs_development.typeOf;
|
|
1210
1228
|
|
|
1229
|
+
/** @license React v16.13.1
|
|
1230
|
+
* react-is.production.min.js
|
|
1231
|
+
*
|
|
1232
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1233
|
+
*
|
|
1234
|
+
* This source code is licensed under the MIT license found in the
|
|
1235
|
+
* LICENSE file in the root directory of this source tree.
|
|
1236
|
+
*/
|
|
1237
|
+
|
|
1238
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
1239
|
+
Symbol.for("react.suspense_list"):60120,r$1=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
1240
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r$1:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r$1;var Portal=d;
|
|
1241
|
+
var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
|
|
1242
|
+
var isMemo=function(a){return z(a)===r$1};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
|
|
1243
|
+
var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r$1||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
|
|
1244
|
+
|
|
1245
|
+
var reactIs_production_min = {
|
|
1246
|
+
AsyncMode: AsyncMode,
|
|
1247
|
+
ConcurrentMode: ConcurrentMode,
|
|
1248
|
+
ContextConsumer: ContextConsumer,
|
|
1249
|
+
ContextProvider: ContextProvider,
|
|
1250
|
+
Element: Element,
|
|
1251
|
+
ForwardRef: ForwardRef,
|
|
1252
|
+
Fragment: Fragment,
|
|
1253
|
+
Lazy: Lazy,
|
|
1254
|
+
Memo: Memo,
|
|
1255
|
+
Portal: Portal,
|
|
1256
|
+
Profiler: Profiler,
|
|
1257
|
+
StrictMode: StrictMode,
|
|
1258
|
+
Suspense: Suspense,
|
|
1259
|
+
isAsyncMode: isAsyncMode,
|
|
1260
|
+
isConcurrentMode: isConcurrentMode,
|
|
1261
|
+
isContextConsumer: isContextConsumer,
|
|
1262
|
+
isContextProvider: isContextProvider,
|
|
1263
|
+
isElement: isElement,
|
|
1264
|
+
isForwardRef: isForwardRef,
|
|
1265
|
+
isFragment: isFragment,
|
|
1266
|
+
isLazy: isLazy,
|
|
1267
|
+
isMemo: isMemo,
|
|
1268
|
+
isPortal: isPortal,
|
|
1269
|
+
isProfiler: isProfiler,
|
|
1270
|
+
isStrictMode: isStrictMode,
|
|
1271
|
+
isSuspense: isSuspense,
|
|
1272
|
+
isValidElementType: isValidElementType,
|
|
1273
|
+
typeOf: typeOf
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1211
1276
|
var reactIs = createCommonjsModule(function (module) {
|
|
1212
1277
|
|
|
1213
1278
|
if (process.env.NODE_ENV === 'production') {
|
|
@@ -1307,18 +1372,6 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
|
|
|
1307
1372
|
return to;
|
|
1308
1373
|
};
|
|
1309
1374
|
|
|
1310
|
-
/**
|
|
1311
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1312
|
-
*
|
|
1313
|
-
* This source code is licensed under the MIT license found in the
|
|
1314
|
-
* LICENSE file in the root directory of this source tree.
|
|
1315
|
-
*/
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
1319
|
-
|
|
1320
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
1321
|
-
|
|
1322
1375
|
var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1323
1376
|
|
|
1324
1377
|
var printWarning$1 = function() {};
|
|
@@ -2011,59 +2064,6 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2011
2064
|
return ReactPropTypes;
|
|
2012
2065
|
};
|
|
2013
2066
|
|
|
2014
|
-
function emptyFunction() {}
|
|
2015
|
-
function emptyFunctionWithReset() {}
|
|
2016
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
2017
|
-
|
|
2018
|
-
var factoryWithThrowingShims = function() {
|
|
2019
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
2020
|
-
if (secret === ReactPropTypesSecret_1) {
|
|
2021
|
-
// It is still safe when called from React.
|
|
2022
|
-
return;
|
|
2023
|
-
}
|
|
2024
|
-
var err = new Error(
|
|
2025
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
2026
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
2027
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
2028
|
-
);
|
|
2029
|
-
err.name = 'Invariant Violation';
|
|
2030
|
-
throw err;
|
|
2031
|
-
} shim.isRequired = shim;
|
|
2032
|
-
function getShim() {
|
|
2033
|
-
return shim;
|
|
2034
|
-
} // Important!
|
|
2035
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
2036
|
-
var ReactPropTypes = {
|
|
2037
|
-
array: shim,
|
|
2038
|
-
bigint: shim,
|
|
2039
|
-
bool: shim,
|
|
2040
|
-
func: shim,
|
|
2041
|
-
number: shim,
|
|
2042
|
-
object: shim,
|
|
2043
|
-
string: shim,
|
|
2044
|
-
symbol: shim,
|
|
2045
|
-
|
|
2046
|
-
any: shim,
|
|
2047
|
-
arrayOf: getShim,
|
|
2048
|
-
element: shim,
|
|
2049
|
-
elementType: shim,
|
|
2050
|
-
instanceOf: getShim,
|
|
2051
|
-
node: shim,
|
|
2052
|
-
objectOf: getShim,
|
|
2053
|
-
oneOf: getShim,
|
|
2054
|
-
oneOfType: getShim,
|
|
2055
|
-
shape: getShim,
|
|
2056
|
-
exact: getShim,
|
|
2057
|
-
|
|
2058
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
2059
|
-
resetWarningCache: emptyFunction
|
|
2060
|
-
};
|
|
2061
|
-
|
|
2062
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
2063
|
-
|
|
2064
|
-
return ReactPropTypes;
|
|
2065
|
-
};
|
|
2066
|
-
|
|
2067
2067
|
var propTypes = createCommonjsModule(function (module) {
|
|
2068
2068
|
/**
|
|
2069
2069
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -2772,29 +2772,60 @@ var memoize$1 = lodash_memoize;
|
|
|
2772
2772
|
function resolver(options) {
|
|
2773
2773
|
return JSON.stringify(options);
|
|
2774
2774
|
}
|
|
2775
|
-
function
|
|
2776
|
-
return
|
|
2775
|
+
function isString(el) {
|
|
2776
|
+
return typeof el === 'string';
|
|
2777
|
+
}
|
|
2778
|
+
function isUnique(el, index, arr) {
|
|
2779
|
+
return arr.indexOf(el) === index;
|
|
2777
2780
|
}
|
|
2778
2781
|
function isAllLowerCase(el) {
|
|
2779
2782
|
return el.toLowerCase() === el;
|
|
2780
2783
|
}
|
|
2781
|
-
function
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
+
function fixCommas(el) {
|
|
2785
|
+
return el.indexOf(',') === -1 ? el : el.split(',');
|
|
2786
|
+
}
|
|
2787
|
+
function normalizeLocale(locale) {
|
|
2788
|
+
if (!locale) {
|
|
2789
|
+
return locale;
|
|
2790
|
+
}
|
|
2791
|
+
if (locale === 'C' || locale === 'posix' || locale === 'POSIX') {
|
|
2792
|
+
return 'en-US';
|
|
2793
|
+
}
|
|
2794
|
+
// If there's a dot (.) in the locale, it's likely in the format of "en-US.UTF-8", so we only take the first part
|
|
2795
|
+
if (locale.indexOf('.') !== -1) {
|
|
2796
|
+
var _a = locale.split('.')[0], actualLocale = _a === void 0 ? '' : _a;
|
|
2797
|
+
return normalizeLocale(actualLocale);
|
|
2784
2798
|
}
|
|
2785
|
-
|
|
2799
|
+
// If there's an at sign (@) in the locale, it's likely in the format of "en-US@posix", so we only take the first part
|
|
2800
|
+
if (locale.indexOf('@') !== -1) {
|
|
2801
|
+
var _b = locale.split('@')[0], actualLocale = _b === void 0 ? '' : _b;
|
|
2802
|
+
return normalizeLocale(actualLocale);
|
|
2803
|
+
}
|
|
2804
|
+
// If there's a dash (-) in the locale and it's not all lower case, it's already in the format of "en-US", so we return it
|
|
2805
|
+
if (locale.indexOf('-') === -1 || !isAllLowerCase(locale)) {
|
|
2806
|
+
return locale;
|
|
2807
|
+
}
|
|
2808
|
+
var _c = locale.split('-'), splitEl1 = _c[0], _d = _c[1], splitEl2 = _d === void 0 ? '' : _d;
|
|
2786
2809
|
return "".concat(splitEl1, "-").concat(splitEl2.toUpperCase());
|
|
2787
2810
|
}
|
|
2788
2811
|
function getUserLocalesInternal(_a) {
|
|
2789
2812
|
var _b = _a === void 0 ? {} : _a, _c = _b.useFallbackLocale, useFallbackLocale = _c === void 0 ? true : _c, _d = _b.fallbackLocale, fallbackLocale = _d === void 0 ? 'en-US' : _d;
|
|
2790
2813
|
var languageList = [];
|
|
2791
2814
|
if (typeof navigator !== 'undefined') {
|
|
2792
|
-
|
|
2815
|
+
var rawLanguages = navigator.languages || [];
|
|
2816
|
+
var languages = [];
|
|
2817
|
+
for (var _i = 0, rawLanguages_1 = rawLanguages; _i < rawLanguages_1.length; _i++) {
|
|
2818
|
+
var rawLanguagesItem = rawLanguages_1[_i];
|
|
2819
|
+
languages = languages.concat(fixCommas(rawLanguagesItem));
|
|
2820
|
+
}
|
|
2821
|
+
var rawLanguage = navigator.language;
|
|
2822
|
+
var language = rawLanguage ? fixCommas(rawLanguage) : rawLanguage;
|
|
2823
|
+
languageList = languageList.concat(languages, language);
|
|
2793
2824
|
}
|
|
2794
2825
|
if (useFallbackLocale) {
|
|
2795
2826
|
languageList.push(fallbackLocale);
|
|
2796
2827
|
}
|
|
2797
|
-
return
|
|
2828
|
+
return languageList.filter(isString).map(normalizeLocale).filter(isUnique);
|
|
2798
2829
|
}
|
|
2799
2830
|
var getUserLocales = memoize$1(getUserLocalesInternal, resolver);
|
|
2800
2831
|
function getUserLocaleInternal(options) {
|
|
@@ -3150,15 +3181,21 @@ function getDaysInMonth(date) {
|
|
|
3150
3181
|
return getDate(getMonthEnd(date));
|
|
3151
3182
|
}
|
|
3152
3183
|
|
|
3153
|
-
var _a;
|
|
3184
|
+
var _a$1;
|
|
3154
3185
|
var CALENDAR_TYPES = {
|
|
3186
|
+
GREGORY: 'gregory',
|
|
3187
|
+
HEBREW: 'hebrew',
|
|
3188
|
+
ISLAMIC: 'islamic',
|
|
3189
|
+
ISO_8601: 'iso8601',
|
|
3190
|
+
};
|
|
3191
|
+
var DEPRECATED_CALENDAR_TYPES = {
|
|
3155
3192
|
ARABIC: 'Arabic',
|
|
3156
3193
|
HEBREW: 'Hebrew',
|
|
3157
3194
|
ISO_8601: 'ISO 8601',
|
|
3158
3195
|
US: 'US',
|
|
3159
3196
|
};
|
|
3160
|
-
var CALENDAR_TYPE_LOCALES = (_a = {},
|
|
3161
|
-
_a[CALENDAR_TYPES.
|
|
3197
|
+
var CALENDAR_TYPE_LOCALES = (_a$1 = {},
|
|
3198
|
+
_a$1[CALENDAR_TYPES.GREGORY] = [
|
|
3162
3199
|
'en-CA',
|
|
3163
3200
|
'en-US',
|
|
3164
3201
|
'es-AR',
|
|
@@ -3179,7 +3216,8 @@ var CALENDAR_TYPE_LOCALES = (_a = {},
|
|
|
3179
3216
|
'es-VE',
|
|
3180
3217
|
'pt-BR',
|
|
3181
3218
|
],
|
|
3182
|
-
_a[CALENDAR_TYPES.
|
|
3219
|
+
_a$1[CALENDAR_TYPES.HEBREW] = ['he', 'he-IL'],
|
|
3220
|
+
_a$1[CALENDAR_TYPES.ISLAMIC] = [
|
|
3183
3221
|
// ar-LB, ar-MA intentionally missing
|
|
3184
3222
|
'ar',
|
|
3185
3223
|
'ar-AE',
|
|
@@ -3201,8 +3239,7 @@ var CALENDAR_TYPE_LOCALES = (_a = {},
|
|
|
3201
3239
|
'ps',
|
|
3202
3240
|
'ps-AR',
|
|
3203
3241
|
],
|
|
3204
|
-
_a
|
|
3205
|
-
_a);
|
|
3242
|
+
_a$1);
|
|
3206
3243
|
var WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
|
|
3207
3244
|
|
|
3208
3245
|
var formatterCache = new Map();
|
|
@@ -3265,7 +3302,7 @@ var SATURDAY = WEEKDAYS[6];
|
|
|
3265
3302
|
/**
|
|
3266
3303
|
* Gets day of the week of a given date.
|
|
3267
3304
|
* @param {Date} date Date.
|
|
3268
|
-
* @param {CalendarType} [calendarType="
|
|
3305
|
+
* @param {CalendarType} [calendarType="iso8601"] Calendar type.
|
|
3269
3306
|
* @returns {number} Day of the week.
|
|
3270
3307
|
*/
|
|
3271
3308
|
function getDayOfWeek(date, calendarType) {
|
|
@@ -3275,10 +3312,10 @@ function getDayOfWeek(date, calendarType) {
|
|
|
3275
3312
|
case CALENDAR_TYPES.ISO_8601:
|
|
3276
3313
|
// Shifts days of the week so that Monday is 0, Sunday is 6
|
|
3277
3314
|
return (weekday + 6) % 7;
|
|
3278
|
-
case CALENDAR_TYPES.
|
|
3315
|
+
case CALENDAR_TYPES.ISLAMIC:
|
|
3279
3316
|
return (weekday + 1) % 7;
|
|
3280
3317
|
case CALENDAR_TYPES.HEBREW:
|
|
3281
|
-
case CALENDAR_TYPES.
|
|
3318
|
+
case CALENDAR_TYPES.GREGORY:
|
|
3282
3319
|
return weekday;
|
|
3283
3320
|
default:
|
|
3284
3321
|
throw new Error('Unsupported calendar type.');
|
|
@@ -3315,7 +3352,7 @@ function getBeginOfDecadeYear(date) {
|
|
|
3315
3352
|
* Returns the beginning of a given week.
|
|
3316
3353
|
*
|
|
3317
3354
|
* @param {Date} date Date.
|
|
3318
|
-
* @param {CalendarType} [calendarType="
|
|
3355
|
+
* @param {CalendarType} [calendarType="iso8601"] Calendar type.
|
|
3319
3356
|
* @returns {Date} Beginning of a given week.
|
|
3320
3357
|
*/
|
|
3321
3358
|
function getBeginOfWeek(date, calendarType) {
|
|
@@ -3331,12 +3368,12 @@ function getBeginOfWeek(date, calendarType) {
|
|
|
3331
3368
|
* In US calendar week 1 is the one with January 1.
|
|
3332
3369
|
*
|
|
3333
3370
|
* @param {Date} date Date.
|
|
3334
|
-
* @param {CalendarType} [calendarType="
|
|
3371
|
+
* @param {CalendarType} [calendarType="iso8601"] Calendar type.
|
|
3335
3372
|
* @returns {number} Week number.
|
|
3336
3373
|
*/
|
|
3337
3374
|
function getWeekNumber(date, calendarType) {
|
|
3338
3375
|
if (calendarType === void 0) { calendarType = CALENDAR_TYPES.ISO_8601; }
|
|
3339
|
-
var calendarTypeForWeekNumber = calendarType === CALENDAR_TYPES.
|
|
3376
|
+
var calendarTypeForWeekNumber = calendarType === CALENDAR_TYPES.GREGORY ? CALENDAR_TYPES.GREGORY : CALENDAR_TYPES.ISO_8601;
|
|
3340
3377
|
var beginOfWeek = getBeginOfWeek(date, calendarType);
|
|
3341
3378
|
var year = getYear(date) + 1;
|
|
3342
3379
|
var dayInWeekOne;
|
|
@@ -3579,117 +3616,24 @@ function isCurrentDayOfWeek(date) {
|
|
|
3579
3616
|
* Returns a boolean determining whether a given date is a weekend day.
|
|
3580
3617
|
*
|
|
3581
3618
|
* @param {Date} date Date.
|
|
3582
|
-
* @param {CalendarType} [calendarType="
|
|
3619
|
+
* @param {CalendarType} [calendarType="iso8601"] Calendar type.
|
|
3583
3620
|
* @returns {boolean} Whether a given date is a weekend day.
|
|
3584
3621
|
*/
|
|
3585
3622
|
function isWeekend(date, calendarType) {
|
|
3586
3623
|
if (calendarType === void 0) { calendarType = CALENDAR_TYPES.ISO_8601; }
|
|
3587
3624
|
var weekday = date.getDay();
|
|
3588
3625
|
switch (calendarType) {
|
|
3589
|
-
case CALENDAR_TYPES.
|
|
3626
|
+
case CALENDAR_TYPES.ISLAMIC:
|
|
3590
3627
|
case CALENDAR_TYPES.HEBREW:
|
|
3591
3628
|
return weekday === FRIDAY || weekday === SATURDAY;
|
|
3592
3629
|
case CALENDAR_TYPES.ISO_8601:
|
|
3593
|
-
case CALENDAR_TYPES.
|
|
3630
|
+
case CALENDAR_TYPES.GREGORY:
|
|
3594
3631
|
return weekday === SATURDAY || weekday === SUNDAY;
|
|
3595
3632
|
default:
|
|
3596
3633
|
throw new Error('Unsupported calendar type.');
|
|
3597
3634
|
}
|
|
3598
3635
|
}
|
|
3599
3636
|
|
|
3600
|
-
var calendarTypes = Object.values(CALENDAR_TYPES);
|
|
3601
|
-
var allViews$1 = ['century', 'decade', 'year', 'month'];
|
|
3602
|
-
var isCalendarType = PropTypes.oneOf(calendarTypes);
|
|
3603
|
-
var isClassName = PropTypes.oneOfType([
|
|
3604
|
-
PropTypes.string,
|
|
3605
|
-
PropTypes.arrayOf(PropTypes.string),
|
|
3606
|
-
]);
|
|
3607
|
-
function isMinDate(props, propName, componentName) {
|
|
3608
|
-
var _a = props, _b = propName, minDate = _a[_b];
|
|
3609
|
-
if (!minDate) {
|
|
3610
|
-
return null;
|
|
3611
|
-
}
|
|
3612
|
-
if (!(minDate instanceof Date)) {
|
|
3613
|
-
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof minDate, "` supplied to `").concat(componentName, "`, expected instance of `Date`."));
|
|
3614
|
-
}
|
|
3615
|
-
var maxDate = props.maxDate;
|
|
3616
|
-
if (maxDate && minDate > maxDate) {
|
|
3617
|
-
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof minDate, "` supplied to `").concat(componentName, "`, minDate cannot be larger than maxDate."));
|
|
3618
|
-
}
|
|
3619
|
-
return null;
|
|
3620
|
-
}
|
|
3621
|
-
function isMaxDate(props, propName, componentName) {
|
|
3622
|
-
var _a = props, _b = propName, maxDate = _a[_b];
|
|
3623
|
-
if (!maxDate) {
|
|
3624
|
-
return null;
|
|
3625
|
-
}
|
|
3626
|
-
if (!(maxDate instanceof Date)) {
|
|
3627
|
-
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof maxDate, "` supplied to `").concat(componentName, "`, expected instance of `Date`."));
|
|
3628
|
-
}
|
|
3629
|
-
var minDate = props.minDate;
|
|
3630
|
-
if (minDate && maxDate < minDate) {
|
|
3631
|
-
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof maxDate, "` supplied to `").concat(componentName, "`, maxDate cannot be smaller than minDate."));
|
|
3632
|
-
}
|
|
3633
|
-
return null;
|
|
3634
|
-
}
|
|
3635
|
-
var isRef = PropTypes.oneOfType([
|
|
3636
|
-
PropTypes.func,
|
|
3637
|
-
PropTypes.shape({
|
|
3638
|
-
current: PropTypes.any,
|
|
3639
|
-
}),
|
|
3640
|
-
]);
|
|
3641
|
-
var isValue$1 = PropTypes.oneOfType([
|
|
3642
|
-
PropTypes.instanceOf(Date),
|
|
3643
|
-
PropTypes.arrayOf(PropTypes.instanceOf(Date)),
|
|
3644
|
-
]);
|
|
3645
|
-
var isViews = PropTypes.arrayOf(PropTypes.oneOf(allViews$1));
|
|
3646
|
-
function isView(props, propName, componentName) {
|
|
3647
|
-
var _a = props, _b = propName, view = _a[_b];
|
|
3648
|
-
var views = props.views;
|
|
3649
|
-
var allowedViews = views || allViews$1;
|
|
3650
|
-
if (view !== undefined && (typeof view !== 'string' || allowedViews.indexOf(view) === -1)) {
|
|
3651
|
-
return new Error("Invalid prop `".concat(propName, "` of value `").concat(view, "` supplied to `").concat(componentName, "`, expected one of [").concat(allowedViews
|
|
3652
|
-
.map(function (a) { return "\"".concat(a, "\""); })
|
|
3653
|
-
.join(', '), "]."));
|
|
3654
|
-
}
|
|
3655
|
-
// Everything is fine
|
|
3656
|
-
return null;
|
|
3657
|
-
}
|
|
3658
|
-
isView.isRequired = function (props, propName, componentName) {
|
|
3659
|
-
var _a = props, _b = propName, view = _a[_b];
|
|
3660
|
-
if (!view) {
|
|
3661
|
-
return new Error("The prop `".concat(propName, "` is marked as required in `").concat(componentName, "`, but its value is `").concat(view, "`."));
|
|
3662
|
-
}
|
|
3663
|
-
return isView(props, propName, componentName);
|
|
3664
|
-
};
|
|
3665
|
-
var tileGroupProps = {
|
|
3666
|
-
activeStartDate: PropTypes.instanceOf(Date).isRequired,
|
|
3667
|
-
hover: PropTypes.instanceOf(Date),
|
|
3668
|
-
locale: PropTypes.string,
|
|
3669
|
-
maxDate: isMaxDate,
|
|
3670
|
-
minDate: isMinDate,
|
|
3671
|
-
onClick: PropTypes.func,
|
|
3672
|
-
onMouseOver: PropTypes.func,
|
|
3673
|
-
tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
|
|
3674
|
-
tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
3675
|
-
value: isValue$1,
|
|
3676
|
-
valueType: PropTypes.string,
|
|
3677
|
-
};
|
|
3678
|
-
var tileProps = {
|
|
3679
|
-
activeStartDate: PropTypes.instanceOf(Date).isRequired,
|
|
3680
|
-
classes: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
3681
|
-
date: PropTypes.instanceOf(Date).isRequired,
|
|
3682
|
-
locale: PropTypes.string,
|
|
3683
|
-
maxDate: isMaxDate,
|
|
3684
|
-
minDate: isMinDate,
|
|
3685
|
-
onClick: PropTypes.func,
|
|
3686
|
-
onMouseOver: PropTypes.func,
|
|
3687
|
-
style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
3688
|
-
tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
|
|
3689
|
-
tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
3690
|
-
tileDisabled: PropTypes.func,
|
|
3691
|
-
};
|
|
3692
|
-
|
|
3693
3637
|
var className$6 = 'react-calendar__navigation';
|
|
3694
3638
|
function Navigation(_a) {
|
|
3695
3639
|
var activeStartDate = _a.activeStartDate, drillUp = _a.drillUp, _b = _a.formatMonthYear, formatMonthYear$1 = _b === void 0 ? formatMonthYear : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, locale = _a.locale, maxDate = _a.maxDate, minDate = _a.minDate, _d = _a.navigationAriaLabel, navigationAriaLabel = _d === void 0 ? '' : _d, navigationAriaLive = _a.navigationAriaLive, navigationLabel = _a.navigationLabel, _e = _a.next2AriaLabel, next2AriaLabel = _e === void 0 ? '' : _e, _f = _a.next2Label, next2Label = _f === void 0 ? '»' : _f, _g = _a.nextAriaLabel, nextAriaLabel = _g === void 0 ? '' : _g, _h = _a.nextLabel, nextLabel = _h === void 0 ? '›' : _h, _j = _a.prev2AriaLabel, prev2AriaLabel = _j === void 0 ? '' : _j, _k = _a.prev2Label, prev2Label = _k === void 0 ? '«' : _k, _l = _a.prevAriaLabel, prevAriaLabel = _l === void 0 ? '' : _l, _m = _a.prevLabel, prevLabel = _m === void 0 ? '‹' : _m, setActiveStartDate = _a.setActiveStartDate, showDoubleView = _a.showDoubleView, view = _a.view, views = _a.views;
|
|
@@ -3771,33 +3715,9 @@ function Navigation(_a) {
|
|
|
3771
3715
|
nextLabel !== null && (React.createElement("button", { "aria-label": nextAriaLabel, className: "".concat(className$6, "__arrow ").concat(className$6, "__next-button"), disabled: nextButtonDisabled, onClick: onClickNext, type: "button" }, nextLabel)),
|
|
3772
3716
|
next2Label !== null && shouldShowPrevNext2Buttons ? (React.createElement("button", { "aria-label": next2AriaLabel, className: "".concat(className$6, "__arrow ").concat(className$6, "__next2-button"), disabled: next2ButtonDisabled, onClick: onClickNext2, type: "button" }, next2Label)) : null));
|
|
3773
3717
|
}
|
|
3774
|
-
Navigation.propTypes = {
|
|
3775
|
-
activeStartDate: PropTypes.instanceOf(Date).isRequired,
|
|
3776
|
-
drillUp: PropTypes.func.isRequired,
|
|
3777
|
-
formatMonthYear: PropTypes.func,
|
|
3778
|
-
formatYear: PropTypes.func,
|
|
3779
|
-
locale: PropTypes.string,
|
|
3780
|
-
maxDate: PropTypes.instanceOf(Date),
|
|
3781
|
-
minDate: PropTypes.instanceOf(Date),
|
|
3782
|
-
navigationAriaLabel: PropTypes.string,
|
|
3783
|
-
navigationAriaLive: PropTypes.string,
|
|
3784
|
-
navigationLabel: PropTypes.func,
|
|
3785
|
-
next2AriaLabel: PropTypes.string,
|
|
3786
|
-
next2Label: PropTypes.node,
|
|
3787
|
-
nextAriaLabel: PropTypes.string,
|
|
3788
|
-
nextLabel: PropTypes.node,
|
|
3789
|
-
prev2AriaLabel: PropTypes.string,
|
|
3790
|
-
prev2Label: PropTypes.node,
|
|
3791
|
-
prevAriaLabel: PropTypes.string,
|
|
3792
|
-
prevLabel: PropTypes.node,
|
|
3793
|
-
setActiveStartDate: PropTypes.func.isRequired,
|
|
3794
|
-
showDoubleView: PropTypes.bool,
|
|
3795
|
-
view: isView.isRequired,
|
|
3796
|
-
views: isViews.isRequired,
|
|
3797
|
-
};
|
|
3798
3718
|
|
|
3799
|
-
var __assign$
|
|
3800
|
-
__assign$
|
|
3719
|
+
var __assign$e = (undefined && undefined.__assign) || function () {
|
|
3720
|
+
__assign$e = Object.assign || function(t) {
|
|
3801
3721
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3802
3722
|
s = arguments[i];
|
|
3803
3723
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -3805,9 +3725,9 @@ var __assign$g = (undefined && undefined.__assign) || function () {
|
|
|
3805
3725
|
}
|
|
3806
3726
|
return t;
|
|
3807
3727
|
};
|
|
3808
|
-
return __assign$
|
|
3728
|
+
return __assign$e.apply(this, arguments);
|
|
3809
3729
|
};
|
|
3810
|
-
var __rest$
|
|
3730
|
+
var __rest$a = (undefined && undefined.__rest) || function (s, e) {
|
|
3811
3731
|
var t = {};
|
|
3812
3732
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3813
3733
|
t[p] = s[p];
|
|
@@ -3822,27 +3742,41 @@ function toPercent(num) {
|
|
|
3822
3742
|
return "".concat(num, "%");
|
|
3823
3743
|
}
|
|
3824
3744
|
function Flex(_a) {
|
|
3825
|
-
var children = _a.children, className = _a.className, count = _a.count, direction = _a.direction, offset = _a.offset, style = _a.style, wrap = _a.wrap, otherProps = __rest$
|
|
3826
|
-
return (React.createElement("div", __assign$
|
|
3827
|
-
|
|
3745
|
+
var children = _a.children, className = _a.className, count = _a.count, direction = _a.direction, offset = _a.offset, style = _a.style, wrap = _a.wrap, otherProps = __rest$a(_a, ["children", "className", "count", "direction", "offset", "style", "wrap"]);
|
|
3746
|
+
return (React.createElement("div", __assign$e({ className: className, style: __assign$e({ display: 'flex', flexDirection: direction, flexWrap: wrap ? 'wrap' : 'nowrap' }, style) }, otherProps), React.Children.map(children, function (child, index) {
|
|
3747
|
+
var marginInlineStart = offset && index === 0 ? toPercent((100 * offset) / count) : null;
|
|
3748
|
+
return React.cloneElement(child, __assign$e(__assign$e({}, child.props), { style: {
|
|
3828
3749
|
flexBasis: toPercent(100 / count),
|
|
3829
3750
|
flexShrink: 0,
|
|
3830
3751
|
flexGrow: 0,
|
|
3831
3752
|
overflow: 'hidden',
|
|
3832
|
-
marginLeft:
|
|
3753
|
+
marginLeft: marginInlineStart,
|
|
3754
|
+
marginInlineStart: marginInlineStart,
|
|
3755
|
+
marginInlineEnd: 0,
|
|
3833
3756
|
} }));
|
|
3834
3757
|
})));
|
|
3835
3758
|
}
|
|
3836
|
-
Flex.propTypes = {
|
|
3837
|
-
children: PropTypes.node,
|
|
3838
|
-
className: PropTypes.string,
|
|
3839
|
-
count: PropTypes.number.isRequired,
|
|
3840
|
-
direction: PropTypes.string,
|
|
3841
|
-
offset: PropTypes.number,
|
|
3842
|
-
style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
3843
|
-
wrap: PropTypes.bool,
|
|
3844
|
-
};
|
|
3845
3759
|
|
|
3760
|
+
var isProduction = process.env.NODE_ENV === 'production';
|
|
3761
|
+
function warning(condition, message) {
|
|
3762
|
+
if (!isProduction) {
|
|
3763
|
+
if (condition) {
|
|
3764
|
+
return;
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
var text = "Warning: " + message;
|
|
3768
|
+
|
|
3769
|
+
if (typeof console !== 'undefined') {
|
|
3770
|
+
console.warn(text);
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
try {
|
|
3774
|
+
throw Error(text);
|
|
3775
|
+
} catch (x) {}
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
var _a;
|
|
3846
3780
|
/**
|
|
3847
3781
|
* Returns a value no smaller than min and no larger than max.
|
|
3848
3782
|
*
|
|
@@ -3888,6 +3822,12 @@ function getRangeClassNames(valueRange, dateRange, baseClassName) {
|
|
|
3888
3822
|
}
|
|
3889
3823
|
return classes;
|
|
3890
3824
|
}
|
|
3825
|
+
function isCompleteValue(value) {
|
|
3826
|
+
if (Array.isArray(value)) {
|
|
3827
|
+
return value[0] !== null && value[1] !== null;
|
|
3828
|
+
}
|
|
3829
|
+
return value !== null;
|
|
3830
|
+
}
|
|
3891
3831
|
function getTileClasses(args) {
|
|
3892
3832
|
if (!args) {
|
|
3893
3833
|
throw new Error('args is required');
|
|
@@ -3912,7 +3852,7 @@ function getTileClasses(args) {
|
|
|
3912
3852
|
if (isValueWithinRange(now, dateRange)) {
|
|
3913
3853
|
classes.push("".concat(className, "--now"));
|
|
3914
3854
|
}
|
|
3915
|
-
if (!value) {
|
|
3855
|
+
if (!value || !isCompleteValue(value)) {
|
|
3916
3856
|
return classes;
|
|
3917
3857
|
}
|
|
3918
3858
|
var valueRange = (function () {
|
|
@@ -3941,115 +3881,61 @@ function getTileClasses(args) {
|
|
|
3941
3881
|
}
|
|
3942
3882
|
return classes;
|
|
3943
3883
|
}
|
|
3884
|
+
var calendarTypeMap = (_a = {},
|
|
3885
|
+
_a[DEPRECATED_CALENDAR_TYPES.ARABIC] = CALENDAR_TYPES.ISLAMIC,
|
|
3886
|
+
_a[DEPRECATED_CALENDAR_TYPES.HEBREW] = CALENDAR_TYPES.HEBREW,
|
|
3887
|
+
_a[DEPRECATED_CALENDAR_TYPES.ISO_8601] = CALENDAR_TYPES.ISO_8601,
|
|
3888
|
+
_a[DEPRECATED_CALENDAR_TYPES.US] = CALENDAR_TYPES.GREGORY,
|
|
3889
|
+
_a);
|
|
3890
|
+
function isDeprecatedCalendarType(calendarType) {
|
|
3891
|
+
return calendarType !== undefined && calendarType in DEPRECATED_CALENDAR_TYPES;
|
|
3892
|
+
}
|
|
3893
|
+
var warned = false;
|
|
3894
|
+
function mapCalendarType(calendarTypeOrDeprecatedCalendarType) {
|
|
3895
|
+
if (isDeprecatedCalendarType(calendarTypeOrDeprecatedCalendarType)) {
|
|
3896
|
+
var calendarType = calendarTypeMap[calendarTypeOrDeprecatedCalendarType];
|
|
3897
|
+
warning(warned, "Specifying calendarType=\"".concat(calendarTypeOrDeprecatedCalendarType, "\" is deprecated. Use calendarType=\"").concat(calendarType, "\" instead."));
|
|
3898
|
+
warned = true;
|
|
3899
|
+
return calendarType;
|
|
3900
|
+
}
|
|
3901
|
+
return calendarTypeOrDeprecatedCalendarType;
|
|
3902
|
+
}
|
|
3944
3903
|
|
|
3945
|
-
var __assign$f = (undefined && undefined.__assign) || function () {
|
|
3946
|
-
__assign$f = Object.assign || function(t) {
|
|
3947
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3948
|
-
s = arguments[i];
|
|
3949
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
3950
|
-
t[p] = s[p];
|
|
3951
|
-
}
|
|
3952
|
-
return t;
|
|
3953
|
-
};
|
|
3954
|
-
return __assign$f.apply(this, arguments);
|
|
3955
|
-
};
|
|
3956
|
-
var __rest$8 = (undefined && undefined.__rest) || function (s, e) {
|
|
3957
|
-
var t = {};
|
|
3958
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3959
|
-
t[p] = s[p];
|
|
3960
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3961
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3962
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3963
|
-
t[p[i]] = s[p[i]];
|
|
3964
|
-
}
|
|
3965
|
-
return t;
|
|
3966
|
-
};
|
|
3967
3904
|
function TileGroup(_a) {
|
|
3968
|
-
var className = _a.className, _b = _a.count, count = _b === void 0 ? 3 : _b, dateTransform = _a.dateTransform, dateType = _a.dateType, end = _a.end, hover = _a.hover, offset = _a.offset, start = _a.start, _c = _a.step, step = _c === void 0 ? 1 : _c,
|
|
3905
|
+
var className = _a.className, _b = _a.count, count = _b === void 0 ? 3 : _b, dateTransform = _a.dateTransform, dateType = _a.dateType, end = _a.end, hover = _a.hover, offset = _a.offset, renderTile = _a.renderTile, start = _a.start, _c = _a.step, step = _c === void 0 ? 1 : _c, value = _a.value, valueType = _a.valueType;
|
|
3969
3906
|
var tiles = [];
|
|
3970
3907
|
for (var point = start; point <= end; point += step) {
|
|
3971
3908
|
var date = dateTransform(point);
|
|
3972
|
-
tiles.push(
|
|
3973
|
-
|
|
3974
|
-
valueType: valueType,
|
|
3909
|
+
tiles.push(renderTile({
|
|
3910
|
+
classes: getTileClasses({
|
|
3975
3911
|
date: date,
|
|
3976
3912
|
dateType: dateType,
|
|
3977
3913
|
hover: hover,
|
|
3978
|
-
|
|
3914
|
+
value: value,
|
|
3915
|
+
valueType: valueType,
|
|
3916
|
+
}),
|
|
3917
|
+
date: date,
|
|
3918
|
+
}));
|
|
3979
3919
|
}
|
|
3980
3920
|
return (React.createElement(Flex, { className: className, count: count, offset: offset, wrap: true }, tiles));
|
|
3981
3921
|
}
|
|
3982
|
-
TileGroup.propTypes = __assign$f(__assign$f({}, tileGroupProps), { className: PropTypes.string, count: PropTypes.number, dateTransform: PropTypes.func.isRequired, dateType: PropTypes.string, end: PropTypes.number.isRequired, offset: PropTypes.number, step: PropTypes.number, start: PropTypes.number.isRequired, tile: PropTypes.func.isRequired });
|
|
3983
3922
|
|
|
3984
|
-
|
|
3985
|
-
var
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
return function (d, b) {
|
|
3992
|
-
if (typeof b !== "function" && b !== null)
|
|
3993
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3994
|
-
extendStatics(d, b);
|
|
3995
|
-
function __() { this.constructor = d; }
|
|
3996
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3997
|
-
};
|
|
3998
|
-
})();
|
|
3999
|
-
var __assign$e = (undefined && undefined.__assign) || function () {
|
|
4000
|
-
__assign$e = Object.assign || function(t) {
|
|
4001
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4002
|
-
s = arguments[i];
|
|
4003
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
4004
|
-
t[p] = s[p];
|
|
4005
|
-
}
|
|
4006
|
-
return t;
|
|
4007
|
-
};
|
|
4008
|
-
return __assign$e.apply(this, arguments);
|
|
4009
|
-
};
|
|
4010
|
-
function datesAreDifferent(date1, date2) {
|
|
4011
|
-
return ((date1 && !date2) ||
|
|
4012
|
-
(!date1 && date2) ||
|
|
4013
|
-
(date1 && date2 && date1.getTime() !== date2.getTime()));
|
|
4014
|
-
}
|
|
4015
|
-
var Tile = /** @class */ (function (_super) {
|
|
4016
|
-
__extends$1(Tile, _super);
|
|
4017
|
-
function Tile() {
|
|
4018
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
4019
|
-
_this.state = {};
|
|
4020
|
-
return _this;
|
|
4021
|
-
}
|
|
4022
|
-
Tile.getDerivedStateFromProps = function (nextProps, prevState) {
|
|
4023
|
-
var activeStartDate = nextProps.activeStartDate, date = nextProps.date, tileClassName = nextProps.tileClassName, tileContent = nextProps.tileContent, view = nextProps.view;
|
|
4024
|
-
var nextState = {};
|
|
3923
|
+
function Tile(props) {
|
|
3924
|
+
var activeStartDate = props.activeStartDate, children = props.children, classes = props.classes, date = props.date, formatAbbr = props.formatAbbr, locale = props.locale, maxDate = props.maxDate, maxDateTransform = props.maxDateTransform, minDate = props.minDate, minDateTransform = props.minDateTransform, onClick = props.onClick, onMouseOver = props.onMouseOver, style = props.style, tileClassNameProps = props.tileClassName, tileContentProps = props.tileContent, tileDisabled = props.tileDisabled, view = props.view;
|
|
3925
|
+
var tileClassName = useMemo(function () {
|
|
3926
|
+
var args = { activeStartDate: activeStartDate, date: date, view: view };
|
|
3927
|
+
return typeof tileClassNameProps === 'function' ? tileClassNameProps(args) : tileClassNameProps;
|
|
3928
|
+
}, [activeStartDate, date, tileClassNameProps, view]);
|
|
3929
|
+
var tileContent = useMemo(function () {
|
|
4025
3930
|
var args = { activeStartDate: activeStartDate, date: date, view: view };
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
}
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
nextState.tileContent = typeof tileContent === 'function' ? tileContent(args) : tileContent;
|
|
4035
|
-
nextState.tileContentProps = tileContent;
|
|
4036
|
-
}
|
|
4037
|
-
nextState.activeStartDateProps = activeStartDate;
|
|
4038
|
-
return nextState;
|
|
4039
|
-
};
|
|
4040
|
-
Tile.prototype.render = function () {
|
|
4041
|
-
var _a = this.props, activeStartDate = _a.activeStartDate, children = _a.children, classes = _a.classes, date = _a.date, formatAbbr = _a.formatAbbr, locale = _a.locale, maxDate = _a.maxDate, maxDateTransform = _a.maxDateTransform, minDate = _a.minDate, minDateTransform = _a.minDateTransform, onClick = _a.onClick, onMouseOver = _a.onMouseOver, style = _a.style, tileDisabled = _a.tileDisabled, view = _a.view;
|
|
4042
|
-
var _b = this.state, tileClassName = _b.tileClassName, tileContent = _b.tileContent;
|
|
4043
|
-
return (React.createElement("button", { className: clsx(classes, tileClassName), disabled: (minDate && minDateTransform(minDate) > date) ||
|
|
4044
|
-
(maxDate && maxDateTransform(maxDate) < date) ||
|
|
4045
|
-
(tileDisabled && tileDisabled({ activeStartDate: activeStartDate, date: date, view: view })), onClick: onClick ? function (event) { return onClick(date, event); } : undefined, onFocus: onMouseOver ? function () { return onMouseOver(date); } : undefined, onMouseOver: onMouseOver ? function () { return onMouseOver(date); } : undefined, style: style, type: "button" },
|
|
4046
|
-
formatAbbr ? React.createElement("abbr", { "aria-label": formatAbbr(locale, date) }, children) : children,
|
|
4047
|
-
tileContent));
|
|
4048
|
-
};
|
|
4049
|
-
Tile.propTypes = __assign$e(__assign$e({}, tileProps), { children: PropTypes.node.isRequired, formatAbbr: PropTypes.func, maxDateTransform: PropTypes.func.isRequired, minDateTransform: PropTypes.func.isRequired });
|
|
4050
|
-
return Tile;
|
|
4051
|
-
}(Component));
|
|
4052
|
-
var Tile$1 = Tile;
|
|
3931
|
+
return typeof tileContentProps === 'function' ? tileContentProps(args) : tileContentProps;
|
|
3932
|
+
}, [activeStartDate, date, tileContentProps, view]);
|
|
3933
|
+
return (React.createElement("button", { className: clsx(classes, tileClassName), disabled: (minDate && minDateTransform(minDate) > date) ||
|
|
3934
|
+
(maxDate && maxDateTransform(maxDate) < date) ||
|
|
3935
|
+
(tileDisabled && tileDisabled({ activeStartDate: activeStartDate, date: date, view: view })), onClick: onClick ? function (event) { return onClick(date, event); } : undefined, onFocus: onMouseOver ? function () { return onMouseOver(date); } : undefined, onMouseOver: onMouseOver ? function () { return onMouseOver(date); } : undefined, style: style, type: "button" },
|
|
3936
|
+
formatAbbr ? React.createElement("abbr", { "aria-label": formatAbbr(locale, date) }, children) : children,
|
|
3937
|
+
tileContent));
|
|
3938
|
+
}
|
|
4053
3939
|
|
|
4054
3940
|
var __assign$d = (undefined && undefined.__assign) || function () {
|
|
4055
3941
|
__assign$d = Object.assign || function(t) {
|
|
@@ -4062,7 +3948,7 @@ var __assign$d = (undefined && undefined.__assign) || function () {
|
|
|
4062
3948
|
};
|
|
4063
3949
|
return __assign$d.apply(this, arguments);
|
|
4064
3950
|
};
|
|
4065
|
-
var __rest$
|
|
3951
|
+
var __rest$9 = (undefined && undefined.__rest) || function (s, e) {
|
|
4066
3952
|
var t = {};
|
|
4067
3953
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4068
3954
|
t[p] = s[p];
|
|
@@ -4073,7 +3959,7 @@ var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4073
3959
|
}
|
|
4074
3960
|
return t;
|
|
4075
3961
|
};
|
|
4076
|
-
var __spreadArray$
|
|
3962
|
+
var __spreadArray$3 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
4077
3963
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4078
3964
|
if (ar || !(i in from)) {
|
|
4079
3965
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
@@ -4084,11 +3970,10 @@ var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, fr
|
|
|
4084
3970
|
};
|
|
4085
3971
|
var className$5 = 'react-calendar__century-view__decades__decade';
|
|
4086
3972
|
function Decade(_a) {
|
|
4087
|
-
var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, otherProps = __rest$
|
|
3973
|
+
var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, otherProps = __rest$9(_a, ["classes", "formatYear"]);
|
|
4088
3974
|
var date = otherProps.date, locale = otherProps.locale;
|
|
4089
|
-
return (React.createElement(Tile
|
|
3975
|
+
return (React.createElement(Tile, __assign$d({}, otherProps, { classes: __spreadArray$3(__spreadArray$3([], classes, true), [className$5], false), maxDateTransform: getDecadeEnd, minDateTransform: getDecadeStart, view: "century" }), getDecadeLabel(locale, formatYear$1, date)));
|
|
4090
3976
|
}
|
|
4091
|
-
Decade.propTypes = __assign$d(__assign$d({}, tileProps), { formatYear: PropTypes.func });
|
|
4092
3977
|
|
|
4093
3978
|
var __assign$c = (undefined && undefined.__assign) || function () {
|
|
4094
3979
|
__assign$c = Object.assign || function(t) {
|
|
@@ -4101,13 +3986,132 @@ var __assign$c = (undefined && undefined.__assign) || function () {
|
|
|
4101
3986
|
};
|
|
4102
3987
|
return __assign$c.apply(this, arguments);
|
|
4103
3988
|
};
|
|
3989
|
+
var __rest$8 = (undefined && undefined.__rest) || function (s, e) {
|
|
3990
|
+
var t = {};
|
|
3991
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3992
|
+
t[p] = s[p];
|
|
3993
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3994
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3995
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3996
|
+
t[p[i]] = s[p[i]];
|
|
3997
|
+
}
|
|
3998
|
+
return t;
|
|
3999
|
+
};
|
|
4104
4000
|
function Decades(props) {
|
|
4105
|
-
var activeStartDate = props.activeStartDate;
|
|
4001
|
+
var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest$8(props, ["activeStartDate", "hover", "value", "valueType"]);
|
|
4106
4002
|
var start = getBeginOfCenturyYear(activeStartDate);
|
|
4107
4003
|
var end = start + 99;
|
|
4108
|
-
return (React.createElement(TileGroup,
|
|
4004
|
+
return (React.createElement(TileGroup, { className: "react-calendar__century-view__decades", dateTransform: getDecadeStart, dateType: "decade", end: end, hover: hover, renderTile: function (_a) {
|
|
4005
|
+
var date = _a.date, otherTileProps = __rest$8(_a, ["date"]);
|
|
4006
|
+
return (React.createElement(Decade, __assign$c({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));
|
|
4007
|
+
}, start: start, step: 10, value: value, valueType: valueType }));
|
|
4109
4008
|
}
|
|
4110
|
-
|
|
4009
|
+
|
|
4010
|
+
var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
4011
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4012
|
+
if (ar || !(i in from)) {
|
|
4013
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
4014
|
+
ar[i] = from[i];
|
|
4015
|
+
}
|
|
4016
|
+
}
|
|
4017
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
4018
|
+
};
|
|
4019
|
+
var calendarTypes = Object.values(CALENDAR_TYPES);
|
|
4020
|
+
var deprecatedCalendarTypes = Object.values(DEPRECATED_CALENDAR_TYPES);
|
|
4021
|
+
var allViews$1 = ['century', 'decade', 'year', 'month'];
|
|
4022
|
+
var isCalendarType = PropTypes.oneOf(__spreadArray$2(__spreadArray$2([], calendarTypes, true), deprecatedCalendarTypes, true));
|
|
4023
|
+
var isClassName = PropTypes.oneOfType([
|
|
4024
|
+
PropTypes.string,
|
|
4025
|
+
PropTypes.arrayOf(PropTypes.string),
|
|
4026
|
+
]);
|
|
4027
|
+
var isMinDate = function isMinDate(props, propName, componentName) {
|
|
4028
|
+
var _a = props, _b = propName, minDate = _a[_b];
|
|
4029
|
+
if (!minDate) {
|
|
4030
|
+
return null;
|
|
4031
|
+
}
|
|
4032
|
+
if (!(minDate instanceof Date)) {
|
|
4033
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof minDate, "` supplied to `").concat(componentName, "`, expected instance of `Date`."));
|
|
4034
|
+
}
|
|
4035
|
+
var maxDate = props.maxDate;
|
|
4036
|
+
if (maxDate && minDate > maxDate) {
|
|
4037
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof minDate, "` supplied to `").concat(componentName, "`, minDate cannot be larger than maxDate."));
|
|
4038
|
+
}
|
|
4039
|
+
return null;
|
|
4040
|
+
};
|
|
4041
|
+
var isMaxDate = function isMaxDate(props, propName, componentName) {
|
|
4042
|
+
var _a = props, _b = propName, maxDate = _a[_b];
|
|
4043
|
+
if (!maxDate) {
|
|
4044
|
+
return null;
|
|
4045
|
+
}
|
|
4046
|
+
if (!(maxDate instanceof Date)) {
|
|
4047
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof maxDate, "` supplied to `").concat(componentName, "`, expected instance of `Date`."));
|
|
4048
|
+
}
|
|
4049
|
+
var minDate = props.minDate;
|
|
4050
|
+
if (minDate && maxDate < minDate) {
|
|
4051
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof maxDate, "` supplied to `").concat(componentName, "`, maxDate cannot be smaller than minDate."));
|
|
4052
|
+
}
|
|
4053
|
+
return null;
|
|
4054
|
+
};
|
|
4055
|
+
var isRef = PropTypes.oneOfType([
|
|
4056
|
+
PropTypes.func,
|
|
4057
|
+
PropTypes.exact({
|
|
4058
|
+
current: PropTypes.any,
|
|
4059
|
+
}),
|
|
4060
|
+
]);
|
|
4061
|
+
var isRange = PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.oneOf([null])]).isRequired);
|
|
4062
|
+
var isValue$1 = PropTypes.oneOfType([
|
|
4063
|
+
PropTypes.instanceOf(Date),
|
|
4064
|
+
PropTypes.oneOf([null]),
|
|
4065
|
+
isRange,
|
|
4066
|
+
]);
|
|
4067
|
+
PropTypes.arrayOf(PropTypes.oneOf(allViews$1));
|
|
4068
|
+
var isView = function isView(props, propName, componentName) {
|
|
4069
|
+
var _a = props, _b = propName, view = _a[_b];
|
|
4070
|
+
if (view !== undefined && (typeof view !== 'string' || allViews$1.indexOf(view) === -1)) {
|
|
4071
|
+
return new Error("Invalid prop `".concat(propName, "` of value `").concat(view, "` supplied to `").concat(componentName, "`, expected one of [").concat(allViews$1
|
|
4072
|
+
.map(function (a) { return "\"".concat(a, "\""); })
|
|
4073
|
+
.join(', '), "]."));
|
|
4074
|
+
}
|
|
4075
|
+
// Everything is fine
|
|
4076
|
+
return null;
|
|
4077
|
+
};
|
|
4078
|
+
isView.isRequired = function isViewIsRequired(props, propName, componentName, location, propFullName) {
|
|
4079
|
+
var _a = props, _b = propName, view = _a[_b];
|
|
4080
|
+
if (!view) {
|
|
4081
|
+
return new Error("The prop `".concat(propName, "` is marked as required in `").concat(componentName, "`, but its value is `").concat(view, "`."));
|
|
4082
|
+
}
|
|
4083
|
+
return isView(props, propName, componentName);
|
|
4084
|
+
};
|
|
4085
|
+
var rangeOf = function (type) {
|
|
4086
|
+
return PropTypes.arrayOf(type);
|
|
4087
|
+
};
|
|
4088
|
+
var tileGroupProps = {
|
|
4089
|
+
activeStartDate: PropTypes.instanceOf(Date).isRequired,
|
|
4090
|
+
hover: PropTypes.instanceOf(Date),
|
|
4091
|
+
locale: PropTypes.string,
|
|
4092
|
+
maxDate: isMaxDate,
|
|
4093
|
+
minDate: isMinDate,
|
|
4094
|
+
onClick: PropTypes.func,
|
|
4095
|
+
onMouseOver: PropTypes.func,
|
|
4096
|
+
tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
|
|
4097
|
+
tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
4098
|
+
value: isValue$1,
|
|
4099
|
+
valueType: PropTypes.oneOf(['century', 'decade', 'year', 'month', 'day']).isRequired,
|
|
4100
|
+
};
|
|
4101
|
+
({
|
|
4102
|
+
activeStartDate: PropTypes.instanceOf(Date).isRequired,
|
|
4103
|
+
classes: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
|
|
4104
|
+
date: PropTypes.instanceOf(Date).isRequired,
|
|
4105
|
+
locale: PropTypes.string,
|
|
4106
|
+
maxDate: isMaxDate,
|
|
4107
|
+
minDate: isMinDate,
|
|
4108
|
+
onClick: PropTypes.func,
|
|
4109
|
+
onMouseOver: PropTypes.func,
|
|
4110
|
+
style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
4111
|
+
tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
|
|
4112
|
+
tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
4113
|
+
tileDisabled: PropTypes.func,
|
|
4114
|
+
});
|
|
4111
4115
|
|
|
4112
4116
|
var __assign$b = (undefined && undefined.__assign) || function () {
|
|
4113
4117
|
__assign$b = Object.assign || function(t) {
|
|
@@ -4120,12 +4124,14 @@ var __assign$b = (undefined && undefined.__assign) || function () {
|
|
|
4120
4124
|
};
|
|
4121
4125
|
return __assign$b.apply(this, arguments);
|
|
4122
4126
|
};
|
|
4123
|
-
function CenturyView(props) {
|
|
4127
|
+
var CenturyView = function CenturyView(props) {
|
|
4124
4128
|
function renderDecades() {
|
|
4125
4129
|
return React.createElement(Decades, __assign$b({}, props));
|
|
4126
4130
|
}
|
|
4127
4131
|
return React.createElement("div", { className: "react-calendar__century-view" }, renderDecades());
|
|
4128
|
-
}
|
|
4132
|
+
};
|
|
4133
|
+
CenturyView.propTypes = __assign$b({}, tileGroupProps);
|
|
4134
|
+
var CenturyView$1 = CenturyView;
|
|
4129
4135
|
|
|
4130
4136
|
var __assign$a = (undefined && undefined.__assign) || function () {
|
|
4131
4137
|
__assign$a = Object.assign || function(t) {
|
|
@@ -4138,7 +4144,7 @@ var __assign$a = (undefined && undefined.__assign) || function () {
|
|
|
4138
4144
|
};
|
|
4139
4145
|
return __assign$a.apply(this, arguments);
|
|
4140
4146
|
};
|
|
4141
|
-
var __rest$
|
|
4147
|
+
var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
|
|
4142
4148
|
var t = {};
|
|
4143
4149
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4144
4150
|
t[p] = s[p];
|
|
@@ -4160,11 +4166,10 @@ var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, fr
|
|
|
4160
4166
|
};
|
|
4161
4167
|
var className$4 = 'react-calendar__decade-view__years__year';
|
|
4162
4168
|
function Year(_a) {
|
|
4163
|
-
var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, otherProps = __rest$
|
|
4169
|
+
var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, otherProps = __rest$7(_a, ["classes", "formatYear"]);
|
|
4164
4170
|
var date = otherProps.date, locale = otherProps.locale;
|
|
4165
|
-
return (React.createElement(Tile
|
|
4171
|
+
return (React.createElement(Tile, __assign$a({}, otherProps, { classes: __spreadArray$1(__spreadArray$1([], classes, true), [className$4], false), maxDateTransform: getYearEnd, minDateTransform: getYearStart, view: "decade" }), formatYear$1(locale, date)));
|
|
4166
4172
|
}
|
|
4167
|
-
Year.propTypes = __assign$a(__assign$a({}, tileProps), { formatYear: PropTypes.func });
|
|
4168
4173
|
|
|
4169
4174
|
var __assign$9 = (undefined && undefined.__assign) || function () {
|
|
4170
4175
|
__assign$9 = Object.assign || function(t) {
|
|
@@ -4177,18 +4182,26 @@ var __assign$9 = (undefined && undefined.__assign) || function () {
|
|
|
4177
4182
|
};
|
|
4178
4183
|
return __assign$9.apply(this, arguments);
|
|
4179
4184
|
};
|
|
4185
|
+
var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
|
|
4186
|
+
var t = {};
|
|
4187
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4188
|
+
t[p] = s[p];
|
|
4189
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4190
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4191
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4192
|
+
t[p[i]] = s[p[i]];
|
|
4193
|
+
}
|
|
4194
|
+
return t;
|
|
4195
|
+
};
|
|
4180
4196
|
function Years(props) {
|
|
4181
|
-
var activeStartDate = props.activeStartDate;
|
|
4197
|
+
var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest$6(props, ["activeStartDate", "hover", "value", "valueType"]);
|
|
4182
4198
|
var start = getBeginOfDecadeYear(activeStartDate);
|
|
4183
4199
|
var end = start + 9;
|
|
4184
|
-
return (React.createElement(TileGroup,
|
|
4185
|
-
var date =
|
|
4186
|
-
date.
|
|
4187
|
-
|
|
4188
|
-
return date;
|
|
4189
|
-
}, dateType: "year", end: end, start: start, tile: Year })));
|
|
4200
|
+
return (React.createElement(TileGroup, { className: "react-calendar__decade-view__years", dateTransform: getYearStart, dateType: "year", end: end, hover: hover, renderTile: function (_a) {
|
|
4201
|
+
var date = _a.date, otherTileProps = __rest$6(_a, ["date"]);
|
|
4202
|
+
return (React.createElement(Year, __assign$9({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));
|
|
4203
|
+
}, start: start, value: value, valueType: valueType }));
|
|
4190
4204
|
}
|
|
4191
|
-
Years.propTypes = __assign$9({}, tileGroupProps);
|
|
4192
4205
|
|
|
4193
4206
|
var __assign$8 = (undefined && undefined.__assign) || function () {
|
|
4194
4207
|
__assign$8 = Object.assign || function(t) {
|
|
@@ -4201,12 +4214,14 @@ var __assign$8 = (undefined && undefined.__assign) || function () {
|
|
|
4201
4214
|
};
|
|
4202
4215
|
return __assign$8.apply(this, arguments);
|
|
4203
4216
|
};
|
|
4204
|
-
function DecadeView(props) {
|
|
4217
|
+
var DecadeView = function DecadeView(props) {
|
|
4205
4218
|
function renderYears() {
|
|
4206
4219
|
return React.createElement(Years, __assign$8({}, props));
|
|
4207
4220
|
}
|
|
4208
4221
|
return React.createElement("div", { className: "react-calendar__decade-view" }, renderYears());
|
|
4209
|
-
}
|
|
4222
|
+
};
|
|
4223
|
+
DecadeView.propTypes = __assign$8({}, tileGroupProps);
|
|
4224
|
+
var DecadeView$1 = DecadeView;
|
|
4210
4225
|
|
|
4211
4226
|
var __assign$7 = (undefined && undefined.__assign) || function () {
|
|
4212
4227
|
__assign$7 = Object.assign || function(t) {
|
|
@@ -4243,9 +4258,8 @@ var className$3 = 'react-calendar__year-view__months__month';
|
|
|
4243
4258
|
function Month(_a) {
|
|
4244
4259
|
var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatMonth, formatMonth$1 = _c === void 0 ? formatMonth : _c, _d = _a.formatMonthYear, formatMonthYear$1 = _d === void 0 ? formatMonthYear : _d, otherProps = __rest$5(_a, ["classes", "formatMonth", "formatMonthYear"]);
|
|
4245
4260
|
var date = otherProps.date, locale = otherProps.locale;
|
|
4246
|
-
return (React.createElement(Tile
|
|
4261
|
+
return (React.createElement(Tile, __assign$7({}, otherProps, { classes: __spreadArray(__spreadArray([], classes, true), [className$3], false), formatAbbr: formatMonthYear$1, maxDateTransform: getMonthEnd, minDateTransform: getMonthStart, view: "year" }), formatMonth$1(locale, date)));
|
|
4247
4262
|
}
|
|
4248
|
-
Month.propTypes = __assign$7(__assign$7({}, tileProps), { formatMonth: PropTypes.func, formatMonthYear: PropTypes.func });
|
|
4249
4263
|
|
|
4250
4264
|
var __assign$6 = (undefined && undefined.__assign) || function () {
|
|
4251
4265
|
__assign$6 = Object.assign || function(t) {
|
|
@@ -4258,19 +4272,31 @@ var __assign$6 = (undefined && undefined.__assign) || function () {
|
|
|
4258
4272
|
};
|
|
4259
4273
|
return __assign$6.apply(this, arguments);
|
|
4260
4274
|
};
|
|
4275
|
+
var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
|
|
4276
|
+
var t = {};
|
|
4277
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4278
|
+
t[p] = s[p];
|
|
4279
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4280
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4281
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4282
|
+
t[p[i]] = s[p[i]];
|
|
4283
|
+
}
|
|
4284
|
+
return t;
|
|
4285
|
+
};
|
|
4261
4286
|
function Months(props) {
|
|
4262
|
-
var activeStartDate = props.activeStartDate;
|
|
4287
|
+
var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest$4(props, ["activeStartDate", "hover", "value", "valueType"]);
|
|
4263
4288
|
var start = 0;
|
|
4264
4289
|
var end = 11;
|
|
4265
4290
|
var year = getYear(activeStartDate);
|
|
4266
|
-
return (React.createElement(TileGroup,
|
|
4291
|
+
return (React.createElement(TileGroup, { className: "react-calendar__year-view__months", dateTransform: function (monthIndex) {
|
|
4267
4292
|
var date = new Date();
|
|
4268
4293
|
date.setFullYear(year, monthIndex, 1);
|
|
4269
|
-
date
|
|
4270
|
-
|
|
4271
|
-
|
|
4294
|
+
return getMonthStart(date);
|
|
4295
|
+
}, dateType: "month", end: end, hover: hover, renderTile: function (_a) {
|
|
4296
|
+
var date = _a.date, otherTileProps = __rest$4(_a, ["date"]);
|
|
4297
|
+
return (React.createElement(Month, __assign$6({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));
|
|
4298
|
+
}, start: start, value: value, valueType: valueType }));
|
|
4272
4299
|
}
|
|
4273
|
-
Months.propTypes = __assign$6(__assign$6({}, tileGroupProps), { locale: PropTypes.string });
|
|
4274
4300
|
|
|
4275
4301
|
var __assign$5 = (undefined && undefined.__assign) || function () {
|
|
4276
4302
|
__assign$5 = Object.assign || function(t) {
|
|
@@ -4283,12 +4309,14 @@ var __assign$5 = (undefined && undefined.__assign) || function () {
|
|
|
4283
4309
|
};
|
|
4284
4310
|
return __assign$5.apply(this, arguments);
|
|
4285
4311
|
};
|
|
4286
|
-
function YearView(props) {
|
|
4312
|
+
var YearView = function YearView(props) {
|
|
4287
4313
|
function renderMonths() {
|
|
4288
4314
|
return React.createElement(Months, __assign$5({}, props));
|
|
4289
4315
|
}
|
|
4290
4316
|
return React.createElement("div", { className: "react-calendar__year-view" }, renderMonths());
|
|
4291
|
-
}
|
|
4317
|
+
};
|
|
4318
|
+
YearView.propTypes = __assign$5({}, tileGroupProps);
|
|
4319
|
+
var YearView$1 = YearView;
|
|
4292
4320
|
|
|
4293
4321
|
var __assign$4 = (undefined && undefined.__assign) || function () {
|
|
4294
4322
|
__assign$4 = Object.assign || function(t) {
|
|
@@ -4301,7 +4329,7 @@ var __assign$4 = (undefined && undefined.__assign) || function () {
|
|
|
4301
4329
|
};
|
|
4302
4330
|
return __assign$4.apply(this, arguments);
|
|
4303
4331
|
};
|
|
4304
|
-
var __rest$
|
|
4332
|
+
var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
4305
4333
|
var t = {};
|
|
4306
4334
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4307
4335
|
t[p] = s[p];
|
|
@@ -4314,7 +4342,8 @@ var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4314
4342
|
};
|
|
4315
4343
|
var className$2 = 'react-calendar__month-view__days__day';
|
|
4316
4344
|
function Day(_a) {
|
|
4317
|
-
var
|
|
4345
|
+
var calendarTypeOrDeprecatedCalendarType = _a.calendarType, _b = _a.classes, classes = _b === void 0 ? [] : _b, currentMonthIndex = _a.currentMonthIndex, _c = _a.formatDay, formatDay$1 = _c === void 0 ? formatDay : _c, _d = _a.formatLongDate, formatLongDate$1 = _d === void 0 ? formatLongDate : _d, otherProps = __rest$3(_a, ["calendarType", "classes", "currentMonthIndex", "formatDay", "formatLongDate"]);
|
|
4346
|
+
var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);
|
|
4318
4347
|
var date = otherProps.date, locale = otherProps.locale;
|
|
4319
4348
|
var classesProps = [];
|
|
4320
4349
|
if (classes) {
|
|
@@ -4329,9 +4358,8 @@ function Day(_a) {
|
|
|
4329
4358
|
if (date.getMonth() !== currentMonthIndex) {
|
|
4330
4359
|
classesProps.push("".concat(className$2, "--neighboringMonth"));
|
|
4331
4360
|
}
|
|
4332
|
-
return (React.createElement(Tile
|
|
4361
|
+
return (React.createElement(Tile, __assign$4({}, otherProps, { classes: classesProps, formatAbbr: formatLongDate$1, maxDateTransform: getDayEnd, minDateTransform: getDayStart, view: "month" }), formatDay$1(locale, date)));
|
|
4333
4362
|
}
|
|
4334
|
-
Day.propTypes = __assign$4(__assign$4({}, tileProps), { currentMonthIndex: PropTypes.number.isRequired, formatDay: PropTypes.func, formatLongDate: PropTypes.func });
|
|
4335
4363
|
|
|
4336
4364
|
var __assign$3 = (undefined && undefined.__assign) || function () {
|
|
4337
4365
|
__assign$3 = Object.assign || function(t) {
|
|
@@ -4344,7 +4372,7 @@ var __assign$3 = (undefined && undefined.__assign) || function () {
|
|
|
4344
4372
|
};
|
|
4345
4373
|
return __assign$3.apply(this, arguments);
|
|
4346
4374
|
};
|
|
4347
|
-
var __rest$
|
|
4375
|
+
var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
|
|
4348
4376
|
var t = {};
|
|
4349
4377
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4350
4378
|
t[p] = s[p];
|
|
@@ -4356,8 +4384,8 @@ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4356
4384
|
return t;
|
|
4357
4385
|
};
|
|
4358
4386
|
function Days(props) {
|
|
4359
|
-
var activeStartDate = props.activeStartDate, calendarType = props.calendarType;
|
|
4360
|
-
var
|
|
4387
|
+
var activeStartDate = props.activeStartDate, calendarTypeOrDeprecatedCalendarType = props.calendarType, hover = props.hover, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks, showNeighboringMonth = props.showNeighboringMonth, value = props.value, valueType = props.valueType, otherProps = __rest$2(props, ["activeStartDate", "calendarType", "hover", "showFixedNumberOfWeeks", "showNeighboringMonth", "value", "valueType"]);
|
|
4388
|
+
var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);
|
|
4361
4389
|
var year = getYear(activeStartDate);
|
|
4362
4390
|
var monthIndex = getMonth(activeStartDate);
|
|
4363
4391
|
var hasFixedNumberOfWeeks = showFixedNumberOfWeeks || showNeighboringMonth;
|
|
@@ -4389,19 +4417,21 @@ function Days(props) {
|
|
|
4389
4417
|
}
|
|
4390
4418
|
return daysInMonth;
|
|
4391
4419
|
})();
|
|
4392
|
-
return (React.createElement(TileGroup,
|
|
4420
|
+
return (React.createElement(TileGroup, { className: "react-calendar__month-view__days", count: 7, dateTransform: function (day) {
|
|
4393
4421
|
var date = new Date();
|
|
4394
4422
|
date.setFullYear(year, monthIndex, day);
|
|
4395
|
-
date
|
|
4396
|
-
|
|
4397
|
-
|
|
4423
|
+
return getDayStart(date);
|
|
4424
|
+
}, dateType: "day", hover: hover, end: end, renderTile: function (_a) {
|
|
4425
|
+
var date = _a.date, otherTileProps = __rest$2(_a, ["date"]);
|
|
4426
|
+
return (React.createElement(Day, __assign$3({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, calendarType: calendarTypeOrDeprecatedCalendarType, currentMonthIndex: monthIndex, date: date })));
|
|
4427
|
+
}, offset: offset, start: start, value: value, valueType: valueType }));
|
|
4398
4428
|
}
|
|
4399
|
-
Days.propTypes = __assign$3({ calendarType: isCalendarType, showFixedNumberOfWeeks: PropTypes.bool, showNeighboringMonth: PropTypes.bool }, tileGroupProps);
|
|
4400
4429
|
|
|
4401
4430
|
var className$1 = 'react-calendar__month-view__weekdays';
|
|
4402
4431
|
var weekdayClassName = "".concat(className$1, "__weekday");
|
|
4403
4432
|
function Weekdays(props) {
|
|
4404
|
-
var
|
|
4433
|
+
var calendarTypeOrDeprecatedCalendarType = props.calendarType, _a = props.formatShortWeekday, formatShortWeekday$1 = _a === void 0 ? formatShortWeekday : _a, _b = props.formatWeekday, formatWeekday$1 = _b === void 0 ? formatWeekday : _b, locale = props.locale, onMouseLeave = props.onMouseLeave;
|
|
4434
|
+
var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);
|
|
4405
4435
|
var anyDate = new Date();
|
|
4406
4436
|
var beginOfMonth = getMonthStart(anyDate);
|
|
4407
4437
|
var year = getYear(beginOfMonth);
|
|
@@ -4415,13 +4445,6 @@ function Weekdays(props) {
|
|
|
4415
4445
|
}
|
|
4416
4446
|
return (React.createElement(Flex, { className: className$1, count: 7, onFocus: onMouseLeave, onMouseOver: onMouseLeave }, weekdays));
|
|
4417
4447
|
}
|
|
4418
|
-
Weekdays.propTypes = {
|
|
4419
|
-
calendarType: isCalendarType,
|
|
4420
|
-
formatShortWeekday: PropTypes.func,
|
|
4421
|
-
formatWeekday: PropTypes.func,
|
|
4422
|
-
locale: PropTypes.string,
|
|
4423
|
-
onMouseLeave: PropTypes.func,
|
|
4424
|
-
};
|
|
4425
4448
|
|
|
4426
4449
|
var __assign$2 = (undefined && undefined.__assign) || function () {
|
|
4427
4450
|
__assign$2 = Object.assign || function(t) {
|
|
@@ -4434,7 +4457,7 @@ var __assign$2 = (undefined && undefined.__assign) || function () {
|
|
|
4434
4457
|
};
|
|
4435
4458
|
return __assign$2.apply(this, arguments);
|
|
4436
4459
|
};
|
|
4437
|
-
var __rest$
|
|
4460
|
+
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
4438
4461
|
var t = {};
|
|
4439
4462
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4440
4463
|
t[p] = s[p];
|
|
@@ -4450,22 +4473,18 @@ function WeekNumber(props) {
|
|
|
4450
4473
|
var onClickWeekNumber = props.onClickWeekNumber, weekNumber = props.weekNumber;
|
|
4451
4474
|
var children = React.createElement("span", null, weekNumber);
|
|
4452
4475
|
if (onClickWeekNumber) {
|
|
4453
|
-
var date_1 = props.date, onClickWeekNumber_1 = props.onClickWeekNumber, weekNumber_1 = props.weekNumber, otherProps = __rest$
|
|
4476
|
+
var date_1 = props.date, onClickWeekNumber_1 = props.onClickWeekNumber, weekNumber_1 = props.weekNumber, otherProps = __rest$1(props, ["date", "onClickWeekNumber", "weekNumber"]);
|
|
4454
4477
|
return (React.createElement("button", __assign$2({}, otherProps, { className: className, onClick: function (event) { return onClickWeekNumber_1(weekNumber_1, date_1, event); }, type: "button" }), children));
|
|
4455
4478
|
}
|
|
4456
4479
|
else {
|
|
4457
|
-
props.date; props.onClickWeekNumber; props.weekNumber; var otherProps = __rest$
|
|
4480
|
+
props.date; props.onClickWeekNumber; props.weekNumber; var otherProps = __rest$1(props, ["date", "onClickWeekNumber", "weekNumber"]);
|
|
4458
4481
|
return (React.createElement("div", __assign$2({}, otherProps, { className: className }), children));
|
|
4459
4482
|
}
|
|
4460
4483
|
}
|
|
4461
|
-
WeekNumber.propTypes = {
|
|
4462
|
-
date: PropTypes.instanceOf(Date).isRequired,
|
|
4463
|
-
onClickWeekNumber: PropTypes.func,
|
|
4464
|
-
weekNumber: PropTypes.node.isRequired,
|
|
4465
|
-
};
|
|
4466
4484
|
|
|
4467
4485
|
function WeekNumbers(props) {
|
|
4468
|
-
var activeStartDate = props.activeStartDate,
|
|
4486
|
+
var activeStartDate = props.activeStartDate, calendarTypeOrDeprecatedCalendarType = props.calendarType, onClickWeekNumber = props.onClickWeekNumber, onMouseLeave = props.onMouseLeave, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks;
|
|
4487
|
+
var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);
|
|
4469
4488
|
var numberOfWeeks = (function () {
|
|
4470
4489
|
if (showFixedNumberOfWeeks) {
|
|
4471
4490
|
return 6;
|
|
@@ -4494,13 +4513,6 @@ function WeekNumbers(props) {
|
|
|
4494
4513
|
return (React.createElement(WeekNumber, { key: weekNumber, date: date, onClickWeekNumber: onClickWeekNumber, weekNumber: weekNumber }));
|
|
4495
4514
|
})));
|
|
4496
4515
|
}
|
|
4497
|
-
WeekNumbers.propTypes = {
|
|
4498
|
-
activeStartDate: PropTypes.instanceOf(Date).isRequired,
|
|
4499
|
-
calendarType: isCalendarType,
|
|
4500
|
-
onClickWeekNumber: PropTypes.func,
|
|
4501
|
-
onMouseLeave: PropTypes.func,
|
|
4502
|
-
showFixedNumberOfWeeks: PropTypes.bool,
|
|
4503
|
-
};
|
|
4504
4516
|
|
|
4505
4517
|
var __assign$1 = (undefined && undefined.__assign) || function () {
|
|
4506
4518
|
__assign$1 = Object.assign || function(t) {
|
|
@@ -4513,7 +4525,7 @@ var __assign$1 = (undefined && undefined.__assign) || function () {
|
|
|
4513
4525
|
};
|
|
4514
4526
|
return __assign$1.apply(this, arguments);
|
|
4515
4527
|
};
|
|
4516
|
-
var __rest
|
|
4528
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
4517
4529
|
var t = {};
|
|
4518
4530
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4519
4531
|
t[p] = s[p];
|
|
@@ -4525,17 +4537,19 @@ var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4525
4537
|
return t;
|
|
4526
4538
|
};
|
|
4527
4539
|
function getCalendarTypeFromLocale(locale) {
|
|
4528
|
-
|
|
4529
|
-
var
|
|
4530
|
-
|
|
4531
|
-
|
|
4540
|
+
if (locale) {
|
|
4541
|
+
for (var _i = 0, _a = Object.entries(CALENDAR_TYPE_LOCALES); _i < _a.length; _i++) {
|
|
4542
|
+
var _b = _a[_i], calendarType = _b[0], locales = _b[1];
|
|
4543
|
+
if (locales.includes(locale)) {
|
|
4544
|
+
return calendarType;
|
|
4545
|
+
}
|
|
4532
4546
|
}
|
|
4533
4547
|
}
|
|
4534
4548
|
return CALENDAR_TYPES.ISO_8601;
|
|
4535
4549
|
}
|
|
4536
|
-
function MonthView(props) {
|
|
4550
|
+
var MonthView = function MonthView(props) {
|
|
4537
4551
|
var activeStartDate = props.activeStartDate, locale = props.locale, onMouseLeave = props.onMouseLeave, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks;
|
|
4538
|
-
var _a = props.calendarType, calendarType = _a === void 0 ? getCalendarTypeFromLocale(locale) : _a, formatShortWeekday = props.formatShortWeekday, formatWeekday = props.formatWeekday, onClickWeekNumber = props.onClickWeekNumber, showWeekNumbers = props.showWeekNumbers, childProps = __rest
|
|
4552
|
+
var _a = props.calendarType, calendarType = _a === void 0 ? getCalendarTypeFromLocale(locale) : _a, formatShortWeekday = props.formatShortWeekday, formatWeekday = props.formatWeekday, onClickWeekNumber = props.onClickWeekNumber, showWeekNumbers = props.showWeekNumbers, childProps = __rest(props, ["calendarType", "formatShortWeekday", "formatWeekday", "onClickWeekNumber", "showWeekNumbers"]);
|
|
4539
4553
|
function renderWeekdays() {
|
|
4540
4554
|
return (React.createElement(Weekdays, { calendarType: calendarType, formatShortWeekday: formatShortWeekday, formatWeekday: formatWeekday, locale: locale, onMouseLeave: onMouseLeave }));
|
|
4541
4555
|
}
|
|
@@ -4561,24 +4575,10 @@ function MonthView(props) {
|
|
|
4561
4575
|
} },
|
|
4562
4576
|
renderWeekdays(),
|
|
4563
4577
|
renderDays()))));
|
|
4564
|
-
}
|
|
4578
|
+
};
|
|
4565
4579
|
MonthView.propTypes = __assign$1(__assign$1({}, tileGroupProps), { calendarType: isCalendarType, formatDay: PropTypes.func, formatLongDate: PropTypes.func, formatShortWeekday: PropTypes.func, formatWeekday: PropTypes.func, onClickWeekNumber: PropTypes.func, onMouseLeave: PropTypes.func, showFixedNumberOfWeeks: PropTypes.bool, showNeighboringMonth: PropTypes.bool, showWeekNumbers: PropTypes.bool });
|
|
4580
|
+
var MonthView$1 = MonthView;
|
|
4566
4581
|
|
|
4567
|
-
var __extends = (undefined && undefined.__extends) || (function () {
|
|
4568
|
-
var extendStatics = function (d, b) {
|
|
4569
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4570
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
4571
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
4572
|
-
return extendStatics(d, b);
|
|
4573
|
-
};
|
|
4574
|
-
return function (d, b) {
|
|
4575
|
-
if (typeof b !== "function" && b !== null)
|
|
4576
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
4577
|
-
extendStatics(d, b);
|
|
4578
|
-
function __() { this.constructor = d; }
|
|
4579
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4580
|
-
};
|
|
4581
|
-
})();
|
|
4582
4582
|
var __assign = (undefined && undefined.__assign) || function () {
|
|
4583
4583
|
__assign = Object.assign || function(t) {
|
|
4584
4584
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -4590,17 +4590,6 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
4590
4590
|
};
|
|
4591
4591
|
return __assign.apply(this, arguments);
|
|
4592
4592
|
};
|
|
4593
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
4594
|
-
var t = {};
|
|
4595
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4596
|
-
t[p] = s[p];
|
|
4597
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4598
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4599
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4600
|
-
t[p[i]] = s[p[i]];
|
|
4601
|
-
}
|
|
4602
|
-
return t;
|
|
4603
|
-
};
|
|
4604
4593
|
var baseClassName = 'react-calendar';
|
|
4605
4594
|
var allViews = ['century', 'decade', 'year', 'month'];
|
|
4606
4595
|
var allValueTypes = ['decade', 'year', 'month', 'day'];
|
|
@@ -4608,16 +4597,6 @@ var defaultMinDate = new Date();
|
|
|
4608
4597
|
defaultMinDate.setFullYear(1, 0, 1);
|
|
4609
4598
|
defaultMinDate.setHours(0, 0, 0, 0);
|
|
4610
4599
|
var defaultMaxDate = new Date(8.64e15);
|
|
4611
|
-
var defaultProps = {
|
|
4612
|
-
goToRangeStartOnSelect: true,
|
|
4613
|
-
maxDate: defaultMaxDate,
|
|
4614
|
-
maxDetail: 'month',
|
|
4615
|
-
minDate: defaultMinDate,
|
|
4616
|
-
minDetail: 'century',
|
|
4617
|
-
returnValue: 'start',
|
|
4618
|
-
showNavigation: true,
|
|
4619
|
-
showNeighboringMonth: true,
|
|
4620
|
-
};
|
|
4621
4600
|
function toDate(value) {
|
|
4622
4601
|
if (value instanceof Date) {
|
|
4623
4602
|
return value;
|
|
@@ -4692,8 +4671,8 @@ var getDetailValueTo = function (args) { return getDetailValue(args, 1); };
|
|
|
4692
4671
|
var getDetailValueArray = function (args) {
|
|
4693
4672
|
return [getDetailValueFrom, getDetailValueTo].map(function (fn) { return fn(args); });
|
|
4694
4673
|
};
|
|
4695
|
-
function getActiveStartDate(
|
|
4696
|
-
var maxDate =
|
|
4674
|
+
function getActiveStartDate(_a) {
|
|
4675
|
+
var maxDate = _a.maxDate, maxDetail = _a.maxDetail, minDate = _a.minDate, minDetail = _a.minDetail, value = _a.value, view = _a.view;
|
|
4697
4676
|
var rangeType = getView(view, minDetail, maxDetail);
|
|
4698
4677
|
var valueFrom = getDetailValueFrom({
|
|
4699
4678
|
value: value,
|
|
@@ -4703,316 +4682,76 @@ function getActiveStartDate(props) {
|
|
|
4703
4682
|
}) || new Date();
|
|
4704
4683
|
return getBegin(rangeType, valueFrom);
|
|
4705
4684
|
}
|
|
4706
|
-
function getInitialActiveStartDate(
|
|
4707
|
-
var activeStartDate =
|
|
4685
|
+
function getInitialActiveStartDate(_a) {
|
|
4686
|
+
var activeStartDate = _a.activeStartDate, defaultActiveStartDate = _a.defaultActiveStartDate, defaultValue = _a.defaultValue, defaultView = _a.defaultView, maxDate = _a.maxDate, maxDetail = _a.maxDetail, minDate = _a.minDate, minDetail = _a.minDetail, value = _a.value, view = _a.view;
|
|
4708
4687
|
var rangeType = getView(view, minDetail, maxDetail);
|
|
4709
4688
|
var valueFrom = activeStartDate || defaultActiveStartDate;
|
|
4710
4689
|
if (valueFrom) {
|
|
4711
4690
|
return getBegin(rangeType, valueFrom);
|
|
4712
4691
|
}
|
|
4713
|
-
return getActiveStartDate(
|
|
4692
|
+
return getActiveStartDate({
|
|
4693
|
+
maxDate: maxDate,
|
|
4694
|
+
maxDetail: maxDetail,
|
|
4695
|
+
minDate: minDate,
|
|
4696
|
+
minDetail: minDetail,
|
|
4697
|
+
value: value || defaultValue,
|
|
4698
|
+
view: view || defaultView,
|
|
4699
|
+
});
|
|
4714
4700
|
}
|
|
4715
4701
|
function getIsSingleValue(value) {
|
|
4716
4702
|
return value && (!Array.isArray(value) || value.length === 1);
|
|
4717
4703
|
}
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
var Calendar =
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
view: ('view' in nextState && nextState.view) || _this.view,
|
|
4751
|
-
};
|
|
4752
|
-
function shouldUpdate(key) {
|
|
4753
|
-
// Key must exist, and…
|
|
4754
|
-
if (!(key in nextState)) {
|
|
4755
|
-
return false;
|
|
4756
|
-
}
|
|
4757
|
-
var nextValue = nextState[key];
|
|
4758
|
-
var prevValue = prevArgs[key];
|
|
4759
|
-
// …key changed from defined to undefined or the other way around, or…
|
|
4760
|
-
if (typeof nextValue !== typeof prevValue) {
|
|
4761
|
-
return true;
|
|
4762
|
-
}
|
|
4763
|
-
// …value changed.
|
|
4764
|
-
if (nextValue instanceof Date && prevValue instanceof Date) {
|
|
4765
|
-
return nextValue.getTime() !== prevValue.getTime();
|
|
4766
|
-
}
|
|
4767
|
-
else {
|
|
4768
|
-
return nextValue !== prevValue;
|
|
4769
|
-
}
|
|
4770
|
-
}
|
|
4771
|
-
if (shouldUpdate('activeStartDate')) {
|
|
4772
|
-
if (onActiveStartDateChange)
|
|
4773
|
-
onActiveStartDateChange(args);
|
|
4774
|
-
}
|
|
4775
|
-
if (shouldUpdate('view')) {
|
|
4776
|
-
if (onViewChange)
|
|
4777
|
-
onViewChange(args);
|
|
4778
|
-
}
|
|
4779
|
-
if (shouldUpdate('value')) {
|
|
4780
|
-
if (onChange) {
|
|
4781
|
-
if (!event) {
|
|
4782
|
-
throw new Error('event is required');
|
|
4783
|
-
}
|
|
4784
|
-
if (selectRange) {
|
|
4785
|
-
var isSingleValue = getIsSingleValue(nextState.value);
|
|
4786
|
-
if (!isSingleValue) {
|
|
4787
|
-
onChange(nextState.value || null, event);
|
|
4788
|
-
}
|
|
4789
|
-
else if (allowPartialRange) {
|
|
4790
|
-
if (Array.isArray(nextState.value)) {
|
|
4791
|
-
throw new Error('value must not be an array');
|
|
4792
|
-
}
|
|
4793
|
-
onChange([nextState.value || null, null], event);
|
|
4794
|
-
}
|
|
4795
|
-
}
|
|
4796
|
-
else {
|
|
4797
|
-
onChange(nextState.value || null, event);
|
|
4798
|
-
}
|
|
4799
|
-
}
|
|
4800
|
-
}
|
|
4801
|
-
if (callback)
|
|
4802
|
-
callback(args);
|
|
4803
|
-
});
|
|
4804
|
-
};
|
|
4805
|
-
/**
|
|
4806
|
-
* Called when the user uses navigation buttons.
|
|
4807
|
-
*/
|
|
4808
|
-
_this.setActiveStartDate = function (nextActiveStartDate, action) {
|
|
4809
|
-
_this.setStateAndCallCallbacks({
|
|
4810
|
-
action: action,
|
|
4811
|
-
activeStartDate: nextActiveStartDate,
|
|
4812
|
-
});
|
|
4813
|
-
};
|
|
4814
|
-
_this.drillDown = function (nextActiveStartDate, event) {
|
|
4815
|
-
if (!_this.drillDownAvailable) {
|
|
4816
|
-
return;
|
|
4817
|
-
}
|
|
4818
|
-
_this.onClickTile(nextActiveStartDate, event);
|
|
4819
|
-
var _a = _this, view = _a.view, views = _a.views;
|
|
4820
|
-
var onDrillDown = _this.props.onDrillDown;
|
|
4821
|
-
var nextView = views[views.indexOf(view) + 1];
|
|
4822
|
-
if (!nextView) {
|
|
4823
|
-
throw new Error('Attempted to drill down from the lowest view.');
|
|
4824
|
-
}
|
|
4825
|
-
_this.setStateAndCallCallbacks({
|
|
4826
|
-
action: 'drillDown',
|
|
4827
|
-
activeStartDate: nextActiveStartDate,
|
|
4828
|
-
view: nextView,
|
|
4829
|
-
}, undefined, onDrillDown);
|
|
4830
|
-
};
|
|
4831
|
-
_this.drillUp = function () {
|
|
4832
|
-
if (!_this.drillUpAvailable) {
|
|
4833
|
-
return;
|
|
4834
|
-
}
|
|
4835
|
-
var _a = _this, activeStartDate = _a.activeStartDate, view = _a.view, views = _a.views;
|
|
4836
|
-
var onDrillUp = _this.props.onDrillUp;
|
|
4837
|
-
var nextView = views[views.indexOf(view) - 1];
|
|
4838
|
-
if (!nextView) {
|
|
4839
|
-
throw new Error('Attempted to drill up from the highest view.');
|
|
4840
|
-
}
|
|
4841
|
-
var nextActiveStartDate = getBegin(nextView, activeStartDate);
|
|
4842
|
-
_this.setStateAndCallCallbacks({
|
|
4843
|
-
action: 'drillUp',
|
|
4844
|
-
activeStartDate: nextActiveStartDate,
|
|
4845
|
-
view: nextView,
|
|
4846
|
-
}, undefined, onDrillUp);
|
|
4847
|
-
};
|
|
4848
|
-
_this.onChange = function (value, event) {
|
|
4849
|
-
var previousValue = _this.value;
|
|
4850
|
-
var _a = _this.props, goToRangeStartOnSelect = _a.goToRangeStartOnSelect, selectRange = _a.selectRange;
|
|
4851
|
-
_this.onClickTile(value, event);
|
|
4852
|
-
var isFirstValueInRange = selectRange && !getIsSingleValue(previousValue);
|
|
4853
|
-
var nextValue;
|
|
4854
|
-
if (selectRange) {
|
|
4855
|
-
// Range selection turned on
|
|
4856
|
-
var valueType = _this.valueType;
|
|
4857
|
-
if (isFirstValueInRange) {
|
|
4858
|
-
// Value has 0 or 2 elements - either way we're starting a new array
|
|
4859
|
-
// First value
|
|
4860
|
-
nextValue = getBegin(valueType, value);
|
|
4861
|
-
}
|
|
4862
|
-
else {
|
|
4863
|
-
if (!previousValue) {
|
|
4864
|
-
throw new Error('previousValue is required');
|
|
4865
|
-
}
|
|
4866
|
-
if (Array.isArray(previousValue)) {
|
|
4867
|
-
throw new Error('previousValue must not be an array');
|
|
4868
|
-
}
|
|
4869
|
-
// Second value
|
|
4870
|
-
nextValue = getValueRange(valueType, previousValue, value);
|
|
4871
|
-
}
|
|
4872
|
-
}
|
|
4873
|
-
else {
|
|
4874
|
-
// Range selection turned off
|
|
4875
|
-
nextValue = _this.getProcessedValue(value);
|
|
4704
|
+
function areDatesEqual(date1, date2) {
|
|
4705
|
+
return date1 instanceof Date && date2 instanceof Date && date1.getTime() === date2.getTime();
|
|
4706
|
+
}
|
|
4707
|
+
var Calendar = forwardRef(function Calendar(props, ref) {
|
|
4708
|
+
var activeStartDateProps = props.activeStartDate, allowPartialRange = props.allowPartialRange, calendarType = props.calendarType, className = props.className, defaultActiveStartDate = props.defaultActiveStartDate, defaultValue = props.defaultValue, defaultView = props.defaultView, formatDay = props.formatDay, formatLongDate = props.formatLongDate, formatMonth = props.formatMonth, formatMonthYear = props.formatMonthYear, formatShortWeekday = props.formatShortWeekday, formatWeekday = props.formatWeekday, formatYear = props.formatYear, _a = props.goToRangeStartOnSelect, goToRangeStartOnSelect = _a === void 0 ? true : _a, inputRef = props.inputRef, locale = props.locale, _b = props.maxDate, maxDate = _b === void 0 ? defaultMaxDate : _b, _c = props.maxDetail, maxDetail = _c === void 0 ? 'month' : _c, _d = props.minDate, minDate = _d === void 0 ? defaultMinDate : _d, _e = props.minDetail, minDetail = _e === void 0 ? 'century' : _e, navigationAriaLabel = props.navigationAriaLabel, navigationAriaLive = props.navigationAriaLive, navigationLabel = props.navigationLabel, next2AriaLabel = props.next2AriaLabel, next2Label = props.next2Label, nextAriaLabel = props.nextAriaLabel, nextLabel = props.nextLabel, onActiveStartDateChange = props.onActiveStartDateChange, onChangeProps = props.onChange, onClickDay = props.onClickDay, onClickDecade = props.onClickDecade, onClickMonth = props.onClickMonth, onClickWeekNumber = props.onClickWeekNumber, onClickYear = props.onClickYear, onDrillDown = props.onDrillDown, onDrillUp = props.onDrillUp, onViewChange = props.onViewChange, prev2AriaLabel = props.prev2AriaLabel, prev2Label = props.prev2Label, prevAriaLabel = props.prevAriaLabel, prevLabel = props.prevLabel, _f = props.returnValue, returnValue = _f === void 0 ? 'start' : _f, selectRange = props.selectRange, showDoubleView = props.showDoubleView, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks, _g = props.showNavigation, showNavigation = _g === void 0 ? true : _g, _h = props.showNeighboringMonth, showNeighboringMonth = _h === void 0 ? true : _h, showWeekNumbers = props.showWeekNumbers, tileClassName = props.tileClassName, tileContent = props.tileContent, tileDisabled = props.tileDisabled, valueProps = props.value, viewProps = props.view;
|
|
4709
|
+
var _j = useState(defaultActiveStartDate), activeStartDateState = _j[0], setActiveStartDateState = _j[1];
|
|
4710
|
+
var _k = useState(null), hoverState = _k[0], setHoverState = _k[1];
|
|
4711
|
+
var _l = useState(Array.isArray(defaultValue)
|
|
4712
|
+
? defaultValue.map(function (el) { return (el !== null ? toDate(el) : null); })
|
|
4713
|
+
: defaultValue !== null && defaultValue !== undefined
|
|
4714
|
+
? toDate(defaultValue)
|
|
4715
|
+
: null), valueState = _l[0], setValueState = _l[1];
|
|
4716
|
+
var _m = useState(defaultView), viewState = _m[0], setViewState = _m[1];
|
|
4717
|
+
var activeStartDate = activeStartDateProps ||
|
|
4718
|
+
activeStartDateState ||
|
|
4719
|
+
getInitialActiveStartDate({
|
|
4720
|
+
activeStartDate: activeStartDateProps,
|
|
4721
|
+
defaultActiveStartDate: defaultActiveStartDate,
|
|
4722
|
+
defaultValue: defaultValue,
|
|
4723
|
+
defaultView: defaultView,
|
|
4724
|
+
maxDate: maxDate,
|
|
4725
|
+
maxDetail: maxDetail,
|
|
4726
|
+
minDate: minDate,
|
|
4727
|
+
minDetail: minDetail,
|
|
4728
|
+
value: valueProps,
|
|
4729
|
+
view: viewProps,
|
|
4730
|
+
});
|
|
4731
|
+
var value = (function () {
|
|
4732
|
+
var rawValue = (function () {
|
|
4733
|
+
// In the middle of range selection, use value from state
|
|
4734
|
+
if (selectRange && getIsSingleValue(valueState)) {
|
|
4735
|
+
return valueState;
|
|
4876
4736
|
}
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4737
|
+
return valueProps !== undefined ? valueProps : valueState;
|
|
4738
|
+
})();
|
|
4739
|
+
if (!rawValue) {
|
|
4740
|
+
return null;
|
|
4741
|
+
}
|
|
4742
|
+
return Array.isArray(rawValue)
|
|
4743
|
+
? rawValue.map(function (el) { return (el !== null ? toDate(el) : null); })
|
|
4744
|
+
: rawValue !== null
|
|
4745
|
+
? toDate(rawValue)
|
|
4885
4746
|
: null;
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
var view = _this.view;
|
|
4895
|
-
var _a = _this
|
|
4896
|
-
.props, onClickDay = _a.onClickDay, onClickDecade = _a.onClickDecade, onClickMonth = _a.onClickMonth, onClickYear = _a.onClickYear;
|
|
4897
|
-
var callback = (function () {
|
|
4898
|
-
switch (view) {
|
|
4899
|
-
case 'century':
|
|
4900
|
-
return onClickDecade;
|
|
4901
|
-
case 'decade':
|
|
4902
|
-
return onClickYear;
|
|
4903
|
-
case 'year':
|
|
4904
|
-
return onClickMonth;
|
|
4905
|
-
case 'month':
|
|
4906
|
-
return onClickDay;
|
|
4907
|
-
default:
|
|
4908
|
-
throw new Error("Invalid view: ".concat(view, "."));
|
|
4909
|
-
}
|
|
4910
|
-
})();
|
|
4911
|
-
if (callback)
|
|
4912
|
-
callback(value, event);
|
|
4913
|
-
};
|
|
4914
|
-
_this.onMouseOver = function (value) {
|
|
4915
|
-
_this.setState(function (prevState) {
|
|
4916
|
-
if (prevState.hover && prevState.hover.getTime() === value.getTime()) {
|
|
4917
|
-
return null;
|
|
4918
|
-
}
|
|
4919
|
-
return { hover: value };
|
|
4920
|
-
});
|
|
4921
|
-
};
|
|
4922
|
-
_this.onMouseLeave = function () {
|
|
4923
|
-
_this.setState({ hover: null });
|
|
4924
|
-
};
|
|
4925
|
-
return _this;
|
|
4926
|
-
}
|
|
4927
|
-
Object.defineProperty(Calendar.prototype, "activeStartDate", {
|
|
4928
|
-
get: function () {
|
|
4929
|
-
var activeStartDateProps = this.props.activeStartDate;
|
|
4930
|
-
var activeStartDateState = this.state.activeStartDate;
|
|
4931
|
-
return (activeStartDateProps ||
|
|
4932
|
-
activeStartDateState ||
|
|
4933
|
-
getInitialActiveStartDate(this.props));
|
|
4934
|
-
},
|
|
4935
|
-
enumerable: false,
|
|
4936
|
-
configurable: true
|
|
4937
|
-
});
|
|
4938
|
-
Object.defineProperty(Calendar.prototype, "value", {
|
|
4939
|
-
get: function () {
|
|
4940
|
-
var _a = this.props, selectRange = _a.selectRange, valueProps = _a.value;
|
|
4941
|
-
var valueState = this.state.value;
|
|
4942
|
-
var rawValue = (function () {
|
|
4943
|
-
// In the middle of range selection, use value from state
|
|
4944
|
-
if (selectRange && getIsSingleValue(valueState)) {
|
|
4945
|
-
return valueState;
|
|
4946
|
-
}
|
|
4947
|
-
return valueProps !== undefined ? valueProps : valueState;
|
|
4948
|
-
})();
|
|
4949
|
-
if (!rawValue) {
|
|
4950
|
-
return null;
|
|
4951
|
-
}
|
|
4952
|
-
return Array.isArray(rawValue)
|
|
4953
|
-
? rawValue.map(function (el) { return (el !== null ? toDate(el) : el); })
|
|
4954
|
-
: rawValue !== null
|
|
4955
|
-
? toDate(rawValue)
|
|
4956
|
-
: rawValue;
|
|
4957
|
-
},
|
|
4958
|
-
enumerable: false,
|
|
4959
|
-
configurable: true
|
|
4960
|
-
});
|
|
4961
|
-
Object.defineProperty(Calendar.prototype, "valueType", {
|
|
4962
|
-
get: function () {
|
|
4963
|
-
var maxDetail = this.props.maxDetail;
|
|
4964
|
-
return getValueType(maxDetail);
|
|
4965
|
-
},
|
|
4966
|
-
enumerable: false,
|
|
4967
|
-
configurable: true
|
|
4968
|
-
});
|
|
4969
|
-
Object.defineProperty(Calendar.prototype, "view", {
|
|
4970
|
-
get: function () {
|
|
4971
|
-
var _a = this.props, minDetail = _a.minDetail, maxDetail = _a.maxDetail, viewProps = _a.view;
|
|
4972
|
-
var viewState = this.state.view;
|
|
4973
|
-
return getView(viewProps || viewState, minDetail, maxDetail);
|
|
4974
|
-
},
|
|
4975
|
-
enumerable: false,
|
|
4976
|
-
configurable: true
|
|
4977
|
-
});
|
|
4978
|
-
Object.defineProperty(Calendar.prototype, "views", {
|
|
4979
|
-
get: function () {
|
|
4980
|
-
var _a = this.props, minDetail = _a.minDetail, maxDetail = _a.maxDetail;
|
|
4981
|
-
return getLimitedViews(minDetail, maxDetail);
|
|
4982
|
-
},
|
|
4983
|
-
enumerable: false,
|
|
4984
|
-
configurable: true
|
|
4985
|
-
});
|
|
4986
|
-
Object.defineProperty(Calendar.prototype, "hover", {
|
|
4987
|
-
get: function () {
|
|
4988
|
-
var selectRange = this.props.selectRange;
|
|
4989
|
-
var hover = this.state.hover;
|
|
4990
|
-
return selectRange ? hover : null;
|
|
4991
|
-
},
|
|
4992
|
-
enumerable: false,
|
|
4993
|
-
configurable: true
|
|
4994
|
-
});
|
|
4995
|
-
Object.defineProperty(Calendar.prototype, "drillDownAvailable", {
|
|
4996
|
-
get: function () {
|
|
4997
|
-
var _a = this, view = _a.view, views = _a.views;
|
|
4998
|
-
return views.indexOf(view) < views.length - 1;
|
|
4999
|
-
},
|
|
5000
|
-
enumerable: false,
|
|
5001
|
-
configurable: true
|
|
5002
|
-
});
|
|
5003
|
-
Object.defineProperty(Calendar.prototype, "drillUpAvailable", {
|
|
5004
|
-
get: function () {
|
|
5005
|
-
var _a = this, view = _a.view, views = _a.views;
|
|
5006
|
-
return views.indexOf(view) > 0;
|
|
5007
|
-
},
|
|
5008
|
-
enumerable: false,
|
|
5009
|
-
configurable: true
|
|
5010
|
-
});
|
|
5011
|
-
/**
|
|
5012
|
-
* Gets current value in a desired format.
|
|
5013
|
-
*/
|
|
5014
|
-
Calendar.prototype.getProcessedValue = function (value) {
|
|
5015
|
-
var _a = this.props, minDate = _a.minDate, maxDate = _a.maxDate, maxDetail = _a.maxDetail, returnValue = _a.returnValue;
|
|
4747
|
+
})();
|
|
4748
|
+
var valueType = getValueType(maxDetail);
|
|
4749
|
+
var view = getView(viewProps || viewState, minDetail, maxDetail);
|
|
4750
|
+
var views = getLimitedViews(minDetail, maxDetail);
|
|
4751
|
+
var hover = selectRange ? hoverState : null;
|
|
4752
|
+
var drillDownAvailable = views.indexOf(view) < views.length - 1;
|
|
4753
|
+
var drillUpAvailable = views.indexOf(view) > 0;
|
|
4754
|
+
var getProcessedValue = useCallback(function (value) {
|
|
5016
4755
|
var processFunction = (function () {
|
|
5017
4756
|
switch (returnValue) {
|
|
5018
4757
|
case 'start':
|
|
@@ -5026,28 +4765,232 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
5026
4765
|
}
|
|
5027
4766
|
})();
|
|
5028
4767
|
return processFunction({
|
|
5029
|
-
value: value,
|
|
5030
|
-
minDate: minDate,
|
|
5031
4768
|
maxDate: maxDate,
|
|
5032
4769
|
maxDetail: maxDetail,
|
|
4770
|
+
minDate: minDate,
|
|
4771
|
+
value: value,
|
|
5033
4772
|
});
|
|
5034
|
-
};
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
var
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
:
|
|
5042
|
-
|
|
4773
|
+
}, [maxDate, maxDetail, minDate, returnValue]);
|
|
4774
|
+
var setActiveStartDate = useCallback(function (nextActiveStartDate, action) {
|
|
4775
|
+
setActiveStartDateState(nextActiveStartDate);
|
|
4776
|
+
var args = {
|
|
4777
|
+
action: action,
|
|
4778
|
+
activeStartDate: nextActiveStartDate,
|
|
4779
|
+
value: value,
|
|
4780
|
+
view: view,
|
|
4781
|
+
};
|
|
4782
|
+
if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {
|
|
4783
|
+
onActiveStartDateChange(args);
|
|
4784
|
+
}
|
|
4785
|
+
}, [activeStartDate, onActiveStartDateChange, value, view]);
|
|
4786
|
+
var onClickTile = useCallback(function (value, event) {
|
|
4787
|
+
var callback = (function () {
|
|
4788
|
+
switch (view) {
|
|
4789
|
+
case 'century':
|
|
4790
|
+
return onClickDecade;
|
|
4791
|
+
case 'decade':
|
|
4792
|
+
return onClickYear;
|
|
4793
|
+
case 'year':
|
|
4794
|
+
return onClickMonth;
|
|
4795
|
+
case 'month':
|
|
4796
|
+
return onClickDay;
|
|
4797
|
+
default:
|
|
4798
|
+
throw new Error("Invalid view: ".concat(view, "."));
|
|
4799
|
+
}
|
|
4800
|
+
})();
|
|
4801
|
+
if (callback)
|
|
4802
|
+
callback(value, event);
|
|
4803
|
+
}, [onClickDay, onClickDecade, onClickMonth, onClickYear, view]);
|
|
4804
|
+
var drillDown = useCallback(function (nextActiveStartDate, event) {
|
|
4805
|
+
if (!drillDownAvailable) {
|
|
4806
|
+
return;
|
|
4807
|
+
}
|
|
4808
|
+
onClickTile(nextActiveStartDate, event);
|
|
4809
|
+
var nextView = views[views.indexOf(view) + 1];
|
|
4810
|
+
if (!nextView) {
|
|
4811
|
+
throw new Error('Attempted to drill down from the lowest view.');
|
|
4812
|
+
}
|
|
4813
|
+
setActiveStartDateState(nextActiveStartDate);
|
|
4814
|
+
setViewState(nextView);
|
|
4815
|
+
var args = {
|
|
4816
|
+
action: 'drillDown',
|
|
4817
|
+
activeStartDate: nextActiveStartDate,
|
|
4818
|
+
value: value,
|
|
4819
|
+
view: nextView,
|
|
4820
|
+
};
|
|
4821
|
+
if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {
|
|
4822
|
+
onActiveStartDateChange(args);
|
|
4823
|
+
}
|
|
4824
|
+
if (onViewChange && view !== nextView) {
|
|
4825
|
+
onViewChange(args);
|
|
4826
|
+
}
|
|
4827
|
+
if (onDrillDown) {
|
|
4828
|
+
onDrillDown(args);
|
|
4829
|
+
}
|
|
4830
|
+
}, [
|
|
4831
|
+
activeStartDate,
|
|
4832
|
+
drillDownAvailable,
|
|
4833
|
+
onActiveStartDateChange,
|
|
4834
|
+
onClickTile,
|
|
4835
|
+
onDrillDown,
|
|
4836
|
+
onViewChange,
|
|
4837
|
+
value,
|
|
4838
|
+
view,
|
|
4839
|
+
views,
|
|
4840
|
+
]);
|
|
4841
|
+
var drillUp = useCallback(function () {
|
|
4842
|
+
if (!drillUpAvailable) {
|
|
4843
|
+
return;
|
|
4844
|
+
}
|
|
4845
|
+
var nextView = views[views.indexOf(view) - 1];
|
|
4846
|
+
if (!nextView) {
|
|
4847
|
+
throw new Error('Attempted to drill up from the highest view.');
|
|
4848
|
+
}
|
|
4849
|
+
var nextActiveStartDate = getBegin(nextView, activeStartDate);
|
|
4850
|
+
setActiveStartDateState(nextActiveStartDate);
|
|
4851
|
+
setViewState(nextView);
|
|
4852
|
+
var args = {
|
|
4853
|
+
action: 'drillUp',
|
|
4854
|
+
activeStartDate: nextActiveStartDate,
|
|
4855
|
+
value: value,
|
|
4856
|
+
view: nextView,
|
|
4857
|
+
};
|
|
4858
|
+
if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {
|
|
4859
|
+
onActiveStartDateChange(args);
|
|
4860
|
+
}
|
|
4861
|
+
if (onViewChange && view !== nextView) {
|
|
4862
|
+
onViewChange(args);
|
|
4863
|
+
}
|
|
4864
|
+
if (onDrillUp) {
|
|
4865
|
+
onDrillUp(args);
|
|
4866
|
+
}
|
|
4867
|
+
}, [
|
|
4868
|
+
activeStartDate,
|
|
4869
|
+
drillUpAvailable,
|
|
4870
|
+
onActiveStartDateChange,
|
|
4871
|
+
onDrillUp,
|
|
4872
|
+
onViewChange,
|
|
4873
|
+
value,
|
|
4874
|
+
view,
|
|
4875
|
+
views,
|
|
4876
|
+
]);
|
|
4877
|
+
var onChange = useCallback(function (rawNextValue, event) {
|
|
4878
|
+
var previousValue = value;
|
|
4879
|
+
onClickTile(rawNextValue, event);
|
|
4880
|
+
var isFirstValueInRange = selectRange && !getIsSingleValue(previousValue);
|
|
4881
|
+
var nextValue;
|
|
4882
|
+
if (selectRange) {
|
|
4883
|
+
// Range selection turned on
|
|
4884
|
+
if (isFirstValueInRange) {
|
|
4885
|
+
// Value has 0 or 2 elements - either way we're starting a new array
|
|
4886
|
+
// First value
|
|
4887
|
+
nextValue = getBegin(valueType, rawNextValue);
|
|
4888
|
+
}
|
|
4889
|
+
else {
|
|
4890
|
+
if (!previousValue) {
|
|
4891
|
+
throw new Error('previousValue is required');
|
|
4892
|
+
}
|
|
4893
|
+
if (Array.isArray(previousValue)) {
|
|
4894
|
+
throw new Error('previousValue must not be an array');
|
|
4895
|
+
}
|
|
4896
|
+
// Second value
|
|
4897
|
+
nextValue = getValueRange(valueType, previousValue, rawNextValue);
|
|
4898
|
+
}
|
|
4899
|
+
}
|
|
4900
|
+
else {
|
|
4901
|
+
// Range selection turned off
|
|
4902
|
+
nextValue = getProcessedValue(rawNextValue);
|
|
4903
|
+
}
|
|
4904
|
+
var nextActiveStartDate =
|
|
4905
|
+
// Range selection turned off
|
|
4906
|
+
!selectRange ||
|
|
4907
|
+
// Range selection turned on, first value
|
|
4908
|
+
isFirstValueInRange ||
|
|
4909
|
+
// Range selection turned on, second value, goToRangeStartOnSelect toggled on
|
|
4910
|
+
goToRangeStartOnSelect
|
|
4911
|
+
? getActiveStartDate({
|
|
4912
|
+
maxDate: maxDate,
|
|
4913
|
+
maxDetail: maxDetail,
|
|
4914
|
+
minDate: minDate,
|
|
4915
|
+
minDetail: minDetail,
|
|
4916
|
+
value: nextValue,
|
|
4917
|
+
view: view,
|
|
4918
|
+
})
|
|
4919
|
+
: null;
|
|
4920
|
+
event.persist();
|
|
4921
|
+
setActiveStartDateState(nextActiveStartDate);
|
|
4922
|
+
setValueState(nextValue);
|
|
4923
|
+
var args = {
|
|
4924
|
+
action: 'onChange',
|
|
4925
|
+
activeStartDate: nextActiveStartDate,
|
|
4926
|
+
value: nextValue,
|
|
4927
|
+
view: view,
|
|
4928
|
+
};
|
|
4929
|
+
if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {
|
|
4930
|
+
onActiveStartDateChange(args);
|
|
4931
|
+
}
|
|
4932
|
+
if (onChangeProps) {
|
|
4933
|
+
if (selectRange) {
|
|
4934
|
+
var isSingleValue = getIsSingleValue(nextValue);
|
|
4935
|
+
if (!isSingleValue) {
|
|
4936
|
+
onChangeProps(nextValue || null, event);
|
|
4937
|
+
}
|
|
4938
|
+
else if (allowPartialRange) {
|
|
4939
|
+
if (Array.isArray(nextValue)) {
|
|
4940
|
+
throw new Error('value must not be an array');
|
|
4941
|
+
}
|
|
4942
|
+
onChangeProps([nextValue || null, null], event);
|
|
4943
|
+
}
|
|
4944
|
+
}
|
|
4945
|
+
else {
|
|
4946
|
+
onChangeProps(nextValue || null, event);
|
|
4947
|
+
}
|
|
4948
|
+
}
|
|
4949
|
+
}, [
|
|
4950
|
+
activeStartDate,
|
|
4951
|
+
allowPartialRange,
|
|
4952
|
+
getProcessedValue,
|
|
4953
|
+
goToRangeStartOnSelect,
|
|
4954
|
+
maxDate,
|
|
4955
|
+
maxDetail,
|
|
4956
|
+
minDate,
|
|
4957
|
+
minDetail,
|
|
4958
|
+
onActiveStartDateChange,
|
|
4959
|
+
onChangeProps,
|
|
4960
|
+
onClickTile,
|
|
4961
|
+
selectRange,
|
|
4962
|
+
value,
|
|
4963
|
+
valueType,
|
|
4964
|
+
view,
|
|
4965
|
+
]);
|
|
4966
|
+
function onMouseOver(nextHover) {
|
|
4967
|
+
setHoverState(nextHover);
|
|
4968
|
+
}
|
|
4969
|
+
function onMouseLeave() {
|
|
4970
|
+
setHoverState(null);
|
|
4971
|
+
}
|
|
4972
|
+
useImperativeHandle(ref, function () { return ({
|
|
4973
|
+
activeStartDate: activeStartDate,
|
|
4974
|
+
drillDown: drillDown,
|
|
4975
|
+
drillUp: drillUp,
|
|
4976
|
+
onChange: onChange,
|
|
4977
|
+
setActiveStartDate: setActiveStartDate,
|
|
4978
|
+
value: value,
|
|
4979
|
+
view: view,
|
|
4980
|
+
}); }, [activeStartDate, drillDown, drillUp, onChange, setActiveStartDate, value, view]);
|
|
4981
|
+
function renderContent(next) {
|
|
4982
|
+
var currentActiveStartDate = next
|
|
4983
|
+
? getBeginNext(view, activeStartDate)
|
|
4984
|
+
: getBegin(view, activeStartDate);
|
|
4985
|
+
var onClick = drillDownAvailable ? drillDown : onChange;
|
|
5043
4986
|
var commonProps = {
|
|
5044
|
-
activeStartDate:
|
|
4987
|
+
activeStartDate: currentActiveStartDate,
|
|
5045
4988
|
hover: hover,
|
|
5046
4989
|
locale: locale,
|
|
5047
4990
|
maxDate: maxDate,
|
|
5048
4991
|
minDate: minDate,
|
|
5049
4992
|
onClick: onClick,
|
|
5050
|
-
onMouseOver: selectRange ? onMouseOver :
|
|
4993
|
+
onMouseOver: selectRange ? onMouseOver : undefined,
|
|
5051
4994
|
tileClassName: tileClassName,
|
|
5052
4995
|
tileContent: tileContent,
|
|
5053
4996
|
tileDisabled: tileDisabled,
|
|
@@ -5056,107 +4999,95 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
5056
4999
|
};
|
|
5057
5000
|
switch (view) {
|
|
5058
5001
|
case 'century': {
|
|
5059
|
-
|
|
5060
|
-
return React.createElement(CenturyView, __assign({ formatYear: formatYear }, commonProps));
|
|
5002
|
+
return React.createElement(CenturyView$1, __assign({ formatYear: formatYear }, commonProps));
|
|
5061
5003
|
}
|
|
5062
5004
|
case 'decade': {
|
|
5063
|
-
|
|
5064
|
-
return React.createElement(DecadeView, __assign({ formatYear: formatYear }, commonProps));
|
|
5005
|
+
return React.createElement(DecadeView$1, __assign({ formatYear: formatYear }, commonProps));
|
|
5065
5006
|
}
|
|
5066
5007
|
case 'year': {
|
|
5067
|
-
|
|
5068
|
-
return (React.createElement(YearView, __assign({ formatMonth: formatMonth, formatMonthYear: formatMonthYear }, commonProps)));
|
|
5008
|
+
return (React.createElement(YearView$1, __assign({ formatMonth: formatMonth, formatMonthYear: formatMonthYear }, commonProps)));
|
|
5069
5009
|
}
|
|
5070
5010
|
case 'month': {
|
|
5071
|
-
|
|
5072
|
-
var onMouseLeave = this.onMouseLeave;
|
|
5073
|
-
return (React.createElement(MonthView, __assign({ calendarType: calendarType, formatDay: formatDay, formatLongDate: formatLongDate, formatShortWeekday: formatShortWeekday, formatWeekday: formatWeekday, onClickWeekNumber: onClickWeekNumber, onMouseLeave: selectRange ? onMouseLeave : null, showFixedNumberOfWeeks: typeof showFixedNumberOfWeeks !== 'undefined'
|
|
5011
|
+
return (React.createElement(MonthView$1, __assign({ calendarType: calendarType, formatDay: formatDay, formatLongDate: formatLongDate, formatShortWeekday: formatShortWeekday, formatWeekday: formatWeekday, onClickWeekNumber: onClickWeekNumber, onMouseLeave: selectRange ? onMouseLeave : undefined, showFixedNumberOfWeeks: typeof showFixedNumberOfWeeks !== 'undefined'
|
|
5074
5012
|
? showFixedNumberOfWeeks
|
|
5075
5013
|
: showDoubleView, showNeighboringMonth: showNeighboringMonth, showWeekNumbers: showWeekNumbers }, commonProps)));
|
|
5076
5014
|
}
|
|
5077
5015
|
default:
|
|
5078
5016
|
throw new Error("Invalid view: ".concat(view, "."));
|
|
5079
5017
|
}
|
|
5080
|
-
}
|
|
5081
|
-
|
|
5082
|
-
var showNavigation = this.props.showNavigation;
|
|
5018
|
+
}
|
|
5019
|
+
function renderNavigation() {
|
|
5083
5020
|
if (!showNavigation) {
|
|
5084
5021
|
return null;
|
|
5085
5022
|
}
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
}
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
tileDisabled: PropTypes.func,
|
|
5155
|
-
value: isValueOrValueArray,
|
|
5156
|
-
view: isView,
|
|
5157
|
-
};
|
|
5158
|
-
return Calendar;
|
|
5159
|
-
}(Component));
|
|
5023
|
+
return (React.createElement(Navigation, { activeStartDate: activeStartDate, drillUp: drillUp, formatMonthYear: formatMonthYear, formatYear: formatYear, locale: locale, maxDate: maxDate, minDate: minDate, navigationAriaLabel: navigationAriaLabel, navigationAriaLive: navigationAriaLive, navigationLabel: navigationLabel, next2AriaLabel: next2AriaLabel, next2Label: next2Label, nextAriaLabel: nextAriaLabel, nextLabel: nextLabel, prev2AriaLabel: prev2AriaLabel, prev2Label: prev2Label, prevAriaLabel: prevAriaLabel, prevLabel: prevLabel, setActiveStartDate: setActiveStartDate, showDoubleView: showDoubleView, view: view, views: views }));
|
|
5024
|
+
}
|
|
5025
|
+
var valueArray = Array.isArray(value) ? value : [value];
|
|
5026
|
+
return (React.createElement("div", { className: clsx(baseClassName, selectRange && valueArray.length === 1 && "".concat(baseClassName, "--selectRange"), showDoubleView && "".concat(baseClassName, "--doubleView"), className), ref: inputRef },
|
|
5027
|
+
renderNavigation(),
|
|
5028
|
+
React.createElement("div", { className: "".concat(baseClassName, "__viewContainer"), onBlur: selectRange ? onMouseLeave : undefined, onMouseLeave: selectRange ? onMouseLeave : undefined },
|
|
5029
|
+
renderContent(),
|
|
5030
|
+
showDoubleView ? renderContent(true) : null)));
|
|
5031
|
+
});
|
|
5032
|
+
var isActiveStartDate = PropTypes.instanceOf(Date);
|
|
5033
|
+
var isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]);
|
|
5034
|
+
var isValueOrValueArray = PropTypes.oneOfType([isValue, rangeOf(isValue)]);
|
|
5035
|
+
Calendar.propTypes = {
|
|
5036
|
+
activeStartDate: isActiveStartDate,
|
|
5037
|
+
allowPartialRange: PropTypes.bool,
|
|
5038
|
+
calendarType: isCalendarType,
|
|
5039
|
+
className: isClassName,
|
|
5040
|
+
defaultActiveStartDate: isActiveStartDate,
|
|
5041
|
+
defaultValue: isValueOrValueArray,
|
|
5042
|
+
defaultView: isView,
|
|
5043
|
+
formatDay: PropTypes.func,
|
|
5044
|
+
formatLongDate: PropTypes.func,
|
|
5045
|
+
formatMonth: PropTypes.func,
|
|
5046
|
+
formatMonthYear: PropTypes.func,
|
|
5047
|
+
formatShortWeekday: PropTypes.func,
|
|
5048
|
+
formatWeekday: PropTypes.func,
|
|
5049
|
+
formatYear: PropTypes.func,
|
|
5050
|
+
goToRangeStartOnSelect: PropTypes.bool,
|
|
5051
|
+
inputRef: isRef,
|
|
5052
|
+
locale: PropTypes.string,
|
|
5053
|
+
maxDate: isMaxDate,
|
|
5054
|
+
maxDetail: PropTypes.oneOf(allViews),
|
|
5055
|
+
minDate: isMinDate,
|
|
5056
|
+
minDetail: PropTypes.oneOf(allViews),
|
|
5057
|
+
navigationAriaLabel: PropTypes.string,
|
|
5058
|
+
navigationAriaLive: PropTypes.oneOf(['off', 'polite', 'assertive']),
|
|
5059
|
+
navigationLabel: PropTypes.func,
|
|
5060
|
+
next2AriaLabel: PropTypes.string,
|
|
5061
|
+
next2Label: PropTypes.node,
|
|
5062
|
+
nextAriaLabel: PropTypes.string,
|
|
5063
|
+
nextLabel: PropTypes.node,
|
|
5064
|
+
onActiveStartDateChange: PropTypes.func,
|
|
5065
|
+
onChange: PropTypes.func,
|
|
5066
|
+
onClickDay: PropTypes.func,
|
|
5067
|
+
onClickDecade: PropTypes.func,
|
|
5068
|
+
onClickMonth: PropTypes.func,
|
|
5069
|
+
onClickWeekNumber: PropTypes.func,
|
|
5070
|
+
onClickYear: PropTypes.func,
|
|
5071
|
+
onDrillDown: PropTypes.func,
|
|
5072
|
+
onDrillUp: PropTypes.func,
|
|
5073
|
+
onViewChange: PropTypes.func,
|
|
5074
|
+
prev2AriaLabel: PropTypes.string,
|
|
5075
|
+
prev2Label: PropTypes.node,
|
|
5076
|
+
prevAriaLabel: PropTypes.string,
|
|
5077
|
+
prevLabel: PropTypes.node,
|
|
5078
|
+
returnValue: PropTypes.oneOf(['start', 'end', 'range']),
|
|
5079
|
+
selectRange: PropTypes.bool,
|
|
5080
|
+
showDoubleView: PropTypes.bool,
|
|
5081
|
+
showFixedNumberOfWeeks: PropTypes.bool,
|
|
5082
|
+
showNavigation: PropTypes.bool,
|
|
5083
|
+
showNeighboringMonth: PropTypes.bool,
|
|
5084
|
+
showWeekNumbers: PropTypes.bool,
|
|
5085
|
+
tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
|
|
5086
|
+
tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
5087
|
+
tileDisabled: PropTypes.func,
|
|
5088
|
+
value: isValueOrValueArray,
|
|
5089
|
+
view: isView,
|
|
5090
|
+
};
|
|
5160
5091
|
var Calendar$1 = Calendar;
|
|
5161
5092
|
|
|
5162
5093
|
var css_248z$G = ".DatePicker-module_datePicker__mTJ3f {\n width: 100%;\n}";
|
|
@@ -7295,7 +7226,7 @@ Array.prototype.distinct = function (comparator) {
|
|
|
7295
7226
|
};
|
|
7296
7227
|
|
|
7297
7228
|
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
7298
|
-
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",
|
|
7229
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
7299
7230
|
});
|
|
7300
7231
|
|
|
7301
7232
|
var localizedFormat = createCommonjsModule(function (module, exports) {
|