@redis-ui/components 46.1.2 → 47.0.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/dist/Toast/Toaster.style.cjs +2 -2
- package/dist/Toast/Toaster.style.js +2 -2
- package/dist/Toast/core/mapping.helpers.cjs +1 -1
- package/dist/Toast/core/mapping.helpers.js +1 -1
- package/dist/index.cjs +1 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -4
- package/dist/node_modules/react-loading-skeleton/dist/index.cjs +2 -1
- package/dist/node_modules/react-loading-skeleton/dist/index.js +2 -1
- package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.cjs +3 -3
- package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.js +2 -2
- package/package.json +3 -5
- package/skills/redis-ui-components/SKILL.md +0 -1
- package/dist/DatePicker/DatePicker.cjs +0 -32
- package/dist/DatePicker/DatePicker.d.ts +0 -6
- package/dist/DatePicker/DatePicker.js +0 -31
- package/dist/DatePicker/DatePicker.style.cjs +0 -251
- package/dist/DatePicker/DatePicker.style.d.ts +0 -3
- package/dist/DatePicker/DatePicker.style.js +0 -249
- package/dist/DatePicker/DatePicker.types.d.ts +0 -17
- package/dist/DatePicker/DatePicker.types.js +0 -1
- package/dist/DatePicker/DatePicker.utils.cjs +0 -7
- package/dist/DatePicker/DatePicker.utils.d.ts +0 -2
- package/dist/DatePicker/DatePicker.utils.js +0 -6
- package/dist/DatePicker/RangeDatePicker.cjs +0 -30
- package/dist/DatePicker/RangeDatePicker.d.ts +0 -3
- package/dist/DatePicker/RangeDatePicker.js +0 -29
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.cjs +0 -34
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.d.ts +0 -3
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.js +0 -32
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.cjs +0 -11
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.d.ts +0 -2
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.js +0 -10
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.cjs +0 -11
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.d.ts +0 -2
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.js +0 -10
- package/dist/DatePicker/index.d.ts +0 -3
- package/dist/DatePicker/index.js +0 -2
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.cjs +0 -6
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +0 -6
- package/dist/node_modules/date-fns/_lib/defaultOptions.cjs +0 -7
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
- package/dist/node_modules/date-fns/_lib/format/formatters.cjs +0 -418
- package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -418
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.cjs +0 -45
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -45
- package/dist/node_modules/date-fns/_lib/format/longFormatters.cjs +0 -45
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -45
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs +0 -21
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -21
- package/dist/node_modules/date-fns/_lib/protectedTokens.cjs +0 -28
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +0 -26
- package/dist/node_modules/date-fns/addDays.cjs +0 -32
- package/dist/node_modules/date-fns/addDays.js +0 -32
- package/dist/node_modules/date-fns/addMonths.cjs +0 -42
- package/dist/node_modules/date-fns/addMonths.js +0 -42
- package/dist/node_modules/date-fns/addWeeks.cjs +0 -27
- package/dist/node_modules/date-fns/addWeeks.js +0 -27
- package/dist/node_modules/date-fns/addYears.cjs +0 -27
- package/dist/node_modules/date-fns/addYears.js +0 -27
- package/dist/node_modules/date-fns/constants.cjs +0 -39
- package/dist/node_modules/date-fns/constants.js +0 -38
- package/dist/node_modules/date-fns/constructFrom.cjs +0 -37
- package/dist/node_modules/date-fns/constructFrom.js +0 -37
- package/dist/node_modules/date-fns/differenceInCalendarDays.cjs +0 -45
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +0 -45
- package/dist/node_modules/date-fns/differenceInCalendarMonths.cjs +0 -34
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +0 -34
- package/dist/node_modules/date-fns/differenceInCalendarWeeks.cjs +0 -50
- package/dist/node_modules/date-fns/differenceInCalendarWeeks.js +0 -50
- package/dist/node_modules/date-fns/endOfISOWeek.cjs +0 -29
- package/dist/node_modules/date-fns/endOfISOWeek.js +0 -29
- package/dist/node_modules/date-fns/endOfMonth.cjs +0 -31
- package/dist/node_modules/date-fns/endOfMonth.js +0 -31
- package/dist/node_modules/date-fns/endOfWeek.cjs +0 -44
- package/dist/node_modules/date-fns/endOfWeek.js +0 -44
- package/dist/node_modules/date-fns/format.cjs +0 -357
- package/dist/node_modules/date-fns/format.js +0 -357
- package/dist/node_modules/date-fns/getDayOfYear.cjs +0 -29
- package/dist/node_modules/date-fns/getDayOfYear.js +0 -29
- package/dist/node_modules/date-fns/getDaysInMonth.cjs +0 -33
- package/dist/node_modules/date-fns/getDaysInMonth.js +0 -33
- package/dist/node_modules/date-fns/getISOWeek.cjs +0 -33
- package/dist/node_modules/date-fns/getISOWeek.js +0 -33
- package/dist/node_modules/date-fns/getISOWeekYear.cjs +0 -43
- package/dist/node_modules/date-fns/getISOWeekYear.js +0 -43
- package/dist/node_modules/date-fns/getUnixTime.cjs +0 -26
- package/dist/node_modules/date-fns/getUnixTime.js +0 -26
- package/dist/node_modules/date-fns/getWeek.cjs +0 -51
- package/dist/node_modules/date-fns/getWeek.js +0 -51
- package/dist/node_modules/date-fns/getWeekYear.cjs +0 -63
- package/dist/node_modules/date-fns/getWeekYear.js +0 -63
- package/dist/node_modules/date-fns/getWeeksInMonth.cjs +0 -38
- package/dist/node_modules/date-fns/getWeeksInMonth.js +0 -38
- package/dist/node_modules/date-fns/isAfter.cjs +0 -29
- package/dist/node_modules/date-fns/isAfter.js +0 -29
- package/dist/node_modules/date-fns/isBefore.cjs +0 -29
- package/dist/node_modules/date-fns/isBefore.js +0 -29
- package/dist/node_modules/date-fns/isDate.cjs +0 -38
- package/dist/node_modules/date-fns/isDate.js +0 -38
- package/dist/node_modules/date-fns/isSameDay.cjs +0 -39
- package/dist/node_modules/date-fns/isSameDay.js +0 -39
- package/dist/node_modules/date-fns/isSameMonth.cjs +0 -34
- package/dist/node_modules/date-fns/isSameMonth.js +0 -34
- package/dist/node_modules/date-fns/isSameYear.cjs +0 -29
- package/dist/node_modules/date-fns/isSameYear.js +0 -29
- package/dist/node_modules/date-fns/isValid.cjs +0 -43
- package/dist/node_modules/date-fns/isValid.js +0 -43
- package/dist/node_modules/date-fns/lastDayOfMonth.cjs +0 -31
- package/dist/node_modules/date-fns/lastDayOfMonth.js +0 -31
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs +0 -9
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -9
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs +0 -51
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -51
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.cjs +0 -28
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -28
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs +0 -19
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -19
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs +0 -76
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -76
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.cjs +0 -32
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -32
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs +0 -12
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -12
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.cjs +0 -211
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -211
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.cjs +0 -123
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -124
- package/dist/node_modules/date-fns/locale/en-US.cjs +0 -28
- package/dist/node_modules/date-fns/locale/en-US.js +0 -28
- package/dist/node_modules/date-fns/max.cjs +0 -36
- package/dist/node_modules/date-fns/max.js +0 -36
- package/dist/node_modules/date-fns/min.cjs +0 -36
- package/dist/node_modules/date-fns/min.js +0 -36
- package/dist/node_modules/date-fns/setMonth.cjs +0 -37
- package/dist/node_modules/date-fns/setMonth.js +0 -37
- package/dist/node_modules/date-fns/setYear.cjs +0 -31
- package/dist/node_modules/date-fns/setYear.js +0 -31
- package/dist/node_modules/date-fns/startOfDay.cjs +0 -29
- package/dist/node_modules/date-fns/startOfDay.js +0 -29
- package/dist/node_modules/date-fns/startOfISOWeek.cjs +0 -29
- package/dist/node_modules/date-fns/startOfISOWeek.js +0 -29
- package/dist/node_modules/date-fns/startOfISOWeekYear.cjs +0 -36
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +0 -36
- package/dist/node_modules/date-fns/startOfMonth.cjs +0 -30
- package/dist/node_modules/date-fns/startOfMonth.js +0 -30
- package/dist/node_modules/date-fns/startOfWeek.cjs +0 -44
- package/dist/node_modules/date-fns/startOfWeek.js +0 -44
- package/dist/node_modules/date-fns/startOfWeekYear.cjs +0 -55
- package/dist/node_modules/date-fns/startOfWeekYear.js +0 -55
- package/dist/node_modules/date-fns/startOfYear.cjs +0 -32
- package/dist/node_modules/date-fns/startOfYear.js +0 -32
- package/dist/node_modules/date-fns/subDays.cjs +0 -27
- package/dist/node_modules/date-fns/subDays.js +0 -27
- package/dist/node_modules/date-fns/toDate.cjs +0 -41
- package/dist/node_modules/date-fns/toDate.js +0 -41
- package/dist/node_modules/react-day-picker/dist/index.esm.cjs +0 -2094
- package/dist/node_modules/react-day-picker/dist/index.esm.js +0 -2092
- package/skills/redis-ui-components/references/DatePicker.md +0 -52
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import toDate from "./toDate.js";
|
|
2
|
-
//#region ../../node_modules/date-fns/isSameMonth.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name isSameMonth
|
|
5
|
-
* @category Month Helpers
|
|
6
|
-
* @summary Are the given dates in the same month (and year)?
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Are the given dates in the same month (and year)?
|
|
10
|
-
*
|
|
11
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
12
|
-
*
|
|
13
|
-
* @param dateLeft - The first date to check
|
|
14
|
-
* @param dateRight - The second date to check
|
|
15
|
-
*
|
|
16
|
-
* @returns The dates are in the same month (and year)
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Are 2 September 2014 and 25 September 2014 in the same month?
|
|
20
|
-
* const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
|
|
21
|
-
* //=> true
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* // Are 2 September 2014 and 25 September 2015 in the same month?
|
|
25
|
-
* const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
|
|
26
|
-
* //=> false
|
|
27
|
-
*/
|
|
28
|
-
function isSameMonth(dateLeft, dateRight) {
|
|
29
|
-
const _dateLeft = toDate(dateLeft);
|
|
30
|
-
const _dateRight = toDate(dateRight);
|
|
31
|
-
return _dateLeft.getFullYear() === _dateRight.getFullYear() && _dateLeft.getMonth() === _dateRight.getMonth();
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { isSameMonth as default };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const require_toDate = require("./toDate.cjs");
|
|
2
|
-
//#region ../../node_modules/date-fns/isSameYear.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name isSameYear
|
|
5
|
-
* @category Year Helpers
|
|
6
|
-
* @summary Are the given dates in the same year?
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Are the given dates in the same year?
|
|
10
|
-
*
|
|
11
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
12
|
-
*
|
|
13
|
-
* @param dateLeft - The first date to check
|
|
14
|
-
* @param dateRight - The second date to check
|
|
15
|
-
*
|
|
16
|
-
* @returns The dates are in the same year
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Are 2 September 2014 and 25 September 2014 in the same year?
|
|
20
|
-
* const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
|
|
21
|
-
* //=> true
|
|
22
|
-
*/
|
|
23
|
-
function isSameYear(dateLeft, dateRight) {
|
|
24
|
-
const _dateLeft = require_toDate.default(dateLeft);
|
|
25
|
-
const _dateRight = require_toDate.default(dateRight);
|
|
26
|
-
return _dateLeft.getFullYear() === _dateRight.getFullYear();
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
exports.default = isSameYear;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import toDate from "./toDate.js";
|
|
2
|
-
//#region ../../node_modules/date-fns/isSameYear.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name isSameYear
|
|
5
|
-
* @category Year Helpers
|
|
6
|
-
* @summary Are the given dates in the same year?
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Are the given dates in the same year?
|
|
10
|
-
*
|
|
11
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
12
|
-
*
|
|
13
|
-
* @param dateLeft - The first date to check
|
|
14
|
-
* @param dateRight - The second date to check
|
|
15
|
-
*
|
|
16
|
-
* @returns The dates are in the same year
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Are 2 September 2014 and 25 September 2014 in the same year?
|
|
20
|
-
* const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
|
|
21
|
-
* //=> true
|
|
22
|
-
*/
|
|
23
|
-
function isSameYear(dateLeft, dateRight) {
|
|
24
|
-
const _dateLeft = toDate(dateLeft);
|
|
25
|
-
const _dateRight = toDate(dateRight);
|
|
26
|
-
return _dateLeft.getFullYear() === _dateRight.getFullYear();
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { isSameYear as default };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const require_toDate = require("./toDate.cjs");
|
|
2
|
-
const require_isDate = require("./isDate.cjs");
|
|
3
|
-
//#region ../../node_modules/date-fns/isValid.mjs
|
|
4
|
-
/**
|
|
5
|
-
* @name isValid
|
|
6
|
-
* @category Common Helpers
|
|
7
|
-
* @summary Is the given date valid?
|
|
8
|
-
*
|
|
9
|
-
* @description
|
|
10
|
-
* Returns false if argument is Invalid Date and true otherwise.
|
|
11
|
-
* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
|
|
12
|
-
* Invalid Date is a Date, whose time value is NaN.
|
|
13
|
-
*
|
|
14
|
-
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
15
|
-
*
|
|
16
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
17
|
-
*
|
|
18
|
-
* @param date - The date to check
|
|
19
|
-
*
|
|
20
|
-
* @returns The date is valid
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* // For the valid date:
|
|
24
|
-
* const result = isValid(new Date(2014, 1, 31))
|
|
25
|
-
* //=> true
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* // For the value, convertable into a date:
|
|
29
|
-
* const result = isValid(1393804800000)
|
|
30
|
-
* //=> true
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* // For the invalid date:
|
|
34
|
-
* const result = isValid(new Date(''))
|
|
35
|
-
* //=> false
|
|
36
|
-
*/
|
|
37
|
-
function isValid(date) {
|
|
38
|
-
if (!require_isDate.default(date) && typeof date !== "number") return false;
|
|
39
|
-
const _date = require_toDate.default(date);
|
|
40
|
-
return !isNaN(Number(_date));
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
exports.default = isValid;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import toDate from "./toDate.js";
|
|
2
|
-
import isDate from "./isDate.js";
|
|
3
|
-
//#region ../../node_modules/date-fns/isValid.mjs
|
|
4
|
-
/**
|
|
5
|
-
* @name isValid
|
|
6
|
-
* @category Common Helpers
|
|
7
|
-
* @summary Is the given date valid?
|
|
8
|
-
*
|
|
9
|
-
* @description
|
|
10
|
-
* Returns false if argument is Invalid Date and true otherwise.
|
|
11
|
-
* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
|
|
12
|
-
* Invalid Date is a Date, whose time value is NaN.
|
|
13
|
-
*
|
|
14
|
-
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
15
|
-
*
|
|
16
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
17
|
-
*
|
|
18
|
-
* @param date - The date to check
|
|
19
|
-
*
|
|
20
|
-
* @returns The date is valid
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* // For the valid date:
|
|
24
|
-
* const result = isValid(new Date(2014, 1, 31))
|
|
25
|
-
* //=> true
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* // For the value, convertable into a date:
|
|
29
|
-
* const result = isValid(1393804800000)
|
|
30
|
-
* //=> true
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* // For the invalid date:
|
|
34
|
-
* const result = isValid(new Date(''))
|
|
35
|
-
* //=> false
|
|
36
|
-
*/
|
|
37
|
-
function isValid(date) {
|
|
38
|
-
if (!isDate(date) && typeof date !== "number") return false;
|
|
39
|
-
const _date = toDate(date);
|
|
40
|
-
return !isNaN(Number(_date));
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { isValid as default };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const require_toDate = require("./toDate.cjs");
|
|
2
|
-
//#region ../../node_modules/date-fns/lastDayOfMonth.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name lastDayOfMonth
|
|
5
|
-
* @category Month Helpers
|
|
6
|
-
* @summary Return the last day of a month for the given date.
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Return the last day of a month for the given date.
|
|
10
|
-
* The result will be in the local timezone.
|
|
11
|
-
*
|
|
12
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
13
|
-
*
|
|
14
|
-
* @param date - The original date
|
|
15
|
-
*
|
|
16
|
-
* @returns The last day of a month
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // The last day of a month for 2 September 2014 11:55:00:
|
|
20
|
-
* const result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
21
|
-
* //=> Tue Sep 30 2014 00:00:00
|
|
22
|
-
*/
|
|
23
|
-
function lastDayOfMonth(date) {
|
|
24
|
-
const _date = require_toDate.default(date);
|
|
25
|
-
const month = _date.getMonth();
|
|
26
|
-
_date.setFullYear(_date.getFullYear(), month + 1, 0);
|
|
27
|
-
_date.setHours(0, 0, 0, 0);
|
|
28
|
-
return _date;
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
exports.default = lastDayOfMonth;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import toDate from "./toDate.js";
|
|
2
|
-
//#region ../../node_modules/date-fns/lastDayOfMonth.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name lastDayOfMonth
|
|
5
|
-
* @category Month Helpers
|
|
6
|
-
* @summary Return the last day of a month for the given date.
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Return the last day of a month for the given date.
|
|
10
|
-
* The result will be in the local timezone.
|
|
11
|
-
*
|
|
12
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
13
|
-
*
|
|
14
|
-
* @param date - The original date
|
|
15
|
-
*
|
|
16
|
-
* @returns The last day of a month
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // The last day of a month for 2 September 2014 11:55:00:
|
|
20
|
-
* const result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
21
|
-
* //=> Tue Sep 30 2014 00:00:00
|
|
22
|
-
*/
|
|
23
|
-
function lastDayOfMonth(date) {
|
|
24
|
-
const _date = toDate(date);
|
|
25
|
-
const month = _date.getMonth();
|
|
26
|
-
_date.setFullYear(_date.getFullYear(), month + 1, 0);
|
|
27
|
-
_date.setHours(0, 0, 0, 0);
|
|
28
|
-
return _date;
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
export { lastDayOfMonth as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs
|
|
2
|
-
function buildFormatLongFn(args) {
|
|
3
|
-
return (options = {}) => {
|
|
4
|
-
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
5
|
-
return args.formats[width] || args.formats[args.defaultWidth];
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.buildFormatLongFn = buildFormatLongFn;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs
|
|
2
|
-
function buildFormatLongFn(args) {
|
|
3
|
-
return (options = {}) => {
|
|
4
|
-
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
5
|
-
return args.formats[width] || args.formats[args.defaultWidth];
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { buildFormatLongFn };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs
|
|
2
|
-
/**
|
|
3
|
-
* The localize function argument callback which allows to convert raw value to
|
|
4
|
-
* the actual type.
|
|
5
|
-
*
|
|
6
|
-
* @param value - The value to convert
|
|
7
|
-
*
|
|
8
|
-
* @returns The converted value
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* The map of localized values for each width.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* The index type of the locale unit value. It types conversion of units of
|
|
15
|
-
* values that don't start at 0 (i.e. quarters).
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Converts the unit value to the tuple of values.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* The tuple of localized era values. The first element represents BC,
|
|
22
|
-
* the second element represents AD.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* The tuple of localized quarter values. The first element represents Q1.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* The tuple of localized day values. The first element represents Sunday.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* The tuple of localized month values. The first element represents January.
|
|
32
|
-
*/
|
|
33
|
-
function buildLocalizeFn(args) {
|
|
34
|
-
return (value, options) => {
|
|
35
|
-
const context = options?.context ? String(options.context) : "standalone";
|
|
36
|
-
let valuesArray;
|
|
37
|
-
if (context === "formatting" && args.formattingValues) {
|
|
38
|
-
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
39
|
-
const width = options?.width ? String(options.width) : defaultWidth;
|
|
40
|
-
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
41
|
-
} else {
|
|
42
|
-
const defaultWidth = args.defaultWidth;
|
|
43
|
-
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
44
|
-
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
45
|
-
}
|
|
46
|
-
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
47
|
-
return valuesArray[index];
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
exports.buildLocalizeFn = buildLocalizeFn;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs
|
|
2
|
-
/**
|
|
3
|
-
* The localize function argument callback which allows to convert raw value to
|
|
4
|
-
* the actual type.
|
|
5
|
-
*
|
|
6
|
-
* @param value - The value to convert
|
|
7
|
-
*
|
|
8
|
-
* @returns The converted value
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* The map of localized values for each width.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* The index type of the locale unit value. It types conversion of units of
|
|
15
|
-
* values that don't start at 0 (i.e. quarters).
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Converts the unit value to the tuple of values.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* The tuple of localized era values. The first element represents BC,
|
|
22
|
-
* the second element represents AD.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* The tuple of localized quarter values. The first element represents Q1.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* The tuple of localized day values. The first element represents Sunday.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* The tuple of localized month values. The first element represents January.
|
|
32
|
-
*/
|
|
33
|
-
function buildLocalizeFn(args) {
|
|
34
|
-
return (value, options) => {
|
|
35
|
-
const context = options?.context ? String(options.context) : "standalone";
|
|
36
|
-
let valuesArray;
|
|
37
|
-
if (context === "formatting" && args.formattingValues) {
|
|
38
|
-
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
39
|
-
const width = options?.width ? String(options.width) : defaultWidth;
|
|
40
|
-
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
41
|
-
} else {
|
|
42
|
-
const defaultWidth = args.defaultWidth;
|
|
43
|
-
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
44
|
-
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
45
|
-
}
|
|
46
|
-
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
47
|
-
return valuesArray[index];
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
export { buildLocalizeFn };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/_lib/buildMatchFn.mjs
|
|
2
|
-
function buildMatchFn(args) {
|
|
3
|
-
return (string, options = {}) => {
|
|
4
|
-
const width = options.width;
|
|
5
|
-
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
6
|
-
const matchResult = string.match(matchPattern);
|
|
7
|
-
if (!matchResult) return null;
|
|
8
|
-
const matchedString = matchResult[0];
|
|
9
|
-
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
10
|
-
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : findKey(parsePatterns, (pattern) => pattern.test(matchedString));
|
|
11
|
-
let value;
|
|
12
|
-
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
13
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
14
|
-
const rest = string.slice(matchedString.length);
|
|
15
|
-
return {
|
|
16
|
-
value,
|
|
17
|
-
rest
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function findKey(object, predicate) {
|
|
22
|
-
for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) return key;
|
|
23
|
-
}
|
|
24
|
-
function findIndex(array, predicate) {
|
|
25
|
-
for (let key = 0; key < array.length; key++) if (predicate(array[key])) return key;
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
exports.buildMatchFn = buildMatchFn;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/_lib/buildMatchFn.mjs
|
|
2
|
-
function buildMatchFn(args) {
|
|
3
|
-
return (string, options = {}) => {
|
|
4
|
-
const width = options.width;
|
|
5
|
-
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
6
|
-
const matchResult = string.match(matchPattern);
|
|
7
|
-
if (!matchResult) return null;
|
|
8
|
-
const matchedString = matchResult[0];
|
|
9
|
-
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
10
|
-
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : findKey(parsePatterns, (pattern) => pattern.test(matchedString));
|
|
11
|
-
let value;
|
|
12
|
-
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
13
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
14
|
-
const rest = string.slice(matchedString.length);
|
|
15
|
-
return {
|
|
16
|
-
value,
|
|
17
|
-
rest
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function findKey(object, predicate) {
|
|
22
|
-
for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) return key;
|
|
23
|
-
}
|
|
24
|
-
function findIndex(array, predicate) {
|
|
25
|
-
for (let key = 0; key < array.length; key++) if (predicate(array[key])) return key;
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
export { buildMatchFn };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs
|
|
2
|
-
function buildMatchPatternFn(args) {
|
|
3
|
-
return (string, options = {}) => {
|
|
4
|
-
const matchResult = string.match(args.matchPattern);
|
|
5
|
-
if (!matchResult) return null;
|
|
6
|
-
const matchedString = matchResult[0];
|
|
7
|
-
const parseResult = string.match(args.parsePattern);
|
|
8
|
-
if (!parseResult) return null;
|
|
9
|
-
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
10
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
11
|
-
const rest = string.slice(matchedString.length);
|
|
12
|
-
return {
|
|
13
|
-
value,
|
|
14
|
-
rest
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
exports.buildMatchPatternFn = buildMatchPatternFn;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs
|
|
2
|
-
function buildMatchPatternFn(args) {
|
|
3
|
-
return (string, options = {}) => {
|
|
4
|
-
const matchResult = string.match(args.matchPattern);
|
|
5
|
-
if (!matchResult) return null;
|
|
6
|
-
const matchedString = matchResult[0];
|
|
7
|
-
const parseResult = string.match(args.parsePattern);
|
|
8
|
-
if (!parseResult) return null;
|
|
9
|
-
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
10
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
11
|
-
const rest = string.slice(matchedString.length);
|
|
12
|
-
return {
|
|
13
|
-
value,
|
|
14
|
-
rest
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { buildMatchPatternFn };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs
|
|
2
|
-
var formatDistanceLocale = {
|
|
3
|
-
lessThanXSeconds: {
|
|
4
|
-
one: "less than a second",
|
|
5
|
-
other: "less than {{count}} seconds"
|
|
6
|
-
},
|
|
7
|
-
xSeconds: {
|
|
8
|
-
one: "1 second",
|
|
9
|
-
other: "{{count}} seconds"
|
|
10
|
-
},
|
|
11
|
-
halfAMinute: "half a minute",
|
|
12
|
-
lessThanXMinutes: {
|
|
13
|
-
one: "less than a minute",
|
|
14
|
-
other: "less than {{count}} minutes"
|
|
15
|
-
},
|
|
16
|
-
xMinutes: {
|
|
17
|
-
one: "1 minute",
|
|
18
|
-
other: "{{count}} minutes"
|
|
19
|
-
},
|
|
20
|
-
aboutXHours: {
|
|
21
|
-
one: "about 1 hour",
|
|
22
|
-
other: "about {{count}} hours"
|
|
23
|
-
},
|
|
24
|
-
xHours: {
|
|
25
|
-
one: "1 hour",
|
|
26
|
-
other: "{{count}} hours"
|
|
27
|
-
},
|
|
28
|
-
xDays: {
|
|
29
|
-
one: "1 day",
|
|
30
|
-
other: "{{count}} days"
|
|
31
|
-
},
|
|
32
|
-
aboutXWeeks: {
|
|
33
|
-
one: "about 1 week",
|
|
34
|
-
other: "about {{count}} weeks"
|
|
35
|
-
},
|
|
36
|
-
xWeeks: {
|
|
37
|
-
one: "1 week",
|
|
38
|
-
other: "{{count}} weeks"
|
|
39
|
-
},
|
|
40
|
-
aboutXMonths: {
|
|
41
|
-
one: "about 1 month",
|
|
42
|
-
other: "about {{count}} months"
|
|
43
|
-
},
|
|
44
|
-
xMonths: {
|
|
45
|
-
one: "1 month",
|
|
46
|
-
other: "{{count}} months"
|
|
47
|
-
},
|
|
48
|
-
aboutXYears: {
|
|
49
|
-
one: "about 1 year",
|
|
50
|
-
other: "about {{count}} years"
|
|
51
|
-
},
|
|
52
|
-
xYears: {
|
|
53
|
-
one: "1 year",
|
|
54
|
-
other: "{{count}} years"
|
|
55
|
-
},
|
|
56
|
-
overXYears: {
|
|
57
|
-
one: "over 1 year",
|
|
58
|
-
other: "over {{count}} years"
|
|
59
|
-
},
|
|
60
|
-
almostXYears: {
|
|
61
|
-
one: "almost 1 year",
|
|
62
|
-
other: "almost {{count}} years"
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
var formatDistance = (token, count, options) => {
|
|
66
|
-
let result;
|
|
67
|
-
const tokenValue = formatDistanceLocale[token];
|
|
68
|
-
if (typeof tokenValue === "string") result = tokenValue;
|
|
69
|
-
else if (count === 1) result = tokenValue.one;
|
|
70
|
-
else result = tokenValue.other.replace("{{count}}", count.toString());
|
|
71
|
-
if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
|
|
72
|
-
else return result + " ago";
|
|
73
|
-
return result;
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
exports.formatDistance = formatDistance;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs
|
|
2
|
-
var formatDistanceLocale = {
|
|
3
|
-
lessThanXSeconds: {
|
|
4
|
-
one: "less than a second",
|
|
5
|
-
other: "less than {{count}} seconds"
|
|
6
|
-
},
|
|
7
|
-
xSeconds: {
|
|
8
|
-
one: "1 second",
|
|
9
|
-
other: "{{count}} seconds"
|
|
10
|
-
},
|
|
11
|
-
halfAMinute: "half a minute",
|
|
12
|
-
lessThanXMinutes: {
|
|
13
|
-
one: "less than a minute",
|
|
14
|
-
other: "less than {{count}} minutes"
|
|
15
|
-
},
|
|
16
|
-
xMinutes: {
|
|
17
|
-
one: "1 minute",
|
|
18
|
-
other: "{{count}} minutes"
|
|
19
|
-
},
|
|
20
|
-
aboutXHours: {
|
|
21
|
-
one: "about 1 hour",
|
|
22
|
-
other: "about {{count}} hours"
|
|
23
|
-
},
|
|
24
|
-
xHours: {
|
|
25
|
-
one: "1 hour",
|
|
26
|
-
other: "{{count}} hours"
|
|
27
|
-
},
|
|
28
|
-
xDays: {
|
|
29
|
-
one: "1 day",
|
|
30
|
-
other: "{{count}} days"
|
|
31
|
-
},
|
|
32
|
-
aboutXWeeks: {
|
|
33
|
-
one: "about 1 week",
|
|
34
|
-
other: "about {{count}} weeks"
|
|
35
|
-
},
|
|
36
|
-
xWeeks: {
|
|
37
|
-
one: "1 week",
|
|
38
|
-
other: "{{count}} weeks"
|
|
39
|
-
},
|
|
40
|
-
aboutXMonths: {
|
|
41
|
-
one: "about 1 month",
|
|
42
|
-
other: "about {{count}} months"
|
|
43
|
-
},
|
|
44
|
-
xMonths: {
|
|
45
|
-
one: "1 month",
|
|
46
|
-
other: "{{count}} months"
|
|
47
|
-
},
|
|
48
|
-
aboutXYears: {
|
|
49
|
-
one: "about 1 year",
|
|
50
|
-
other: "about {{count}} years"
|
|
51
|
-
},
|
|
52
|
-
xYears: {
|
|
53
|
-
one: "1 year",
|
|
54
|
-
other: "{{count}} years"
|
|
55
|
-
},
|
|
56
|
-
overXYears: {
|
|
57
|
-
one: "over 1 year",
|
|
58
|
-
other: "over {{count}} years"
|
|
59
|
-
},
|
|
60
|
-
almostXYears: {
|
|
61
|
-
one: "almost 1 year",
|
|
62
|
-
other: "almost {{count}} years"
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
var formatDistance = (token, count, options) => {
|
|
66
|
-
let result;
|
|
67
|
-
const tokenValue = formatDistanceLocale[token];
|
|
68
|
-
if (typeof tokenValue === "string") result = tokenValue;
|
|
69
|
-
else if (count === 1) result = tokenValue.one;
|
|
70
|
-
else result = tokenValue.other.replace("{{count}}", count.toString());
|
|
71
|
-
if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
|
|
72
|
-
else return result + " ago";
|
|
73
|
-
return result;
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
export { formatDistance };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const require_buildFormatLongFn = require("../../_lib/buildFormatLongFn.cjs");
|
|
2
|
-
var formatLong = {
|
|
3
|
-
date: require_buildFormatLongFn.buildFormatLongFn({
|
|
4
|
-
formats: {
|
|
5
|
-
full: "EEEE, MMMM do, y",
|
|
6
|
-
long: "MMMM do, y",
|
|
7
|
-
medium: "MMM d, y",
|
|
8
|
-
short: "MM/dd/yyyy"
|
|
9
|
-
},
|
|
10
|
-
defaultWidth: "full"
|
|
11
|
-
}),
|
|
12
|
-
time: require_buildFormatLongFn.buildFormatLongFn({
|
|
13
|
-
formats: {
|
|
14
|
-
full: "h:mm:ss a zzzz",
|
|
15
|
-
long: "h:mm:ss a z",
|
|
16
|
-
medium: "h:mm:ss a",
|
|
17
|
-
short: "h:mm a"
|
|
18
|
-
},
|
|
19
|
-
defaultWidth: "full"
|
|
20
|
-
}),
|
|
21
|
-
dateTime: require_buildFormatLongFn.buildFormatLongFn({
|
|
22
|
-
formats: {
|
|
23
|
-
full: "{{date}} 'at' {{time}}",
|
|
24
|
-
long: "{{date}} 'at' {{time}}",
|
|
25
|
-
medium: "{{date}}, {{time}}",
|
|
26
|
-
short: "{{date}}, {{time}}"
|
|
27
|
-
},
|
|
28
|
-
defaultWidth: "full"
|
|
29
|
-
})
|
|
30
|
-
};
|
|
31
|
-
//#endregion
|
|
32
|
-
exports.formatLong = formatLong;
|