@indielayer/ui 1.5.2 → 1.6.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/README.md +1 -1
- package/docs/components/common/DocumentPage.vue +0 -30
- package/docs/components/menu/DocsMenu.vue +2 -0
- package/docs/pages/component/datepicker/index.vue +35 -0
- package/docs/pages/component/datepicker/usage.vue +22 -0
- package/docs/pages/component/form/usage.vue +13 -0
- package/docs/pages/component/menu/usage.vue +7 -3
- package/docs/pages/component/qrCode/index.vue +25 -0
- package/docs/pages/component/qrCode/usage.vue +20 -0
- package/docs/pages/component/slider/usage.vue +8 -10
- package/docs/pages/index.vue +9 -19
- package/lib/components/button/Button.vue.d.ts +3 -3
- package/lib/components/button/Button.vue.js +2 -2
- package/lib/components/button/Button.vue2.js +10 -10
- package/lib/components/carousel/Carousel.vue.d.ts +8 -2
- package/lib/components/carousel/Carousel.vue.js +51 -48
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +1 -1
- package/lib/components/datepicker/Datepicker.vue.d.ts +1886 -0
- package/lib/components/datepicker/Datepicker.vue.js +328 -0
- package/lib/components/datepicker/Datepicker.vue2.js +4 -0
- package/lib/components/datepicker/Datepicker.vue3.js +5 -0
- package/lib/components/datepicker/__tests__/Datepicker.spec.d.ts +1 -0
- package/lib/components/datepicker/index.d.ts +2 -0
- package/lib/components/datepicker/theme/Datepicker.base.theme.d.ts +3 -0
- package/lib/components/datepicker/theme/Datepicker.base.theme.js +65 -0
- package/lib/components/datepicker/theme/Datepicker.carbon.theme.d.ts +3 -0
- package/lib/components/datepicker/theme/Datepicker.carbon.theme.js +5 -0
- package/lib/components/drawer/Drawer.vue.js +1 -1
- package/lib/components/drawer/theme/Drawer.base.theme.js +1 -1
- package/lib/components/formGroup/FormGroup.vue.js +42 -36
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +99 -94
- package/lib/components/menu/Menu.vue.d.ts +4 -0
- package/lib/components/menu/Menu.vue.js +40 -34
- package/lib/components/menu/MenuItem.vue.d.ts +4 -0
- package/lib/components/menu/MenuItem.vue.js +1 -1
- package/lib/components/menu/MenuItem.vue2.js +43 -39
- package/lib/components/menu/theme/MenuItem.base.theme.js +1 -1
- package/lib/components/qrCode/QrCode.vue.d.ts +68 -0
- package/lib/components/qrCode/QrCode.vue.js +93 -0
- package/lib/components/qrCode/QrCode.vue2.js +4 -0
- package/lib/components/qrCode/__tests__/QrCode.spec.d.ts +1 -0
- package/lib/components/qrCode/index.d.ts +2 -0
- package/lib/components/qrCode/qrcodegen.d.ts +94 -0
- package/lib/components/qrCode/qrcodegen.js +571 -0
- package/lib/components/qrCode/theme/QrCode.base.theme.d.ts +3 -0
- package/lib/components/qrCode/theme/QrCode.base.theme.js +8 -0
- package/lib/components/qrCode/theme/QrCode.carbon.theme.d.ts +3 -0
- package/lib/components/qrCode/theme/QrCode.carbon.theme.js +5 -0
- package/lib/components/slider/Slider.vue.d.ts +31 -31
- package/lib/components/slider/Slider.vue.js +5 -146
- package/lib/components/slider/Slider.vue2.js +101 -2
- package/lib/components/slider/Slider.vue3.js +4 -0
- package/lib/components/slider/theme/Slider.base.theme.js +14 -10
- package/lib/components/slider/theme/Slider.carbon.theme.js +3 -14
- package/lib/index.js +117 -113
- package/lib/index.umd.js +39 -3
- package/lib/node_modules/.pnpm/@vuepic_vue-datepicker@8.0.0_vue@3.3.9/node_modules/@vuepic/vue-datepicker/dist/main.css.js +4 -0
- package/lib/node_modules/.pnpm/@vuepic_vue-datepicker@8.0.0_vue@3.3.9/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js +5011 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/format/formatters.js +518 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/_lib/protectedTokens.js +21 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/add.js +20 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/addDays.js +10 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/addMonths.js +21 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/addQuarters.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/addYears.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/constants.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/constructFrom.js +7 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/differenceInCalendarDays.js +11 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/eachDayOfInterval.js +19 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/eachQuarterOfInterval.js +20 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/endOfQuarter.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/endOfWeek.js +11 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/endOfYear.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/format.js +60 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getDay.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getDayOfYear.js +11 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getDaysInMonth.js +10 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getDefaultOptions.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getHours.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getISODay.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getISOWeek.js +12 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getISOWeekYear.js +15 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getMinutes.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getMonth.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getQuarter.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getSeconds.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getWeek.js +12 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getWeekYear.js +17 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/getYear.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isAfter.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isBefore.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isDate.js +7 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isEqual.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isSameQuarter.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/isValid.js +12 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +17 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/locale/en-US.js +21 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/Parser.js +22 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/Setter.js +40 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/constants.js +49 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +49 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +49 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/DateParser.js +61 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +51 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/DayParser.js +45 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +49 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/EraParser.js +30 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +21 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +22 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +32 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +32 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +33 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +33 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +99 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +48 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +48 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +49 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +40 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +74 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +48 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +69 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +32 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +71 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +70 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +32 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +74 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +71 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +70 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +22 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +22 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/YearParser.js +49 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers.js +67 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/utils.js +103 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse.js +90 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parseISO.js +128 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/set.js +11 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setDay.js +12 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setHours.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setISODay.js +11 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setISOWeek.js +10 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setMilliseconds.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setMinutes.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setMonth.js +13 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setSeconds.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setWeek.js +10 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/setYear.js +10 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfDay.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfISOWeek.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfISOWeekYear.js +11 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfQuarter.js +9 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfWeek.js +11 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfWeekYear.js +13 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/startOfYear.js +10 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/sub.js +19 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/subDays.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/subMonths.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/subYears.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/toDate.js +8 -0
- package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/transpose.js +18 -0
- package/lib/theme.d.ts +3 -1
- package/lib/themes/base/components.d.ts +2 -0
- package/lib/themes/base/components.js +82 -78
- package/lib/themes/carbon/components.d.ts +2 -0
- package/lib/themes/carbon/components.js +82 -78
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -1
- package/src/components/button/Button.vue +1 -1
- package/src/components/carousel/Carousel.vue +8 -3
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +1 -1
- package/src/components/datepicker/Datepicker.vue +414 -0
- package/src/components/datepicker/__tests__/Datepicker.spec.ts +11 -0
- package/src/components/datepicker/index.ts +2 -0
- package/src/components/datepicker/theme/Datepicker.base.theme.ts +72 -0
- package/src/components/datepicker/theme/Datepicker.carbon.theme.ts +7 -0
- package/src/components/drawer/Drawer.vue +1 -1
- package/src/components/drawer/theme/Drawer.base.theme.ts +1 -1
- package/src/components/formGroup/FormGroup.vue +5 -0
- package/src/components/index.ts +2 -0
- package/src/components/menu/Menu.vue +6 -0
- package/src/components/menu/MenuItem.vue +2 -1
- package/src/components/menu/theme/MenuItem.base.theme.ts +1 -1
- package/src/components/qrCode/QrCode.vue +120 -0
- package/src/components/qrCode/__tests__/QrCode.spec.ts +14 -0
- package/src/components/qrCode/index.ts +2 -0
- package/src/components/qrCode/qrcodegen.ts +991 -0
- package/src/components/qrCode/theme/QrCode.base.theme.ts +9 -0
- package/src/components/qrCode/theme/QrCode.carbon.theme.ts +7 -0
- package/src/components/slider/Slider.vue +63 -137
- package/src/components/slider/theme/Slider.base.theme.ts +10 -5
- package/src/components/slider/theme/Slider.carbon.theme.ts +2 -16
- package/src/theme.ts +4 -0
- package/src/themes/base/components.ts +2 -0
- package/src/themes/carbon/components.ts +2 -0
- package/src/version.ts +1 -1
- package/volar.d.ts +2 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var f = (t, i, r) => i in t ? D(t, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[i] = r;
|
|
3
|
+
var n = (t, i, r) => (f(t, typeof i != "symbol" ? i + "" : i, r), r);
|
|
4
|
+
import { getWeekYear as y } from "../../../getWeekYear.js";
|
|
5
|
+
import { startOfWeek as m } from "../../../startOfWeek.js";
|
|
6
|
+
import { Parser as T } from "../Parser.js";
|
|
7
|
+
import { mapValue as Y, parseNDigits as u, normalizeTwoDigitYear as p } from "../utils.js";
|
|
8
|
+
class C extends T {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
n(this, "priority", 130);
|
|
12
|
+
n(this, "incompatibleTokens", [
|
|
13
|
+
"y",
|
|
14
|
+
"R",
|
|
15
|
+
"u",
|
|
16
|
+
"Q",
|
|
17
|
+
"q",
|
|
18
|
+
"M",
|
|
19
|
+
"L",
|
|
20
|
+
"I",
|
|
21
|
+
"d",
|
|
22
|
+
"D",
|
|
23
|
+
"i",
|
|
24
|
+
"t",
|
|
25
|
+
"T"
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
parse(r, e, s) {
|
|
29
|
+
const a = (o) => ({
|
|
30
|
+
year: o,
|
|
31
|
+
isTwoDigitYear: e === "YY"
|
|
32
|
+
});
|
|
33
|
+
switch (e) {
|
|
34
|
+
case "Y":
|
|
35
|
+
return Y(u(4, r), a);
|
|
36
|
+
case "Yo":
|
|
37
|
+
return Y(
|
|
38
|
+
s.ordinalNumber(r, {
|
|
39
|
+
unit: "year"
|
|
40
|
+
}),
|
|
41
|
+
a
|
|
42
|
+
);
|
|
43
|
+
default:
|
|
44
|
+
return Y(u(e.length, r), a);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
validate(r, e) {
|
|
48
|
+
return e.isTwoDigitYear || e.year > 0;
|
|
49
|
+
}
|
|
50
|
+
set(r, e, s, a) {
|
|
51
|
+
const o = y(r, a);
|
|
52
|
+
if (s.isTwoDigitYear) {
|
|
53
|
+
const l = p(
|
|
54
|
+
s.year,
|
|
55
|
+
o
|
|
56
|
+
);
|
|
57
|
+
return r.setFullYear(
|
|
58
|
+
l,
|
|
59
|
+
0,
|
|
60
|
+
a.firstWeekContainsDate
|
|
61
|
+
), r.setHours(0, 0, 0, 0), m(r, a);
|
|
62
|
+
}
|
|
63
|
+
const c = !("era" in e) || e.era === 1 ? s.year : 1 - s.year;
|
|
64
|
+
return r.setFullYear(c, 0, a.firstWeekContainsDate), r.setHours(0, 0, 0, 0), m(r, a);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
C as LocalWeekYearParser
|
|
69
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var a = (t, e, r) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var n = (t, e, r) => (a(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { numericPatterns as u } from "../constants.js";
|
|
5
|
+
import { Parser as o } from "../Parser.js";
|
|
6
|
+
import { parseNDigits as p, parseNumericPattern as c } from "../utils.js";
|
|
7
|
+
class b extends o {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
n(this, "priority", 60);
|
|
11
|
+
n(this, "incompatibleTokens", ["t", "T"]);
|
|
12
|
+
}
|
|
13
|
+
parse(r, s, i) {
|
|
14
|
+
switch (s) {
|
|
15
|
+
case "m":
|
|
16
|
+
return c(u.minute, r);
|
|
17
|
+
case "mo":
|
|
18
|
+
return i.ordinalNumber(r, { unit: "minute" });
|
|
19
|
+
default:
|
|
20
|
+
return p(s.length, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
validate(r, s) {
|
|
24
|
+
return s >= 0 && s <= 59;
|
|
25
|
+
}
|
|
26
|
+
set(r, s, i) {
|
|
27
|
+
return r.setMinutes(i, 0, 0), r;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
b as MinuteParser
|
|
32
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var u = (e, o, t) => o in e ? M(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var i = (e, o, t) => (u(e, typeof o != "symbol" ? o + "" : o, t), t);
|
|
4
|
+
import { numericPatterns as c } from "../constants.js";
|
|
5
|
+
import { Parser as w } from "../Parser.js";
|
|
6
|
+
import { mapValue as a, parseNDigits as f, parseNumericPattern as h } from "../utils.js";
|
|
7
|
+
class d extends w {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
i(this, "incompatibleTokens", [
|
|
11
|
+
"Y",
|
|
12
|
+
"R",
|
|
13
|
+
"q",
|
|
14
|
+
"Q",
|
|
15
|
+
"L",
|
|
16
|
+
"w",
|
|
17
|
+
"I",
|
|
18
|
+
"D",
|
|
19
|
+
"i",
|
|
20
|
+
"e",
|
|
21
|
+
"c",
|
|
22
|
+
"t",
|
|
23
|
+
"T"
|
|
24
|
+
]);
|
|
25
|
+
i(this, "priority", 110);
|
|
26
|
+
}
|
|
27
|
+
parse(t, n, r) {
|
|
28
|
+
const s = (m) => m - 1;
|
|
29
|
+
switch (n) {
|
|
30
|
+
case "M":
|
|
31
|
+
return a(
|
|
32
|
+
h(c.month, t),
|
|
33
|
+
s
|
|
34
|
+
);
|
|
35
|
+
case "MM":
|
|
36
|
+
return a(f(2, t), s);
|
|
37
|
+
case "Mo":
|
|
38
|
+
return a(
|
|
39
|
+
r.ordinalNumber(t, {
|
|
40
|
+
unit: "month"
|
|
41
|
+
}),
|
|
42
|
+
s
|
|
43
|
+
);
|
|
44
|
+
case "MMM":
|
|
45
|
+
return r.month(t, {
|
|
46
|
+
width: "abbreviated",
|
|
47
|
+
context: "formatting"
|
|
48
|
+
}) || r.month(t, { width: "narrow", context: "formatting" });
|
|
49
|
+
case "MMMMM":
|
|
50
|
+
return r.month(t, {
|
|
51
|
+
width: "narrow",
|
|
52
|
+
context: "formatting"
|
|
53
|
+
});
|
|
54
|
+
case "MMMM":
|
|
55
|
+
default:
|
|
56
|
+
return r.month(t, { width: "wide", context: "formatting" }) || r.month(t, {
|
|
57
|
+
width: "abbreviated",
|
|
58
|
+
context: "formatting"
|
|
59
|
+
}) || r.month(t, { width: "narrow", context: "formatting" });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
validate(t, n) {
|
|
63
|
+
return n >= 0 && n <= 11;
|
|
64
|
+
}
|
|
65
|
+
set(t, n, r) {
|
|
66
|
+
return t.setMonth(r, 1), t.setHours(0, 0, 0, 0), t;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
d as MonthParser
|
|
71
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var s = (o, e, r) => e in o ? n(o, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[e] = r;
|
|
3
|
+
var i = (o, e, r) => (s(o, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { Parser as u } from "../Parser.js";
|
|
5
|
+
import { parseNDigits as Q } from "../utils.js";
|
|
6
|
+
class q extends u {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
i(this, "priority", 120);
|
|
10
|
+
i(this, "incompatibleTokens", [
|
|
11
|
+
"Y",
|
|
12
|
+
"R",
|
|
13
|
+
"q",
|
|
14
|
+
"M",
|
|
15
|
+
"L",
|
|
16
|
+
"w",
|
|
17
|
+
"I",
|
|
18
|
+
"d",
|
|
19
|
+
"D",
|
|
20
|
+
"i",
|
|
21
|
+
"e",
|
|
22
|
+
"c",
|
|
23
|
+
"t",
|
|
24
|
+
"T"
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
parse(r, a, t) {
|
|
28
|
+
switch (a) {
|
|
29
|
+
case "Q":
|
|
30
|
+
case "QQ":
|
|
31
|
+
return Q(a.length, r);
|
|
32
|
+
case "Qo":
|
|
33
|
+
return t.ordinalNumber(r, { unit: "quarter" });
|
|
34
|
+
case "QQQ":
|
|
35
|
+
return t.quarter(r, {
|
|
36
|
+
width: "abbreviated",
|
|
37
|
+
context: "formatting"
|
|
38
|
+
}) || t.quarter(r, {
|
|
39
|
+
width: "narrow",
|
|
40
|
+
context: "formatting"
|
|
41
|
+
});
|
|
42
|
+
case "QQQQQ":
|
|
43
|
+
return t.quarter(r, {
|
|
44
|
+
width: "narrow",
|
|
45
|
+
context: "formatting"
|
|
46
|
+
});
|
|
47
|
+
case "QQQQ":
|
|
48
|
+
default:
|
|
49
|
+
return t.quarter(r, {
|
|
50
|
+
width: "wide",
|
|
51
|
+
context: "formatting"
|
|
52
|
+
}) || t.quarter(r, {
|
|
53
|
+
width: "abbreviated",
|
|
54
|
+
context: "formatting"
|
|
55
|
+
}) || t.quarter(r, {
|
|
56
|
+
width: "narrow",
|
|
57
|
+
context: "formatting"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
validate(r, a) {
|
|
62
|
+
return a >= 1 && a <= 4;
|
|
63
|
+
}
|
|
64
|
+
set(r, a, t) {
|
|
65
|
+
return r.setMonth((t - 1) * 3, 1), r.setHours(0, 0, 0, 0), r;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
q as QuarterParser
|
|
70
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var i = (s, e, r) => e in s ? a(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
|
|
3
|
+
var o = (s, e, r) => (i(s, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { numericPatterns as c } from "../constants.js";
|
|
5
|
+
import { Parser as m } from "../Parser.js";
|
|
6
|
+
import { parseNDigits as p, parseNumericPattern as u } from "../utils.js";
|
|
7
|
+
class N extends m {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
o(this, "priority", 50);
|
|
11
|
+
o(this, "incompatibleTokens", ["t", "T"]);
|
|
12
|
+
}
|
|
13
|
+
parse(r, t, n) {
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "s":
|
|
16
|
+
return u(c.second, r);
|
|
17
|
+
case "so":
|
|
18
|
+
return n.ordinalNumber(r, { unit: "second" });
|
|
19
|
+
default:
|
|
20
|
+
return p(t.length, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
validate(r, t) {
|
|
24
|
+
return t >= 0 && t <= 59;
|
|
25
|
+
}
|
|
26
|
+
set(r, t, n) {
|
|
27
|
+
return r.setSeconds(n, 0), r;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
N as SecondParser
|
|
32
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var y = (n, a, e) => a in n ? i(n, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[a] = e;
|
|
3
|
+
var s = (n, a, e) => (y(n, typeof a != "symbol" ? a + "" : a, e), e);
|
|
4
|
+
import { setDay as u } from "../../../setDay.js";
|
|
5
|
+
import { Parser as x } from "../Parser.js";
|
|
6
|
+
import { mapValue as l, parseNDigits as p } from "../utils.js";
|
|
7
|
+
class k extends x {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
s(this, "priority", 90);
|
|
11
|
+
s(this, "incompatibleTokens", [
|
|
12
|
+
"y",
|
|
13
|
+
"R",
|
|
14
|
+
"u",
|
|
15
|
+
"q",
|
|
16
|
+
"Q",
|
|
17
|
+
"M",
|
|
18
|
+
"L",
|
|
19
|
+
"I",
|
|
20
|
+
"d",
|
|
21
|
+
"D",
|
|
22
|
+
"E",
|
|
23
|
+
"i",
|
|
24
|
+
"e",
|
|
25
|
+
"t",
|
|
26
|
+
"T"
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
parse(e, t, o, r) {
|
|
30
|
+
const c = (d) => {
|
|
31
|
+
const w = Math.floor((d - 1) / 7) * 7;
|
|
32
|
+
return (d + r.weekStartsOn + 6) % 7 + w;
|
|
33
|
+
};
|
|
34
|
+
switch (t) {
|
|
35
|
+
case "c":
|
|
36
|
+
case "cc":
|
|
37
|
+
return l(p(t.length, e), c);
|
|
38
|
+
case "co":
|
|
39
|
+
return l(
|
|
40
|
+
o.ordinalNumber(e, {
|
|
41
|
+
unit: "day"
|
|
42
|
+
}),
|
|
43
|
+
c
|
|
44
|
+
);
|
|
45
|
+
case "ccc":
|
|
46
|
+
return o.day(e, {
|
|
47
|
+
width: "abbreviated",
|
|
48
|
+
context: "standalone"
|
|
49
|
+
}) || o.day(e, { width: "short", context: "standalone" }) || o.day(e, { width: "narrow", context: "standalone" });
|
|
50
|
+
case "ccccc":
|
|
51
|
+
return o.day(e, {
|
|
52
|
+
width: "narrow",
|
|
53
|
+
context: "standalone"
|
|
54
|
+
});
|
|
55
|
+
case "cccccc":
|
|
56
|
+
return o.day(e, { width: "short", context: "standalone" }) || o.day(e, { width: "narrow", context: "standalone" });
|
|
57
|
+
case "cccc":
|
|
58
|
+
default:
|
|
59
|
+
return o.day(e, { width: "wide", context: "standalone" }) || o.day(e, {
|
|
60
|
+
width: "abbreviated",
|
|
61
|
+
context: "standalone"
|
|
62
|
+
}) || o.day(e, { width: "short", context: "standalone" }) || o.day(e, { width: "narrow", context: "standalone" });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
validate(e, t) {
|
|
66
|
+
return t >= 0 && t <= 6;
|
|
67
|
+
}
|
|
68
|
+
set(e, t, o, r) {
|
|
69
|
+
return e = u(e, o, r), e.setHours(0, 0, 0, 0), e;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
k as StandAloneLocalDayParser
|
|
74
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var u = (o, n, e) => n in o ? L(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e;
|
|
3
|
+
var a = (o, n, e) => (u(o, typeof n != "symbol" ? n + "" : n, e), e);
|
|
4
|
+
import { numericPatterns as c } from "../constants.js";
|
|
5
|
+
import { Parser as m } from "../Parser.js";
|
|
6
|
+
import { mapValue as i, parseNDigits as w, parseNumericPattern as d } from "../utils.js";
|
|
7
|
+
class f extends m {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
a(this, "priority", 110);
|
|
11
|
+
a(this, "incompatibleTokens", [
|
|
12
|
+
"Y",
|
|
13
|
+
"R",
|
|
14
|
+
"q",
|
|
15
|
+
"Q",
|
|
16
|
+
"M",
|
|
17
|
+
"w",
|
|
18
|
+
"I",
|
|
19
|
+
"D",
|
|
20
|
+
"i",
|
|
21
|
+
"e",
|
|
22
|
+
"c",
|
|
23
|
+
"t",
|
|
24
|
+
"T"
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
parse(e, r, t) {
|
|
28
|
+
const s = (l) => l - 1;
|
|
29
|
+
switch (r) {
|
|
30
|
+
case "L":
|
|
31
|
+
return i(
|
|
32
|
+
d(c.month, e),
|
|
33
|
+
s
|
|
34
|
+
);
|
|
35
|
+
case "LL":
|
|
36
|
+
return i(w(2, e), s);
|
|
37
|
+
case "Lo":
|
|
38
|
+
return i(
|
|
39
|
+
t.ordinalNumber(e, {
|
|
40
|
+
unit: "month"
|
|
41
|
+
}),
|
|
42
|
+
s
|
|
43
|
+
);
|
|
44
|
+
case "LLL":
|
|
45
|
+
return t.month(e, {
|
|
46
|
+
width: "abbreviated",
|
|
47
|
+
context: "standalone"
|
|
48
|
+
}) || t.month(e, { width: "narrow", context: "standalone" });
|
|
49
|
+
case "LLLLL":
|
|
50
|
+
return t.month(e, {
|
|
51
|
+
width: "narrow",
|
|
52
|
+
context: "standalone"
|
|
53
|
+
});
|
|
54
|
+
case "LLLL":
|
|
55
|
+
default:
|
|
56
|
+
return t.month(e, { width: "wide", context: "standalone" }) || t.month(e, {
|
|
57
|
+
width: "abbreviated",
|
|
58
|
+
context: "standalone"
|
|
59
|
+
}) || t.month(e, { width: "narrow", context: "standalone" });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
validate(e, r) {
|
|
63
|
+
return r >= 0 && r <= 11;
|
|
64
|
+
}
|
|
65
|
+
set(e, r, t) {
|
|
66
|
+
return e.setMonth(t, 1), e.setHours(0, 0, 0, 0), e;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
f as StandAloneMonthParser
|
|
71
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var q = (a, t, r) => t in a ? s(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r;
|
|
3
|
+
var o = (a, t, r) => (q(a, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { Parser as u } from "../Parser.js";
|
|
5
|
+
import { parseNDigits as i } from "../utils.js";
|
|
6
|
+
class c extends u {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
o(this, "priority", 120);
|
|
10
|
+
o(this, "incompatibleTokens", [
|
|
11
|
+
"Y",
|
|
12
|
+
"R",
|
|
13
|
+
"Q",
|
|
14
|
+
"M",
|
|
15
|
+
"L",
|
|
16
|
+
"w",
|
|
17
|
+
"I",
|
|
18
|
+
"d",
|
|
19
|
+
"D",
|
|
20
|
+
"i",
|
|
21
|
+
"e",
|
|
22
|
+
"c",
|
|
23
|
+
"t",
|
|
24
|
+
"T"
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
parse(r, n, e) {
|
|
28
|
+
switch (n) {
|
|
29
|
+
case "q":
|
|
30
|
+
case "qq":
|
|
31
|
+
return i(n.length, r);
|
|
32
|
+
case "qo":
|
|
33
|
+
return e.ordinalNumber(r, { unit: "quarter" });
|
|
34
|
+
case "qqq":
|
|
35
|
+
return e.quarter(r, {
|
|
36
|
+
width: "abbreviated",
|
|
37
|
+
context: "standalone"
|
|
38
|
+
}) || e.quarter(r, {
|
|
39
|
+
width: "narrow",
|
|
40
|
+
context: "standalone"
|
|
41
|
+
});
|
|
42
|
+
case "qqqqq":
|
|
43
|
+
return e.quarter(r, {
|
|
44
|
+
width: "narrow",
|
|
45
|
+
context: "standalone"
|
|
46
|
+
});
|
|
47
|
+
case "qqqq":
|
|
48
|
+
default:
|
|
49
|
+
return e.quarter(r, {
|
|
50
|
+
width: "wide",
|
|
51
|
+
context: "standalone"
|
|
52
|
+
}) || e.quarter(r, {
|
|
53
|
+
width: "abbreviated",
|
|
54
|
+
context: "standalone"
|
|
55
|
+
}) || e.quarter(r, {
|
|
56
|
+
width: "narrow",
|
|
57
|
+
context: "standalone"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
validate(r, n) {
|
|
62
|
+
return n >= 1 && n <= 4;
|
|
63
|
+
}
|
|
64
|
+
set(r, n, e) {
|
|
65
|
+
return r.setMonth((e - 1) * 3, 1), r.setHours(0, 0, 0, 0), r;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
c as StandAloneQuarterParser
|
|
70
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var m = (t, e, r) => e in t ? o(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var s = (t, e, r) => (m(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { constructFrom as p } from "../../../constructFrom.js";
|
|
5
|
+
import { Parser as a } from "../Parser.js";
|
|
6
|
+
import { parseAnyDigitsSigned as n } from "../utils.js";
|
|
7
|
+
class g extends a {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
s(this, "priority", 20);
|
|
11
|
+
s(this, "incompatibleTokens", "*");
|
|
12
|
+
}
|
|
13
|
+
parse(r) {
|
|
14
|
+
return n(r);
|
|
15
|
+
}
|
|
16
|
+
set(r, c, i) {
|
|
17
|
+
return [p(r, i), { timestampIsSet: !0 }];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
g as TimestampMillisecondsParser
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var m = (t, e, r) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var s = (t, e, r) => (m(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { constructFrom as p } from "../../../constructFrom.js";
|
|
5
|
+
import { Parser as a } from "../Parser.js";
|
|
6
|
+
import { parseAnyDigitsSigned as n } from "../utils.js";
|
|
7
|
+
class l extends a {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
s(this, "priority", 40);
|
|
11
|
+
s(this, "incompatibleTokens", "*");
|
|
12
|
+
}
|
|
13
|
+
parse(r) {
|
|
14
|
+
return n(r);
|
|
15
|
+
}
|
|
16
|
+
set(r, c, o) {
|
|
17
|
+
return [p(r, o * 1e3), { timestampIsSet: !0 }];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
l as TimestampSecondsParser
|
|
22
|
+
};
|
package/lib/node_modules/.pnpm/date-fns@3.3.1/node_modules/date-fns/parse/_lib/parsers/YearParser.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var Y = (a, i, r) => i in a ? y(a, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[i] = r;
|
|
3
|
+
var n = (a, i, r) => (Y(a, typeof i != "symbol" ? i + "" : i, r), r);
|
|
4
|
+
import { Parser as m } from "../Parser.js";
|
|
5
|
+
import { mapValue as u, parseNDigits as l, normalizeTwoDigitYear as p } from "../utils.js";
|
|
6
|
+
class g extends m {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
n(this, "priority", 130);
|
|
10
|
+
n(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
11
|
+
}
|
|
12
|
+
parse(r, e, s) {
|
|
13
|
+
const t = (o) => ({
|
|
14
|
+
year: o,
|
|
15
|
+
isTwoDigitYear: e === "yy"
|
|
16
|
+
});
|
|
17
|
+
switch (e) {
|
|
18
|
+
case "y":
|
|
19
|
+
return u(l(4, r), t);
|
|
20
|
+
case "yo":
|
|
21
|
+
return u(
|
|
22
|
+
s.ordinalNumber(r, {
|
|
23
|
+
unit: "year"
|
|
24
|
+
}),
|
|
25
|
+
t
|
|
26
|
+
);
|
|
27
|
+
default:
|
|
28
|
+
return u(l(e.length, r), t);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
validate(r, e) {
|
|
32
|
+
return e.isTwoDigitYear || e.year > 0;
|
|
33
|
+
}
|
|
34
|
+
set(r, e, s) {
|
|
35
|
+
const t = r.getFullYear();
|
|
36
|
+
if (s.isTwoDigitYear) {
|
|
37
|
+
const c = p(
|
|
38
|
+
s.year,
|
|
39
|
+
t
|
|
40
|
+
);
|
|
41
|
+
return r.setFullYear(c, 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
42
|
+
}
|
|
43
|
+
const o = !("era" in e) || e.era === 1 ? s.year : 1 - s.year;
|
|
44
|
+
return r.setFullYear(o, 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
g as YearParser
|
|
49
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { EraParser as r } from "./parsers/EraParser.js";
|
|
2
|
+
import { YearParser as e } from "./parsers/YearParser.js";
|
|
3
|
+
import { LocalWeekYearParser as o } from "./parsers/LocalWeekYearParser.js";
|
|
4
|
+
import { ISOWeekYearParser as m } from "./parsers/ISOWeekYearParser.js";
|
|
5
|
+
import { ExtendedYearParser as a } from "./parsers/ExtendedYearParser.js";
|
|
6
|
+
import { QuarterParser as t } from "./parsers/QuarterParser.js";
|
|
7
|
+
import { StandAloneQuarterParser as n } from "./parsers/StandAloneQuarterParser.js";
|
|
8
|
+
import { MonthParser as i } from "./parsers/MonthParser.js";
|
|
9
|
+
import { StandAloneMonthParser as s } from "./parsers/StandAloneMonthParser.js";
|
|
10
|
+
import { LocalWeekParser as p } from "./parsers/LocalWeekParser.js";
|
|
11
|
+
import { ISOWeekParser as P } from "./parsers/ISOWeekParser.js";
|
|
12
|
+
import { DateParser as f } from "./parsers/DateParser.js";
|
|
13
|
+
import { DayOfYearParser as w } from "./parsers/DayOfYearParser.js";
|
|
14
|
+
import { DayParser as d } from "./parsers/DayParser.js";
|
|
15
|
+
import { LocalDayParser as S } from "./parsers/LocalDayParser.js";
|
|
16
|
+
import { StandAloneLocalDayParser as c } from "./parsers/StandAloneLocalDayParser.js";
|
|
17
|
+
import { ISODayParser as M } from "./parsers/ISODayParser.js";
|
|
18
|
+
import { AMPMParser as l } from "./parsers/AMPMParser.js";
|
|
19
|
+
import { AMPMMidnightParser as u } from "./parsers/AMPMMidnightParser.js";
|
|
20
|
+
import { DayPeriodParser as D } from "./parsers/DayPeriodParser.js";
|
|
21
|
+
import { Hour1to12Parser as y } from "./parsers/Hour1to12Parser.js";
|
|
22
|
+
import { Hour0to23Parser as O } from "./parsers/Hour0to23Parser.js";
|
|
23
|
+
import { Hour0To11Parser as T } from "./parsers/Hour0To11Parser.js";
|
|
24
|
+
import { Hour1To24Parser as I } from "./parsers/Hour1To24Parser.js";
|
|
25
|
+
import { MinuteParser as Y } from "./parsers/MinuteParser.js";
|
|
26
|
+
import { SecondParser as h } from "./parsers/SecondParser.js";
|
|
27
|
+
import { FractionOfSecondParser as k } from "./parsers/FractionOfSecondParser.js";
|
|
28
|
+
import { ISOTimezoneWithZParser as A } from "./parsers/ISOTimezoneWithZParser.js";
|
|
29
|
+
import { ISOTimezoneParser as H } from "./parsers/ISOTimezoneParser.js";
|
|
30
|
+
import { TimestampSecondsParser as L } from "./parsers/TimestampSecondsParser.js";
|
|
31
|
+
import { TimestampMillisecondsParser as W } from "./parsers/TimestampMillisecondsParser.js";
|
|
32
|
+
const sr = {
|
|
33
|
+
G: new r(),
|
|
34
|
+
y: new e(),
|
|
35
|
+
Y: new o(),
|
|
36
|
+
R: new m(),
|
|
37
|
+
u: new a(),
|
|
38
|
+
Q: new t(),
|
|
39
|
+
q: new n(),
|
|
40
|
+
M: new i(),
|
|
41
|
+
L: new s(),
|
|
42
|
+
w: new p(),
|
|
43
|
+
I: new P(),
|
|
44
|
+
d: new f(),
|
|
45
|
+
D: new w(),
|
|
46
|
+
E: new d(),
|
|
47
|
+
e: new S(),
|
|
48
|
+
c: new c(),
|
|
49
|
+
i: new M(),
|
|
50
|
+
a: new l(),
|
|
51
|
+
b: new u(),
|
|
52
|
+
B: new D(),
|
|
53
|
+
h: new y(),
|
|
54
|
+
H: new O(),
|
|
55
|
+
K: new T(),
|
|
56
|
+
k: new I(),
|
|
57
|
+
m: new Y(),
|
|
58
|
+
s: new h(),
|
|
59
|
+
S: new k(),
|
|
60
|
+
X: new A(),
|
|
61
|
+
x: new H(),
|
|
62
|
+
t: new L(),
|
|
63
|
+
T: new W()
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
sr as parsers
|
|
67
|
+
};
|