@coopdigital/react 0.49.1 → 0.51.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/components/Button/Button.js +2 -2
- package/dist/components/Button/index.js +5 -0
- package/dist/components/Card/Card.js +4 -4
- package/dist/components/Checkbox/Checkbox.d.ts +7 -1
- package/dist/components/Checkbox/Checkbox.js +4 -0
- package/dist/components/DatePicker/DatePicker.d.ts +61 -0
- package/dist/components/DatePicker/DatePicker.js +135 -0
- package/dist/components/DatePicker/datepicker-utils.d.ts +68 -0
- package/dist/components/DatePicker/datepicker-utils.js +215 -0
- package/dist/components/DatePicker/index.d.ts +4 -0
- package/dist/components/Field/Field.js +29 -26
- package/dist/components/Field/index.js +6 -0
- package/dist/components/Pill/Pill.js +2 -2
- package/dist/components/Popover/Popover.d.ts +74 -0
- package/dist/components/Popover/Popover.js +75 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/components/Popover/index.js +5 -0
- package/dist/components/Radio/Radio.d.ts +7 -1
- package/dist/components/Radio/Radio.js +4 -0
- package/dist/components/Searchbox/Searchbox.js +4 -3
- package/dist/components/Select/Select.d.ts +3 -0
- package/dist/components/Select/Select.js +4 -1
- package/dist/components/Signpost/Signpost.js +2 -2
- package/dist/components/Tag/Tag.js +2 -2
- package/dist/components/TextInput/TextInput.d.ts +6 -1
- package/dist/components/TextInput/TextInput.js +3 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -5
- package/dist/components/Textarea/Textarea.js +5 -4
- package/dist/hooks/useSlots.js +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/@date-fns/tz/date/index.js +83 -0
- package/dist/node_modules/@date-fns/tz/date/mini.js +235 -0
- package/dist/node_modules/@date-fns/tz/tzName/index.js +39 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +44 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +814 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +751 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +350 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +137 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +25 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +39 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +63 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +213 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +31 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +209 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +303 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +285 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +19 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +132 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +43 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +89 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +40 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +137 -0
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.js +775 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +94 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +66 -0
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +31 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +25 -0
- package/dist/node_modules/date-fns/addDays.js +41 -0
- package/dist/node_modules/date-fns/addMonths.js +75 -0
- package/dist/node_modules/date-fns/addWeeks.js +33 -0
- package/dist/node_modules/date-fns/addYears.js +33 -0
- package/dist/node_modules/date-fns/constants.js +67 -0
- package/dist/node_modules/date-fns/constructFrom.js +49 -0
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +62 -0
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +42 -0
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +65 -0
- package/dist/node_modules/date-fns/eachYearOfInterval.js +65 -0
- package/dist/node_modules/date-fns/endOfISOWeek.js +35 -0
- package/dist/node_modules/date-fns/endOfMonth.js +37 -0
- package/dist/node_modules/date-fns/endOfWeek.js +53 -0
- package/dist/node_modules/date-fns/endOfYear.js +37 -0
- package/dist/node_modules/date-fns/format.js +423 -0
- package/dist/node_modules/date-fns/getDayOfYear.js +34 -0
- package/dist/node_modules/date-fns/getDaysInMonth.js +36 -0
- package/dist/node_modules/date-fns/getDefaultOptions.js +31 -0
- package/dist/node_modules/date-fns/getISODay.js +33 -0
- package/dist/node_modules/date-fns/getISOWeek.js +40 -0
- package/dist/node_modules/date-fns/getISOWeekYear.js +52 -0
- package/dist/node_modules/date-fns/getMonth.js +29 -0
- package/dist/node_modules/date-fns/getWeek.js +54 -0
- package/dist/node_modules/date-fns/getWeekYear.js +75 -0
- package/dist/node_modules/date-fns/getYear.js +29 -0
- package/dist/node_modules/date-fns/isAfter.js +25 -0
- package/dist/node_modules/date-fns/isBefore.js +25 -0
- package/dist/node_modules/date-fns/isDate.js +41 -0
- package/dist/node_modules/date-fns/isSameDay.js +46 -0
- package/dist/node_modules/date-fns/isSameMonth.js +43 -0
- package/dist/node_modules/date-fns/isSameYear.js +35 -0
- package/dist/node_modules/date-fns/isValid.js +39 -0
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +10 -0
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +64 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +59 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +22 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +103 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +41 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +13 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +189 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +134 -0
- package/dist/node_modules/date-fns/locale/en-US.js +28 -0
- package/dist/node_modules/date-fns/max.js +49 -0
- package/dist/node_modules/date-fns/min.js +49 -0
- package/dist/node_modules/date-fns/parse/_lib/Parser.js +27 -0
- package/dist/node_modules/date-fns/parse/_lib/Setter.js +59 -0
- package/dist/node_modules/date-fns/parse/_lib/constants.js +33 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +55 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +55 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/DateParser.js +59 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +57 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayParser.js +64 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +56 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/EraParser.js +41 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +24 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +21 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +36 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +31 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +32 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +38 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +118 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +47 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +47 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +48 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +44 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +96 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +47 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +76 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +31 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +86 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +83 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +31 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +97 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +86 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +83 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +19 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +19 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/YearParser.js +62 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers.js +110 -0
- package/dist/node_modules/date-fns/parse/_lib/utils.js +135 -0
- package/dist/node_modules/date-fns/parse.js +497 -0
- package/dist/node_modules/date-fns/setDay.js +59 -0
- package/dist/node_modules/date-fns/setISODay.js +40 -0
- package/dist/node_modules/date-fns/setISOWeek.js +39 -0
- package/dist/node_modules/date-fns/setMonth.js +46 -0
- package/dist/node_modules/date-fns/setWeek.js +53 -0
- package/dist/node_modules/date-fns/setYear.js +40 -0
- package/dist/node_modules/date-fns/startOfDay.js +35 -0
- package/dist/node_modules/date-fns/startOfISOWeek.js +35 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +42 -0
- package/dist/node_modules/date-fns/startOfMonth.js +37 -0
- package/dist/node_modules/date-fns/startOfWeek.js +53 -0
- package/dist/node_modules/date-fns/startOfWeekYear.js +64 -0
- package/dist/node_modules/date-fns/startOfYear.js +36 -0
- package/dist/node_modules/date-fns/toDate.js +46 -0
- package/dist/node_modules/date-fns/transpose.js +52 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +320 -0
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +122 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +33 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +604 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +20 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +31 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +23 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +73 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +95 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +22 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +33 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +20 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +59 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +33 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +46 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +53 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +33 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +69 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +51 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +40 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +36 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +37 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +36 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +31 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +11 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +32 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +25 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +22 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js +67 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +57 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +45 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +44 -0
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +174 -0
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +113 -0
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +25 -0
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +56 -0
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +31 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +95 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +57 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +62 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +30 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +74 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +35 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +66 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +9 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +167 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +38 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +21 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +110 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +56 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +10 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +31 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +19 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +51 -0
- package/dist/node_modules/tslib/tslib.es6.js +56 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +24 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +48 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +42 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +77 -0
- package/dist/types/index.d.ts +10 -0
- package/package.json +11 -7
- package/src/components/Checkbox/Checkbox.tsx +6 -1
- package/src/components/DatePicker/DatePicker.tsx +372 -0
- package/src/components/DatePicker/datepicker-utils.ts +269 -0
- package/src/components/DatePicker/index.ts +5 -0
- package/src/components/Field/Field.tsx +30 -28
- package/src/components/Popover/Popover.tsx +198 -0
- package/src/components/Popover/index.ts +5 -0
- package/src/components/Radio/Radio.tsx +6 -1
- package/src/components/Searchbox/Searchbox.tsx +4 -1
- package/src/components/Select/Select.tsx +7 -2
- package/src/components/TextInput/TextInput.tsx +5 -1
- package/src/components/Textarea/Textarea.tsx +9 -13
- package/src/index.ts +2 -0
- package/src/types/index.ts +15 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Parser } from '../Parser.js';
|
|
2
|
+
import { parseNDigits } from '../utils.js';
|
|
3
|
+
|
|
4
|
+
class QuarterParser extends Parser {
|
|
5
|
+
priority = 120;
|
|
6
|
+
|
|
7
|
+
parse(dateString, token, match) {
|
|
8
|
+
switch (token) {
|
|
9
|
+
// 1, 2, 3, 4
|
|
10
|
+
case "Q":
|
|
11
|
+
case "QQ": // 01, 02, 03, 04
|
|
12
|
+
return parseNDigits(token.length, dateString);
|
|
13
|
+
// 1st, 2nd, 3rd, 4th
|
|
14
|
+
case "Qo":
|
|
15
|
+
return match.ordinalNumber(dateString, { unit: "quarter" });
|
|
16
|
+
// Q1, Q2, Q3, Q4
|
|
17
|
+
case "QQQ":
|
|
18
|
+
return (
|
|
19
|
+
match.quarter(dateString, {
|
|
20
|
+
width: "abbreviated",
|
|
21
|
+
context: "formatting",
|
|
22
|
+
}) ||
|
|
23
|
+
match.quarter(dateString, {
|
|
24
|
+
width: "narrow",
|
|
25
|
+
context: "formatting",
|
|
26
|
+
})
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
30
|
+
case "QQQQQ":
|
|
31
|
+
return match.quarter(dateString, {
|
|
32
|
+
width: "narrow",
|
|
33
|
+
context: "formatting",
|
|
34
|
+
});
|
|
35
|
+
// 1st quarter, 2nd quarter, ...
|
|
36
|
+
case "QQQQ":
|
|
37
|
+
default:
|
|
38
|
+
return (
|
|
39
|
+
match.quarter(dateString, {
|
|
40
|
+
width: "wide",
|
|
41
|
+
context: "formatting",
|
|
42
|
+
}) ||
|
|
43
|
+
match.quarter(dateString, {
|
|
44
|
+
width: "abbreviated",
|
|
45
|
+
context: "formatting",
|
|
46
|
+
}) ||
|
|
47
|
+
match.quarter(dateString, {
|
|
48
|
+
width: "narrow",
|
|
49
|
+
context: "formatting",
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
validate(_date, value) {
|
|
56
|
+
return value >= 1 && value <= 4;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
set(date, _flags, value) {
|
|
60
|
+
date.setMonth((value - 1) * 3, 1);
|
|
61
|
+
date.setHours(0, 0, 0, 0);
|
|
62
|
+
return date;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
incompatibleTokens = [
|
|
66
|
+
"Y",
|
|
67
|
+
"R",
|
|
68
|
+
"q",
|
|
69
|
+
"M",
|
|
70
|
+
"L",
|
|
71
|
+
"w",
|
|
72
|
+
"I",
|
|
73
|
+
"d",
|
|
74
|
+
"D",
|
|
75
|
+
"i",
|
|
76
|
+
"e",
|
|
77
|
+
"c",
|
|
78
|
+
"t",
|
|
79
|
+
"T",
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { QuarterParser };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { numericPatterns } from '../constants.js';
|
|
2
|
+
import { Parser } from '../Parser.js';
|
|
3
|
+
import { parseNDigits, parseNumericPattern } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
class SecondParser extends Parser {
|
|
6
|
+
priority = 50;
|
|
7
|
+
|
|
8
|
+
parse(dateString, token, match) {
|
|
9
|
+
switch (token) {
|
|
10
|
+
case "s":
|
|
11
|
+
return parseNumericPattern(numericPatterns.second, dateString);
|
|
12
|
+
case "so":
|
|
13
|
+
return match.ordinalNumber(dateString, { unit: "second" });
|
|
14
|
+
default:
|
|
15
|
+
return parseNDigits(token.length, dateString);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
validate(_date, value) {
|
|
20
|
+
return value >= 0 && value <= 59;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
set(date, _flags, value) {
|
|
24
|
+
date.setSeconds(value, 0);
|
|
25
|
+
return date;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
incompatibleTokens = ["t", "T"];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { SecondParser };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { setDay } from '../../../setDay.js';
|
|
2
|
+
import { Parser } from '../Parser.js';
|
|
3
|
+
import { mapValue, parseNDigits } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
// Stand-alone local day of week
|
|
6
|
+
class StandAloneLocalDayParser extends Parser {
|
|
7
|
+
priority = 90;
|
|
8
|
+
|
|
9
|
+
parse(dateString, token, match, options) {
|
|
10
|
+
const valueCallback = (value) => {
|
|
11
|
+
// We want here floor instead of trunc, so we get -7 for value 0 instead of 0
|
|
12
|
+
const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
13
|
+
return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
switch (token) {
|
|
17
|
+
// 3
|
|
18
|
+
case "c":
|
|
19
|
+
case "cc": // 03
|
|
20
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
21
|
+
// 3rd
|
|
22
|
+
case "co":
|
|
23
|
+
return mapValue(
|
|
24
|
+
match.ordinalNumber(dateString, {
|
|
25
|
+
unit: "day",
|
|
26
|
+
}),
|
|
27
|
+
valueCallback,
|
|
28
|
+
);
|
|
29
|
+
// Tue
|
|
30
|
+
case "ccc":
|
|
31
|
+
return (
|
|
32
|
+
match.day(dateString, {
|
|
33
|
+
width: "abbreviated",
|
|
34
|
+
context: "standalone",
|
|
35
|
+
}) ||
|
|
36
|
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
|
37
|
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// T
|
|
41
|
+
case "ccccc":
|
|
42
|
+
return match.day(dateString, {
|
|
43
|
+
width: "narrow",
|
|
44
|
+
context: "standalone",
|
|
45
|
+
});
|
|
46
|
+
// Tu
|
|
47
|
+
case "cccccc":
|
|
48
|
+
return (
|
|
49
|
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
|
50
|
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
// Tuesday
|
|
54
|
+
case "cccc":
|
|
55
|
+
default:
|
|
56
|
+
return (
|
|
57
|
+
match.day(dateString, { width: "wide", context: "standalone" }) ||
|
|
58
|
+
match.day(dateString, {
|
|
59
|
+
width: "abbreviated",
|
|
60
|
+
context: "standalone",
|
|
61
|
+
}) ||
|
|
62
|
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
|
63
|
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
validate(_date, value) {
|
|
69
|
+
return value >= 0 && value <= 6;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
set(date, _flags, value, options) {
|
|
73
|
+
date = setDay(date, value, options);
|
|
74
|
+
date.setHours(0, 0, 0, 0);
|
|
75
|
+
return date;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
incompatibleTokens = [
|
|
79
|
+
"y",
|
|
80
|
+
"R",
|
|
81
|
+
"u",
|
|
82
|
+
"q",
|
|
83
|
+
"Q",
|
|
84
|
+
"M",
|
|
85
|
+
"L",
|
|
86
|
+
"I",
|
|
87
|
+
"d",
|
|
88
|
+
"D",
|
|
89
|
+
"E",
|
|
90
|
+
"i",
|
|
91
|
+
"e",
|
|
92
|
+
"t",
|
|
93
|
+
"T",
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { StandAloneLocalDayParser };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { numericPatterns } from '../constants.js';
|
|
2
|
+
import { Parser } from '../Parser.js';
|
|
3
|
+
import { mapValue, parseNDigits, parseNumericPattern } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
class StandAloneMonthParser extends Parser {
|
|
6
|
+
priority = 110;
|
|
7
|
+
|
|
8
|
+
parse(dateString, token, match) {
|
|
9
|
+
const valueCallback = (value) => value - 1;
|
|
10
|
+
|
|
11
|
+
switch (token) {
|
|
12
|
+
// 1, 2, ..., 12
|
|
13
|
+
case "L":
|
|
14
|
+
return mapValue(
|
|
15
|
+
parseNumericPattern(numericPatterns.month, dateString),
|
|
16
|
+
valueCallback,
|
|
17
|
+
);
|
|
18
|
+
// 01, 02, ..., 12
|
|
19
|
+
case "LL":
|
|
20
|
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
|
21
|
+
// 1st, 2nd, ..., 12th
|
|
22
|
+
case "Lo":
|
|
23
|
+
return mapValue(
|
|
24
|
+
match.ordinalNumber(dateString, {
|
|
25
|
+
unit: "month",
|
|
26
|
+
}),
|
|
27
|
+
valueCallback,
|
|
28
|
+
);
|
|
29
|
+
// Jan, Feb, ..., Dec
|
|
30
|
+
case "LLL":
|
|
31
|
+
return (
|
|
32
|
+
match.month(dateString, {
|
|
33
|
+
width: "abbreviated",
|
|
34
|
+
context: "standalone",
|
|
35
|
+
}) ||
|
|
36
|
+
match.month(dateString, { width: "narrow", context: "standalone" })
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// J, F, ..., D
|
|
40
|
+
case "LLLLL":
|
|
41
|
+
return match.month(dateString, {
|
|
42
|
+
width: "narrow",
|
|
43
|
+
context: "standalone",
|
|
44
|
+
});
|
|
45
|
+
// January, February, ..., December
|
|
46
|
+
case "LLLL":
|
|
47
|
+
default:
|
|
48
|
+
return (
|
|
49
|
+
match.month(dateString, { width: "wide", context: "standalone" }) ||
|
|
50
|
+
match.month(dateString, {
|
|
51
|
+
width: "abbreviated",
|
|
52
|
+
context: "standalone",
|
|
53
|
+
}) ||
|
|
54
|
+
match.month(dateString, { width: "narrow", context: "standalone" })
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
validate(_date, value) {
|
|
60
|
+
return value >= 0 && value <= 11;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
set(date, _flags, value) {
|
|
64
|
+
date.setMonth(value, 1);
|
|
65
|
+
date.setHours(0, 0, 0, 0);
|
|
66
|
+
return date;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
incompatibleTokens = [
|
|
70
|
+
"Y",
|
|
71
|
+
"R",
|
|
72
|
+
"q",
|
|
73
|
+
"Q",
|
|
74
|
+
"M",
|
|
75
|
+
"w",
|
|
76
|
+
"I",
|
|
77
|
+
"D",
|
|
78
|
+
"i",
|
|
79
|
+
"e",
|
|
80
|
+
"c",
|
|
81
|
+
"t",
|
|
82
|
+
"T",
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { StandAloneMonthParser };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Parser } from '../Parser.js';
|
|
2
|
+
import { parseNDigits } from '../utils.js';
|
|
3
|
+
|
|
4
|
+
class StandAloneQuarterParser extends Parser {
|
|
5
|
+
priority = 120;
|
|
6
|
+
|
|
7
|
+
parse(dateString, token, match) {
|
|
8
|
+
switch (token) {
|
|
9
|
+
// 1, 2, 3, 4
|
|
10
|
+
case "q":
|
|
11
|
+
case "qq": // 01, 02, 03, 04
|
|
12
|
+
return parseNDigits(token.length, dateString);
|
|
13
|
+
// 1st, 2nd, 3rd, 4th
|
|
14
|
+
case "qo":
|
|
15
|
+
return match.ordinalNumber(dateString, { unit: "quarter" });
|
|
16
|
+
// Q1, Q2, Q3, Q4
|
|
17
|
+
case "qqq":
|
|
18
|
+
return (
|
|
19
|
+
match.quarter(dateString, {
|
|
20
|
+
width: "abbreviated",
|
|
21
|
+
context: "standalone",
|
|
22
|
+
}) ||
|
|
23
|
+
match.quarter(dateString, {
|
|
24
|
+
width: "narrow",
|
|
25
|
+
context: "standalone",
|
|
26
|
+
})
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
30
|
+
case "qqqqq":
|
|
31
|
+
return match.quarter(dateString, {
|
|
32
|
+
width: "narrow",
|
|
33
|
+
context: "standalone",
|
|
34
|
+
});
|
|
35
|
+
// 1st quarter, 2nd quarter, ...
|
|
36
|
+
case "qqqq":
|
|
37
|
+
default:
|
|
38
|
+
return (
|
|
39
|
+
match.quarter(dateString, {
|
|
40
|
+
width: "wide",
|
|
41
|
+
context: "standalone",
|
|
42
|
+
}) ||
|
|
43
|
+
match.quarter(dateString, {
|
|
44
|
+
width: "abbreviated",
|
|
45
|
+
context: "standalone",
|
|
46
|
+
}) ||
|
|
47
|
+
match.quarter(dateString, {
|
|
48
|
+
width: "narrow",
|
|
49
|
+
context: "standalone",
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
validate(_date, value) {
|
|
56
|
+
return value >= 1 && value <= 4;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
set(date, _flags, value) {
|
|
60
|
+
date.setMonth((value - 1) * 3, 1);
|
|
61
|
+
date.setHours(0, 0, 0, 0);
|
|
62
|
+
return date;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
incompatibleTokens = [
|
|
66
|
+
"Y",
|
|
67
|
+
"R",
|
|
68
|
+
"Q",
|
|
69
|
+
"M",
|
|
70
|
+
"L",
|
|
71
|
+
"w",
|
|
72
|
+
"I",
|
|
73
|
+
"d",
|
|
74
|
+
"D",
|
|
75
|
+
"i",
|
|
76
|
+
"e",
|
|
77
|
+
"c",
|
|
78
|
+
"t",
|
|
79
|
+
"T",
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { StandAloneQuarterParser };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { constructFrom } from '../../../constructFrom.js';
|
|
2
|
+
import { Parser } from '../Parser.js';
|
|
3
|
+
import { parseAnyDigitsSigned } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
class TimestampMillisecondsParser extends Parser {
|
|
6
|
+
priority = 20;
|
|
7
|
+
|
|
8
|
+
parse(dateString) {
|
|
9
|
+
return parseAnyDigitsSigned(dateString);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
set(date, _flags, value) {
|
|
13
|
+
return [constructFrom(date, value), { timestampIsSet: true }];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
incompatibleTokens = "*";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { TimestampMillisecondsParser };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { constructFrom } from '../../../constructFrom.js';
|
|
2
|
+
import { Parser } from '../Parser.js';
|
|
3
|
+
import { parseAnyDigitsSigned } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
class TimestampSecondsParser extends Parser {
|
|
6
|
+
priority = 40;
|
|
7
|
+
|
|
8
|
+
parse(dateString) {
|
|
9
|
+
return parseAnyDigitsSigned(dateString);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
set(date, _flags, value) {
|
|
13
|
+
return [constructFrom(date, value * 1000), { timestampIsSet: true }];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
incompatibleTokens = "*";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { TimestampSecondsParser };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Parser } from '../Parser.js';
|
|
2
|
+
import { mapValue, parseNDigits, normalizeTwoDigitYear } from '../utils.js';
|
|
3
|
+
|
|
4
|
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
|
|
5
|
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
6
|
+
// |----------|-------|----|-------|-------|-------|
|
|
7
|
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
8
|
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
9
|
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
10
|
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
11
|
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
12
|
+
class YearParser extends Parser {
|
|
13
|
+
priority = 130;
|
|
14
|
+
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
15
|
+
|
|
16
|
+
parse(dateString, token, match) {
|
|
17
|
+
const valueCallback = (year) => ({
|
|
18
|
+
year,
|
|
19
|
+
isTwoDigitYear: token === "yy",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
switch (token) {
|
|
23
|
+
case "y":
|
|
24
|
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
|
25
|
+
case "yo":
|
|
26
|
+
return mapValue(
|
|
27
|
+
match.ordinalNumber(dateString, {
|
|
28
|
+
unit: "year",
|
|
29
|
+
}),
|
|
30
|
+
valueCallback,
|
|
31
|
+
);
|
|
32
|
+
default:
|
|
33
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
validate(_date, value) {
|
|
38
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
set(date, flags, value) {
|
|
42
|
+
const currentYear = date.getFullYear();
|
|
43
|
+
|
|
44
|
+
if (value.isTwoDigitYear) {
|
|
45
|
+
const normalizedTwoDigitYear = normalizeTwoDigitYear(
|
|
46
|
+
value.year,
|
|
47
|
+
currentYear,
|
|
48
|
+
);
|
|
49
|
+
date.setFullYear(normalizedTwoDigitYear, 0, 1);
|
|
50
|
+
date.setHours(0, 0, 0, 0);
|
|
51
|
+
return date;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const year =
|
|
55
|
+
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
56
|
+
date.setFullYear(year, 0, 1);
|
|
57
|
+
date.setHours(0, 0, 0, 0);
|
|
58
|
+
return date;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { YearParser };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { EraParser } from './parsers/EraParser.js';
|
|
2
|
+
import { YearParser } from './parsers/YearParser.js';
|
|
3
|
+
import { LocalWeekYearParser } from './parsers/LocalWeekYearParser.js';
|
|
4
|
+
import { ISOWeekYearParser } from './parsers/ISOWeekYearParser.js';
|
|
5
|
+
import { ExtendedYearParser } from './parsers/ExtendedYearParser.js';
|
|
6
|
+
import { QuarterParser } from './parsers/QuarterParser.js';
|
|
7
|
+
import { StandAloneQuarterParser } from './parsers/StandAloneQuarterParser.js';
|
|
8
|
+
import { MonthParser } from './parsers/MonthParser.js';
|
|
9
|
+
import { StandAloneMonthParser } from './parsers/StandAloneMonthParser.js';
|
|
10
|
+
import { LocalWeekParser } from './parsers/LocalWeekParser.js';
|
|
11
|
+
import { ISOWeekParser } from './parsers/ISOWeekParser.js';
|
|
12
|
+
import { DateParser } from './parsers/DateParser.js';
|
|
13
|
+
import { DayOfYearParser } from './parsers/DayOfYearParser.js';
|
|
14
|
+
import { DayParser } from './parsers/DayParser.js';
|
|
15
|
+
import { LocalDayParser } from './parsers/LocalDayParser.js';
|
|
16
|
+
import { StandAloneLocalDayParser } from './parsers/StandAloneLocalDayParser.js';
|
|
17
|
+
import { ISODayParser } from './parsers/ISODayParser.js';
|
|
18
|
+
import { AMPMParser } from './parsers/AMPMParser.js';
|
|
19
|
+
import { AMPMMidnightParser } from './parsers/AMPMMidnightParser.js';
|
|
20
|
+
import { DayPeriodParser } from './parsers/DayPeriodParser.js';
|
|
21
|
+
import { Hour1to12Parser } from './parsers/Hour1to12Parser.js';
|
|
22
|
+
import { Hour0to23Parser } from './parsers/Hour0to23Parser.js';
|
|
23
|
+
import { Hour0To11Parser } from './parsers/Hour0To11Parser.js';
|
|
24
|
+
import { Hour1To24Parser } from './parsers/Hour1To24Parser.js';
|
|
25
|
+
import { MinuteParser } from './parsers/MinuteParser.js';
|
|
26
|
+
import { SecondParser } from './parsers/SecondParser.js';
|
|
27
|
+
import { FractionOfSecondParser } from './parsers/FractionOfSecondParser.js';
|
|
28
|
+
import { ISOTimezoneWithZParser } from './parsers/ISOTimezoneWithZParser.js';
|
|
29
|
+
import { ISOTimezoneParser } from './parsers/ISOTimezoneParser.js';
|
|
30
|
+
import { TimestampSecondsParser } from './parsers/TimestampSecondsParser.js';
|
|
31
|
+
import { TimestampMillisecondsParser } from './parsers/TimestampMillisecondsParser.js';
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* | | Unit | | Unit |
|
|
35
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
36
|
+
* | a | AM, PM | A* | Milliseconds in day |
|
|
37
|
+
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
38
|
+
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
39
|
+
* | d | Day of month | D | Day of year |
|
|
40
|
+
* | e | Local day of week | E | Day of week |
|
|
41
|
+
* | f | | F* | Day of week in month |
|
|
42
|
+
* | g* | Modified Julian day | G | Era |
|
|
43
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
44
|
+
* | i! | ISO day of week | I! | ISO week of year |
|
|
45
|
+
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
46
|
+
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
47
|
+
* | l* | (deprecated) | L | Stand-alone month |
|
|
48
|
+
* | m | Minute | M | Month |
|
|
49
|
+
* | n | | N | |
|
|
50
|
+
* | o! | Ordinal number modifier | O* | Timezone (GMT) |
|
|
51
|
+
* | p | | P | |
|
|
52
|
+
* | q | Stand-alone quarter | Q | Quarter |
|
|
53
|
+
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
54
|
+
* | s | Second | S | Fraction of second |
|
|
55
|
+
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
56
|
+
* | u | Extended year | U* | Cyclic year |
|
|
57
|
+
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
58
|
+
* | w | Local week of year | W* | Week of month |
|
|
59
|
+
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
60
|
+
* | y | Year (abs) | Y | Local week-numbering year |
|
|
61
|
+
* | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
62
|
+
*
|
|
63
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
64
|
+
*
|
|
65
|
+
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
66
|
+
* - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
|
|
67
|
+
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
68
|
+
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
69
|
+
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
70
|
+
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
71
|
+
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
72
|
+
* for universal ISO week-numbering date, whereas
|
|
73
|
+
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
74
|
+
* for week-numbering date specific to the locale.
|
|
75
|
+
*/
|
|
76
|
+
const parsers = {
|
|
77
|
+
G: new EraParser(),
|
|
78
|
+
y: new YearParser(),
|
|
79
|
+
Y: new LocalWeekYearParser(),
|
|
80
|
+
R: new ISOWeekYearParser(),
|
|
81
|
+
u: new ExtendedYearParser(),
|
|
82
|
+
Q: new QuarterParser(),
|
|
83
|
+
q: new StandAloneQuarterParser(),
|
|
84
|
+
M: new MonthParser(),
|
|
85
|
+
L: new StandAloneMonthParser(),
|
|
86
|
+
w: new LocalWeekParser(),
|
|
87
|
+
I: new ISOWeekParser(),
|
|
88
|
+
d: new DateParser(),
|
|
89
|
+
D: new DayOfYearParser(),
|
|
90
|
+
E: new DayParser(),
|
|
91
|
+
e: new LocalDayParser(),
|
|
92
|
+
c: new StandAloneLocalDayParser(),
|
|
93
|
+
i: new ISODayParser(),
|
|
94
|
+
a: new AMPMParser(),
|
|
95
|
+
b: new AMPMMidnightParser(),
|
|
96
|
+
B: new DayPeriodParser(),
|
|
97
|
+
h: new Hour1to12Parser(),
|
|
98
|
+
H: new Hour0to23Parser(),
|
|
99
|
+
K: new Hour0To11Parser(),
|
|
100
|
+
k: new Hour1To24Parser(),
|
|
101
|
+
m: new MinuteParser(),
|
|
102
|
+
s: new SecondParser(),
|
|
103
|
+
S: new FractionOfSecondParser(),
|
|
104
|
+
X: new ISOTimezoneWithZParser(),
|
|
105
|
+
x: new ISOTimezoneParser(),
|
|
106
|
+
t: new TimestampSecondsParser(),
|
|
107
|
+
T: new TimestampMillisecondsParser(),
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { parsers };
|