@paperless/core 0.1.0-alpha.99 → 1.3.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/CHANGELOG.md +3838 -0
- package/README.md +9 -1
- package/dist/assets/i18n/page-size-select.i18n.en.json +4 -0
- package/dist/assets/i18n/page-size-select.i18n.nl.json +4 -0
- package/dist/assets/i18n/table-footer.i18n.en.json +3 -0
- package/dist/assets/i18n/table-footer.i18n.nl.json +3 -0
- package/dist/assets/i18n/table-header.i18n.en.json +6 -0
- package/dist/assets/i18n/table-header.i18n.nl.json +6 -0
- package/dist/assets/i18n/table.i18n.en.json +13 -0
- package/dist/assets/i18n/table.i18n.nl.json +13 -0
- package/dist/assets/icons/bread.svg +5 -12
- package/dist/assets/icons/camera.svg +10 -0
- package/dist/assets/icons/car.svg +5 -12
- package/dist/assets/icons/fa/building.svg +3 -0
- package/dist/assets/icons/fa/buildings.svg +3 -0
- package/dist/assets/icons/fa/piggy.svg +3 -0
- package/dist/assets/icons/filter.svg +6 -13
- package/dist/assets/icons/notification.svg +10 -0
- package/dist/assets/icons/reload.svg +10 -0
- package/dist/assets/icons/search.svg +5 -12
- package/dist/assets/illustrations/empty-state-add.svg +65 -0
- package/dist/assets/illustrations/empty-state-overview.svg +58 -0
- package/dist/assets/illustrations/empty-state-search.svg +88 -0
- package/dist/assets/images/helper/helper-hover.svg +6 -6
- package/dist/assets/images/helper/helper.svg +2 -2
- package/dist/build/index.esm.js +2 -0
- package/dist/build/index.esm.js.map +1 -0
- package/dist/build/p-07259c61.entry.js +2 -0
- package/dist/build/p-07259c61.entry.js.map +1 -0
- package/dist/build/p-11f5c8c7.entry.js +2 -0
- package/dist/build/p-11f5c8c7.entry.js.map +1 -0
- package/dist/build/p-12171df4.entry.js +2 -0
- package/dist/build/p-12171df4.entry.js.map +1 -0
- package/dist/build/p-1630e39b.entry.js +2 -0
- package/dist/build/p-1630e39b.entry.js.map +1 -0
- package/dist/build/p-18c0dd17.entry.js +2 -0
- package/dist/build/p-18c0dd17.entry.js.map +1 -0
- package/dist/build/p-195632a8.entry.js +2 -0
- package/dist/build/p-195632a8.entry.js.map +1 -0
- package/dist/build/p-1f55126f.entry.js +2 -0
- package/dist/build/p-1f55126f.entry.js.map +1 -0
- package/dist/build/p-26da620b.entry.js +2 -0
- package/dist/build/p-26da620b.entry.js.map +1 -0
- package/dist/build/p-2a668e75.entry.js +2 -0
- package/dist/build/p-2a668e75.entry.js.map +1 -0
- package/dist/build/p-350d452b.entry.js +2 -0
- package/dist/build/p-350d452b.entry.js.map +1 -0
- package/dist/build/p-36967a97.entry.js +2 -0
- package/dist/build/p-36967a97.entry.js.map +1 -0
- package/dist/build/p-3d8b2178.entry.js +2 -0
- package/dist/build/p-3d8b2178.entry.js.map +1 -0
- package/dist/build/p-47bcc23e.entry.js +2 -0
- package/dist/build/p-47bcc23e.entry.js.map +1 -0
- package/dist/build/p-47e461b7.entry.js +2 -0
- package/dist/build/p-47e461b7.entry.js.map +1 -0
- package/dist/build/p-4c51a801.entry.js +2 -0
- package/dist/build/p-4c51a801.entry.js.map +1 -0
- package/dist/build/p-4e650fe4.js +2 -0
- package/dist/build/p-4e650fe4.js.map +1 -0
- package/dist/build/p-51408aca.entry.js +2 -0
- package/dist/build/p-51408aca.entry.js.map +1 -0
- package/dist/build/p-594b28a7.entry.js +2 -0
- package/dist/build/p-594b28a7.entry.js.map +1 -0
- package/dist/build/p-5c7b20a3.entry.js +2 -0
- package/dist/build/p-5c7b20a3.entry.js.map +1 -0
- package/dist/build/p-6124f388.entry.js +2 -0
- package/dist/build/p-6124f388.entry.js.map +1 -0
- package/dist/build/p-6c60fd3d.js +2 -0
- package/dist/build/p-6c60fd3d.js.map +1 -0
- package/dist/build/p-6ccf5cdd.js +3 -0
- package/dist/build/p-6ccf5cdd.js.map +1 -0
- package/dist/build/p-6d5aa646.entry.js +2 -0
- package/dist/build/p-6d5aa646.entry.js.map +1 -0
- package/dist/build/p-6f1352e0.entry.js +2 -0
- package/dist/build/p-6f1352e0.entry.js.map +1 -0
- package/dist/build/p-8a6728d5.js +2 -0
- package/dist/build/p-8a6728d5.js.map +1 -0
- package/dist/build/p-910bd6bc.entry.js +2 -0
- package/dist/build/p-910bd6bc.entry.js.map +1 -0
- package/dist/build/p-91725831.entry.js +2 -0
- package/dist/build/p-91725831.entry.js.map +1 -0
- package/dist/build/p-946286e2.entry.js +2 -0
- package/dist/build/p-946286e2.entry.js.map +1 -0
- package/dist/build/p-a1c1d95b.entry.js +2 -0
- package/dist/build/p-a1c1d95b.entry.js.map +1 -0
- package/dist/build/p-a23ea8fe.entry.js +2 -0
- package/dist/build/p-a23ea8fe.entry.js.map +1 -0
- package/dist/build/p-abcd80e9.entry.js +2 -0
- package/dist/build/p-abcd80e9.entry.js.map +1 -0
- package/dist/build/p-ae248aef.js +2 -0
- package/dist/build/p-ae248aef.js.map +1 -0
- package/dist/build/p-b0398d3b.entry.js +2 -0
- package/dist/build/p-b0398d3b.entry.js.map +1 -0
- package/dist/build/p-b2bc1d2a.entry.js +2 -0
- package/dist/build/p-b2bc1d2a.entry.js.map +1 -0
- package/dist/build/p-b5ce8cd4.entry.js +2 -0
- package/dist/build/p-b5ce8cd4.entry.js.map +1 -0
- package/dist/build/p-b92dd098.entry.js +2 -0
- package/dist/build/p-b92dd098.entry.js.map +1 -0
- package/dist/build/p-b9f742e0.entry.js +2 -0
- package/dist/build/p-b9f742e0.entry.js.map +1 -0
- package/dist/build/p-bf0eca4f.entry.js +2 -0
- package/dist/build/p-bf0eca4f.entry.js.map +1 -0
- package/dist/build/p-ce1abd74.entry.js +2 -0
- package/dist/build/p-ce1abd74.entry.js.map +1 -0
- package/dist/build/p-ce443f5b.entry.js +2 -0
- package/dist/build/p-ce443f5b.entry.js.map +1 -0
- package/dist/build/p-da2426c7.js +2 -0
- package/dist/build/p-da2426c7.js.map +1 -0
- package/dist/build/p-da6e5abd.entry.js +2 -0
- package/dist/build/p-da6e5abd.entry.js.map +1 -0
- package/dist/build/p-e17560e6.entry.js +2 -0
- package/dist/build/p-e17560e6.entry.js.map +1 -0
- package/dist/build/p-e1da7376.entry.js +2 -0
- package/dist/build/p-e1da7376.entry.js.map +1 -0
- package/dist/build/p-e9a1b51e.entry.js +2 -0
- package/dist/build/p-e9a1b51e.entry.js.map +1 -0
- package/dist/build/p-ec850aca.entry.js +2 -0
- package/dist/build/p-ec850aca.entry.js.map +1 -0
- package/dist/build/p-ed6edf0a.entry.js +2 -0
- package/dist/build/p-ed6edf0a.entry.js.map +1 -0
- package/dist/build/p-f47247a6.entry.js +2 -0
- package/dist/build/p-f47247a6.entry.js.map +1 -0
- package/dist/build/p-fef32402.js +2 -0
- package/dist/build/p-fef32402.js.map +1 -0
- package/dist/build/paperless.css +1 -253
- package/dist/build/paperless.esm.js +2 -1
- package/dist/build/paperless.esm.js.map +1 -0
- package/dist/cjs/child-of-e472f812.js +11 -0
- package/dist/cjs/child-of-e472f812.js.map +1 -0
- package/dist/cjs/constants-a4459ec9.js +9 -0
- package/dist/cjs/constants-a4459ec9.js.map +1 -0
- package/dist/cjs/floating-ui.dom.esm-62336770.js +1334 -0
- package/dist/cjs/floating-ui.dom.esm-62336770.js.map +1 -0
- package/dist/cjs/index-b59a0544.js +2324 -0
- package/dist/cjs/index-b59a0544.js.map +1 -0
- package/dist/cjs/{index-9d3b51c9.js → index-dfc4dfec.js} +980 -339
- package/dist/cjs/index-dfc4dfec.js.map +1 -0
- package/dist/cjs/index.cjs.js +20 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +6 -3
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/localization-9e2ac7f3.js +62 -0
- package/dist/cjs/localization-9e2ac7f3.js.map +1 -0
- package/dist/cjs/object-get-by-path-ee5540a5.js +19 -0
- package/dist/cjs/object-get-by-path-ee5540a5.js.map +1 -0
- package/dist/cjs/p-accordion.cjs.entry.js +5 -11
- package/dist/cjs/p-accordion.cjs.entry.js.map +1 -0
- package/dist/cjs/p-attachment.cjs.entry.js +39 -0
- package/dist/cjs/p-attachment.cjs.entry.js.map +1 -0
- package/dist/cjs/p-avatar-group.cjs.entry.js +5 -2
- package/dist/cjs/p-avatar-group.cjs.entry.js.map +1 -0
- package/dist/cjs/p-avatar.cjs.entry.js +45 -0
- package/dist/cjs/p-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/p-backdrop.cjs.entry.js +43 -0
- package/dist/cjs/p-backdrop.cjs.entry.js.map +1 -0
- package/dist/cjs/p-button_3.cjs.entry.js +142 -148
- package/dist/cjs/p-button_3.cjs.entry.js.map +1 -0
- package/dist/cjs/p-calendar.cjs.entry.js +703 -0
- package/dist/cjs/p-calendar.cjs.entry.js.map +1 -0
- package/dist/cjs/p-card-body.cjs.entry.js +4 -5
- package/dist/cjs/p-card-body.cjs.entry.js.map +1 -0
- package/dist/cjs/p-card-container.cjs.entry.js +4 -8
- package/dist/cjs/p-card-container.cjs.entry.js.map +1 -0
- package/dist/cjs/p-card-header.cjs.entry.js +5 -5
- package/dist/cjs/p-card-header.cjs.entry.js.map +1 -0
- package/dist/cjs/p-content-slider.cjs.entry.js +115 -56
- package/dist/cjs/p-content-slider.cjs.entry.js.map +1 -0
- package/dist/cjs/p-counter.cjs.entry.js +4 -8
- package/dist/cjs/p-counter.cjs.entry.js.map +1 -0
- package/dist/cjs/p-datepicker.cjs.entry.js +3043 -0
- package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -0
- package/dist/cjs/p-divider.cjs.entry.js +4 -2
- package/dist/cjs/p-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/p-drawer-body_3.cjs.entry.js +51 -0
- package/dist/cjs/p-drawer-body_3.cjs.entry.js.map +1 -0
- package/dist/cjs/p-drawer.cjs.entry.js +65 -0
- package/dist/cjs/p-drawer.cjs.entry.js.map +1 -0
- package/dist/cjs/p-dropdown-menu-container.cjs.entry.js +7 -3
- package/dist/cjs/p-dropdown-menu-container.cjs.entry.js.map +1 -0
- package/dist/cjs/p-dropdown_2.cjs.entry.js +163 -0
- package/dist/cjs/p-dropdown_2.cjs.entry.js.map +1 -0
- package/dist/cjs/p-helper_3.cjs.entry.js +150 -0
- package/dist/cjs/p-helper_3.cjs.entry.js.map +1 -0
- package/dist/cjs/p-illustration_6.cjs.entry.js +2840 -0
- package/dist/cjs/p-illustration_6.cjs.entry.js.map +1 -0
- package/dist/cjs/p-info-panel.cjs.entry.js +6 -8
- package/dist/cjs/p-info-panel.cjs.entry.js.map +1 -0
- package/dist/cjs/p-label_3.cjs.entry.js +65 -0
- package/dist/cjs/p-label_3.cjs.entry.js.map +1 -0
- package/dist/cjs/p-layout.cjs.entry.js +4 -5
- package/dist/cjs/p-layout.cjs.entry.js.map +1 -0
- package/dist/cjs/p-modal-body_4.cjs.entry.js +79 -0
- package/dist/cjs/p-modal-body_4.cjs.entry.js.map +1 -0
- package/dist/cjs/p-modal.cjs.entry.js +34 -21
- package/dist/cjs/p-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/p-navbar.cjs.entry.js +5 -9
- package/dist/cjs/p-navbar.cjs.entry.js.map +1 -0
- package/dist/cjs/p-navigation-item.cjs.entry.js +8 -5
- package/dist/cjs/p-navigation-item.cjs.entry.js.map +1 -0
- package/dist/cjs/p-page-size-select_3.cjs.entry.js +224 -0
- package/dist/cjs/p-page-size-select_3.cjs.entry.js.map +1 -0
- package/dist/cjs/p-profile.cjs.entry.js +14 -15
- package/dist/cjs/p-profile.cjs.entry.js.map +1 -0
- package/dist/cjs/p-select.cjs.entry.js +245 -0
- package/dist/cjs/p-select.cjs.entry.js.map +1 -0
- package/dist/cjs/p-slider-indicator.cjs.entry.js +4 -5
- package/dist/cjs/p-slider-indicator.cjs.entry.js.map +1 -0
- package/dist/cjs/p-status.cjs.entry.js +7 -5
- package/dist/cjs/p-status.cjs.entry.js.map +1 -0
- package/dist/cjs/p-stepper-item.cjs.entry.js +26 -0
- package/dist/cjs/p-stepper-item.cjs.entry.js.map +1 -0
- package/dist/cjs/p-stepper-line.cjs.entry.js +23 -0
- package/dist/cjs/p-stepper-line.cjs.entry.js.map +1 -0
- package/dist/cjs/p-stepper.cjs.entry.js +53 -44
- package/dist/cjs/p-stepper.cjs.entry.js.map +1 -0
- package/dist/cjs/p-tab-group.cjs.entry.js +11 -10
- package/dist/cjs/p-tab-group.cjs.entry.js.map +1 -0
- package/dist/cjs/p-tab-item.cjs.entry.js +4 -5
- package/dist/cjs/p-tab-item.cjs.entry.js.map +1 -0
- package/dist/cjs/p-table-column.cjs.entry.js +30 -0
- package/dist/cjs/p-table-column.cjs.entry.js.map +1 -0
- package/dist/cjs/p-table.cjs.entry.js +360 -0
- package/dist/cjs/p-table.cjs.entry.js.map +1 -0
- package/dist/cjs/p-toast-container.cjs.entry.js +22 -0
- package/dist/cjs/p-toast-container.cjs.entry.js.map +1 -0
- package/dist/cjs/p-toast.cjs.entry.js +35 -0
- package/dist/cjs/p-toast.cjs.entry.js.map +1 -0
- package/dist/cjs/p-tooltip.cjs.entry.js +59 -61
- package/dist/cjs/p-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/paperless.cjs.js +12 -3
- package/dist/cjs/paperless.cjs.js.map +1 -0
- package/dist/collection/assets/icons/bread.svg +5 -12
- package/dist/collection/assets/icons/camera.svg +10 -0
- package/dist/collection/assets/icons/car.svg +5 -12
- package/dist/collection/assets/icons/fa/building.svg +3 -0
- package/dist/collection/assets/icons/fa/buildings.svg +3 -0
- package/dist/collection/assets/icons/fa/piggy.svg +3 -0
- package/dist/collection/assets/icons/filter.svg +6 -13
- package/dist/collection/assets/icons/notification.svg +10 -0
- package/dist/collection/assets/icons/reload.svg +10 -0
- package/dist/collection/assets/icons/search.svg +5 -12
- package/dist/collection/assets/illustrations/empty-state-add.svg +65 -0
- package/dist/collection/assets/illustrations/empty-state-overview.svg +58 -0
- package/dist/collection/assets/illustrations/empty-state-search.svg +88 -0
- package/dist/collection/assets/images/helper/helper-hover.svg +6 -6
- package/dist/collection/assets/images/helper/helper.svg +2 -2
- package/dist/collection/collection-manifest.json +23 -4
- package/dist/collection/components/atoms/avatar/avatar.component.css +1 -24
- package/dist/collection/components/atoms/avatar/avatar.component.js +105 -89
- package/dist/collection/components/atoms/avatar/avatar.component.js.map +1 -0
- package/dist/collection/components/atoms/avatar-group/avatar-group.component.css +1 -18
- package/dist/collection/components/atoms/avatar-group/avatar-group.component.js +37 -31
- package/dist/collection/components/atoms/avatar-group/avatar-group.component.js.map +1 -0
- package/dist/collection/components/atoms/backdrop/backdrop.component.css +1 -0
- package/dist/collection/components/atoms/backdrop/backdrop.component.js +149 -0
- package/dist/collection/components/atoms/backdrop/backdrop.component.js.map +1 -0
- package/dist/collection/components/atoms/button/button.component.css +1 -95
- package/dist/collection/components/atoms/button/button.component.js +305 -319
- package/dist/collection/components/atoms/button/button.component.js.map +1 -0
- package/dist/collection/components/atoms/card-body/card-body.component.css +1 -9
- package/dist/collection/components/atoms/card-body/card-body.component.js +35 -32
- package/dist/collection/components/atoms/card-body/card-body.component.js.map +1 -0
- package/dist/collection/components/atoms/card-container/card-container.component.css +1 -17
- package/dist/collection/components/atoms/card-container/card-container.component.js +52 -52
- package/dist/collection/components/atoms/card-container/card-container.component.js.map +1 -0
- package/dist/collection/components/atoms/card-header/card-header.component.css +1 -17
- package/dist/collection/components/atoms/card-header/card-header.component.js +52 -51
- package/dist/collection/components/atoms/card-header/card-header.component.js.map +1 -0
- package/dist/collection/components/atoms/counter/counter.component.css +1 -30
- package/dist/collection/components/atoms/counter/counter.component.js +52 -52
- package/dist/collection/components/atoms/counter/counter.component.js.map +1 -0
- package/dist/collection/components/atoms/divider/divider.component.css +1 -10
- package/dist/collection/components/atoms/divider/divider.component.js +13 -11
- package/dist/collection/components/atoms/divider/divider.component.js.map +1 -0
- package/dist/collection/components/atoms/drawer-body/drawer-body.component.css +1 -0
- package/dist/collection/components/atoms/drawer-body/drawer-body.component.js +44 -0
- package/dist/collection/components/atoms/drawer-body/drawer-body.component.js.map +1 -0
- package/dist/collection/components/atoms/drawer-container/drawer-container.component.css +1 -0
- package/dist/collection/components/atoms/drawer-container/drawer-container.component.js +48 -0
- package/dist/collection/components/atoms/drawer-container/drawer-container.component.js.map +1 -0
- package/dist/collection/components/atoms/drawer-header/drawer-header.component.css +1 -0
- package/dist/collection/components/atoms/drawer-header/drawer-header.component.js +66 -0
- package/dist/collection/components/atoms/drawer-header/drawer-header.component.js.map +1 -0
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +1 -6
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js +57 -9
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js.map +1 -0
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -13
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +74 -52
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js.map +1 -0
- package/dist/collection/components/atoms/helper/helper.component.css +1 -7
- package/dist/collection/components/atoms/helper/helper.component.js +39 -39
- package/dist/collection/components/atoms/helper/helper.component.js.map +1 -0
- package/dist/collection/components/atoms/icon/icon.component.css +1 -1
- package/dist/collection/components/atoms/icon/icon.component.js +101 -100
- package/dist/collection/components/atoms/icon/icon.component.js.map +1 -0
- package/dist/collection/components/atoms/illustration/illustration.component.js +30 -23
- package/dist/collection/components/atoms/illustration/illustration.component.js.map +1 -0
- package/dist/collection/components/atoms/info-panel/info-panel.component.css +1 -28
- package/dist/collection/components/atoms/info-panel/info-panel.component.js +86 -89
- package/dist/collection/components/atoms/info-panel/info-panel.component.js.map +1 -0
- package/dist/collection/components/atoms/label/label.component.css +1 -0
- package/dist/collection/components/atoms/label/label.component.js +171 -0
- package/dist/collection/components/atoms/label/label.component.js.map +1 -0
- package/dist/collection/components/atoms/layout/layout.component.css +1 -73
- package/dist/collection/components/atoms/layout/layout.component.js +35 -38
- package/dist/collection/components/atoms/layout/layout.component.js.map +1 -0
- package/dist/collection/components/atoms/loader/loader.component.css +1 -26
- package/dist/collection/components/atoms/loader/loader.component.js +113 -114
- package/dist/collection/components/atoms/loader/loader.component.js.map +1 -0
- package/dist/collection/components/atoms/modal-body/modal-body.component.css +1 -7
- package/dist/collection/components/atoms/modal-body/modal-body.component.js +53 -31
- package/dist/collection/components/atoms/modal-body/modal-body.component.js.map +1 -0
- package/dist/collection/components/atoms/modal-container/modal-container.component.css +1 -6
- package/dist/collection/components/atoms/modal-container/modal-container.component.js +53 -31
- package/dist/collection/components/atoms/modal-container/modal-container.component.js.map +1 -0
- package/dist/collection/components/atoms/modal-footer/modal-footer.component.css +1 -8
- package/dist/collection/components/atoms/modal-footer/modal-footer.component.js +13 -36
- package/dist/collection/components/atoms/modal-footer/modal-footer.component.js.map +1 -0
- package/dist/collection/components/atoms/modal-header/modal-header.component.css +1 -16
- package/dist/collection/components/atoms/modal-header/modal-header.component.js +56 -54
- package/dist/collection/components/atoms/modal-header/modal-header.component.js.map +1 -0
- package/dist/collection/components/atoms/pagination-item/pagination-item.component.css +1 -16
- package/dist/collection/components/atoms/pagination-item/pagination-item.component.js +35 -32
- package/dist/collection/components/atoms/pagination-item/pagination-item.component.js.map +1 -0
- package/dist/collection/components/atoms/segment-container/segment-container.component.css +1 -5
- package/dist/collection/components/atoms/segment-container/segment-container.component.js +13 -9
- package/dist/collection/components/atoms/segment-container/segment-container.component.js.map +1 -0
- package/dist/collection/components/atoms/segment-item/segment-item.component.css +1 -21
- package/dist/collection/components/atoms/segment-item/segment-item.component.js +97 -90
- package/dist/collection/components/atoms/segment-item/segment-item.component.js.map +1 -0
- package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.css +1 -7
- package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.js +34 -30
- package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.js.map +1 -0
- package/dist/collection/components/atoms/status/status.component.css +1 -16
- package/dist/collection/components/atoms/status/status.component.js +98 -93
- package/dist/collection/components/atoms/status/status.component.js.map +1 -0
- package/dist/collection/components/atoms/stepper-item/stepper-item.component.css +1 -59
- package/dist/collection/components/atoms/stepper-item/stepper-item.component.js +104 -93
- package/dist/collection/components/atoms/stepper-item/stepper-item.component.js.map +1 -0
- package/dist/collection/components/atoms/stepper-line/stepper-line.component.css +1 -18
- package/dist/collection/components/atoms/stepper-line/stepper-line.component.js +51 -50
- package/dist/collection/components/atoms/stepper-line/stepper-line.component.js.map +1 -0
- package/dist/collection/components/atoms/tab-group/tab-group.component.js +3 -11
- package/dist/collection/components/atoms/tab-group/tab-group.component.js.map +1 -0
- package/dist/collection/components/atoms/tab-item/tab-item.component.css +1 -10
- package/dist/collection/components/atoms/tab-item/tab-item.component.js +35 -32
- package/dist/collection/components/atoms/tab-item/tab-item.component.js.map +1 -0
- package/dist/collection/components/atoms/table-container/table-container.component.css +1 -0
- package/dist/collection/components/atoms/table-container/table-container.component.js +19 -0
- package/dist/collection/components/atoms/table-container/table-container.component.js.map +1 -0
- package/dist/collection/components/atoms/toast-container/toast-container.component.css +1 -0
- package/dist/collection/components/atoms/toast-container/toast-container.component.js +44 -0
- package/dist/collection/components/atoms/toast-container/toast-container.component.js.map +1 -0
- package/dist/collection/components/atoms/tooltip/tooltip.component.css +1 -43
- package/dist/collection/components/atoms/tooltip/tooltip.component.js +255 -235
- package/dist/collection/components/atoms/tooltip/tooltip.component.js.map +1 -0
- package/dist/collection/components/helpers/table-column/table-column.component.js +189 -0
- package/dist/collection/components/helpers/table-column/table-column.component.js.map +1 -0
- package/dist/collection/components/molecules/accordion/accordion.component.css +1 -3
- package/dist/collection/components/molecules/accordion/accordion.component.js +103 -108
- package/dist/collection/components/molecules/accordion/accordion.component.js.map +1 -0
- package/dist/collection/components/molecules/attachment/attachment.component.css +1 -0
- package/dist/collection/components/molecules/attachment/attachment.component.js +145 -0
- package/dist/collection/components/molecules/attachment/attachment.component.js.map +1 -0
- package/dist/collection/components/molecules/calendar/calendar.component.css +1 -0
- package/dist/collection/components/molecules/calendar/calendar.component.js +515 -0
- package/dist/collection/components/molecules/calendar/calendar.component.js.map +1 -0
- package/dist/collection/components/molecules/content-slider/content-slider.component.css +1 -26
- package/dist/collection/components/molecules/content-slider/content-slider.component.js +227 -139
- package/dist/collection/components/molecules/content-slider/content-slider.component.js.map +1 -0
- package/dist/collection/components/molecules/datepicker/datepicker.component.css +1 -0
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +527 -0
- package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -0
- package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -12
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +289 -187
- package/dist/collection/components/molecules/dropdown/dropdown.component.js.map +1 -0
- package/dist/collection/components/molecules/input-error/input-error.component.js +60 -0
- package/dist/collection/components/molecules/input-error/input-error.component.js.map +1 -0
- package/dist/collection/components/molecules/input-group/input-group.component.css +1 -204
- package/dist/collection/components/molecules/input-group/input-group.component.js +366 -227
- package/dist/collection/components/molecules/input-group/input-group.component.js.map +1 -0
- package/dist/collection/components/molecules/navigation-item/navigation-item.component.css +1 -22
- package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +107 -104
- package/dist/collection/components/molecules/navigation-item/navigation-item.component.js.map +1 -0
- package/dist/collection/components/molecules/page-size-select/constants.js +3 -0
- package/dist/collection/components/molecules/page-size-select/constants.js.map +1 -0
- package/dist/collection/components/molecules/page-size-select/page-size-select.component.js +207 -0
- package/dist/collection/components/molecules/page-size-select/page-size-select.component.js.map +1 -0
- package/dist/collection/components/molecules/pagination/pagination.component.css +1 -3
- package/dist/collection/components/molecules/pagination/pagination.component.js +119 -94
- package/dist/collection/components/molecules/pagination/pagination.component.js.map +1 -0
- package/dist/collection/components/molecules/profile/profile.component.css +1 -36
- package/dist/collection/components/molecules/profile/profile.component.js +66 -68
- package/dist/collection/components/molecules/profile/profile.component.js.map +1 -0
- package/dist/collection/components/molecules/select/select.component.css +1 -0
- package/dist/collection/components/molecules/select/select.component.js +739 -0
- package/dist/collection/components/molecules/select/select.component.js.map +1 -0
- package/dist/collection/components/molecules/stepper/stepper.component.css +1 -12
- package/dist/collection/components/molecules/stepper/stepper.component.js +120 -85
- package/dist/collection/components/molecules/stepper/stepper.component.js.map +1 -0
- package/dist/collection/components/molecules/table-cell/table-cell.component.css +1 -0
- package/dist/collection/components/molecules/table-cell/table-cell.component.js +306 -0
- package/dist/collection/components/molecules/table-cell/table-cell.component.js.map +1 -0
- package/dist/collection/components/molecules/table-footer/table-footer.component.css +1 -0
- package/dist/collection/components/molecules/table-footer/table-footer.component.js +276 -0
- package/dist/collection/components/molecules/table-footer/table-footer.component.js.map +1 -0
- package/dist/collection/components/molecules/table-header/table-header.component.css +1 -0
- package/dist/collection/components/molecules/table-header/table-header.component.js +452 -0
- package/dist/collection/components/molecules/table-header/table-header.component.js.map +1 -0
- package/dist/collection/components/molecules/table-row/table-row.component.css +1 -0
- package/dist/collection/components/molecules/table-row/table-row.component.js +65 -0
- package/dist/collection/components/molecules/table-row/table-row.component.js.map +1 -0
- package/dist/collection/components/molecules/toast/toast.component.css +1 -0
- package/dist/collection/components/molecules/toast/toast.component.js +197 -0
- package/dist/collection/components/molecules/toast/toast.component.js.map +1 -0
- package/dist/collection/components/organisms/drawer/drawer.component.css +1 -0
- package/dist/collection/components/organisms/drawer/drawer.component.js +234 -0
- package/dist/collection/components/organisms/drawer/drawer.component.js.map +1 -0
- package/dist/collection/components/organisms/modal/modal.component.js +228 -144
- package/dist/collection/components/organisms/modal/modal.component.js.map +1 -0
- package/dist/collection/components/organisms/navbar/navbar.component.css +1 -56
- package/dist/collection/components/organisms/navbar/navbar.component.js +72 -81
- package/dist/collection/components/organisms/navbar/navbar.component.js.map +1 -0
- package/dist/collection/components/organisms/table/table.component.css +1 -0
- package/dist/collection/components/organisms/table/table.component.js +1300 -0
- package/dist/collection/components/organisms/table/table.component.js.map +1 -0
- package/dist/collection/index.js +3 -1
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/tailwind/animation.js +72 -2
- package/dist/collection/tailwind/border-radius.js +1 -0
- package/dist/collection/tailwind/height.js +5 -0
- package/dist/collection/tailwind/plugins/safe-area.js +98 -0
- package/dist/collection/tailwind/screens.js +6 -6
- package/dist/collection/tailwind/shadows.js +2 -0
- package/dist/collection/tailwind/width.js +19 -13
- package/dist/collection/tailwind/z-index.js +15 -1
- package/dist/collection/tailwind.config.js +9 -2
- package/dist/collection/types/index.js +3 -0
- package/dist/collection/types/index.js.map +1 -0
- package/dist/collection/types/table.js +4 -0
- package/dist/collection/types/table.js.map +1 -0
- package/dist/collection/types/tailwind.js +2 -0
- package/dist/collection/types/tailwind.js.map +1 -0
- package/dist/collection/utils/child-of.js +1 -0
- package/dist/collection/utils/child-of.js.map +1 -0
- package/dist/collection/utils/icons.js +13 -0
- package/dist/collection/utils/icons.js.map +1 -0
- package/dist/collection/utils/illustrations.js +7 -0
- package/dist/collection/utils/illustrations.js.map +1 -0
- package/dist/collection/utils/index.js +7 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/collection/utils/localization.js +56 -0
- package/dist/collection/utils/localization.js.map +1 -0
- package/dist/collection/utils/object-get-by-path.js +9 -0
- package/dist/collection/utils/object-get-by-path.js.map +1 -0
- package/dist/collection/utils/transformers.js +5 -0
- package/dist/collection/utils/transformers.js.map +1 -0
- package/dist/components/backdrop.component.js +59 -0
- package/dist/components/backdrop.component.js.map +1 -0
- package/dist/components/button.component.js +16 -33
- package/dist/components/button.component.js.map +1 -0
- package/dist/components/calendar.component.js +3031 -0
- package/dist/components/calendar.component.js.map +1 -0
- package/dist/components/child-of.js +9 -0
- package/dist/components/child-of.js.map +1 -0
- package/dist/components/counter.component.js +4 -8
- package/dist/components/counter.component.js.map +1 -0
- package/dist/components/divider.component.js +4 -2
- package/dist/components/divider.component.js.map +1 -0
- package/dist/components/drawer-body.component.js +35 -0
- package/dist/components/drawer-body.component.js.map +1 -0
- package/dist/components/drawer-container.component.js +34 -0
- package/dist/components/drawer-container.component.js.map +1 -0
- package/dist/components/drawer-header.component.js +54 -0
- package/dist/components/drawer-header.component.js.map +1 -0
- package/dist/components/dropdown-menu-container.component.js +11 -4
- package/dist/components/dropdown-menu-container.component.js.map +1 -0
- package/dist/components/dropdown-menu-item.component.js +45 -0
- package/dist/components/dropdown-menu-item.component.js.map +1 -0
- package/dist/components/dropdown.component.js +77 -72
- package/dist/components/dropdown.component.js.map +1 -0
- package/dist/components/floating-ui.dom.esm.js +1327 -0
- package/dist/components/floating-ui.dom.esm.js.map +1 -0
- package/dist/components/helper.component.js +4 -5
- package/dist/components/helper.component.js.map +1 -0
- package/dist/components/icon.component.js +77 -60
- package/dist/components/icon.component.js.map +1 -0
- package/dist/{cjs/p-illustration.cjs.entry.js → components/illustration.component.js} +247 -16
- package/dist/components/illustration.component.js.map +1 -0
- package/dist/components/index.d.ts +9 -45
- package/dist/components/index.js +13 -43
- package/dist/components/index.js.map +1 -0
- package/dist/components/input-error.component.js +50 -0
- package/dist/components/input-error.component.js.map +1 -0
- package/dist/components/input-group.component.js +172 -0
- package/dist/components/input-group.component.js.map +1 -0
- package/dist/components/label.component.js +54 -0
- package/dist/components/label.component.js.map +1 -0
- package/dist/components/loader.component.js +12 -14
- package/dist/components/loader.component.js.map +1 -0
- package/dist/components/localization.js +59 -0
- package/dist/components/localization.js.map +1 -0
- package/dist/components/modal-body.component.js +8 -7
- package/dist/components/modal-body.component.js.map +1 -0
- package/dist/components/modal-container.component.js +8 -7
- package/dist/components/modal-container.component.js.map +1 -0
- package/dist/components/modal-footer.component.js +6 -10
- package/dist/components/modal-footer.component.js.map +1 -0
- package/dist/components/modal-header.component.js +21 -10
- package/dist/components/modal-header.component.js.map +1 -0
- package/dist/components/object-get-by-path.js +16 -0
- package/dist/components/object-get-by-path.js.map +1 -0
- package/dist/components/p-accordion.js +5 -11
- package/dist/components/p-accordion.js.map +1 -0
- package/dist/components/{p-modal-backdrop.d.ts → p-attachment.d.ts} +4 -4
- package/dist/components/p-attachment.js +88 -0
- package/dist/components/p-attachment.js.map +1 -0
- package/dist/components/p-avatar-group.js +5 -2
- package/dist/components/p-avatar-group.js.map +1 -0
- package/dist/components/p-avatar.js +59 -1
- package/dist/components/p-avatar.js.map +1 -0
- package/dist/components/p-backdrop.d.ts +11 -0
- package/dist/components/p-backdrop.js +8 -0
- package/dist/components/p-backdrop.js.map +1 -0
- package/dist/components/p-button.js +2 -0
- package/dist/components/p-button.js.map +1 -0
- package/dist/components/p-calendar.d.ts +11 -0
- package/dist/components/p-calendar.js +8 -0
- package/dist/components/p-calendar.js.map +1 -0
- package/dist/components/p-card-body.js +4 -5
- package/dist/components/p-card-body.js.map +1 -0
- package/dist/components/p-card-container.js +4 -8
- package/dist/components/p-card-container.js.map +1 -0
- package/dist/components/p-card-header.js +5 -5
- package/dist/components/p-card-header.js.map +1 -0
- package/dist/components/p-content-slider.js +117 -57
- package/dist/components/p-content-slider.js.map +1 -0
- package/dist/components/p-counter.js +2 -0
- package/dist/components/p-counter.js.map +1 -0
- package/dist/components/p-datepicker.d.ts +11 -0
- package/dist/components/p-datepicker.js +3125 -0
- package/dist/components/p-datepicker.js.map +1 -0
- package/dist/components/p-divider.js +2 -0
- package/dist/components/p-divider.js.map +1 -0
- package/dist/components/p-drawer-body.d.ts +11 -0
- package/dist/components/p-drawer-body.js +8 -0
- package/dist/components/p-drawer-body.js.map +1 -0
- package/dist/components/p-drawer-container.d.ts +11 -0
- package/dist/components/p-drawer-container.js +8 -0
- package/dist/components/p-drawer-container.js.map +1 -0
- package/dist/components/p-drawer-header.d.ts +11 -0
- package/dist/components/p-drawer-header.js +8 -0
- package/dist/components/p-drawer-header.js.map +1 -0
- package/dist/components/p-drawer.d.ts +11 -0
- package/dist/components/p-drawer.js +130 -0
- package/dist/components/p-drawer.js.map +1 -0
- package/dist/components/p-dropdown-menu-container.js +2 -0
- package/dist/components/p-dropdown-menu-container.js.map +1 -0
- package/dist/components/p-dropdown-menu-item.js +3 -41
- package/dist/components/p-dropdown-menu-item.js.map +1 -0
- package/dist/components/p-dropdown.js +2 -0
- package/dist/components/p-dropdown.js.map +1 -0
- package/dist/components/p-helper.js +2 -0
- package/dist/components/p-helper.js.map +1 -0
- package/dist/components/p-icon.js +2 -0
- package/dist/components/p-icon.js.map +1 -0
- package/dist/components/p-illustration.js +3 -1435
- package/dist/components/p-illustration.js.map +1 -0
- package/dist/components/p-info-panel.js +6 -8
- package/dist/components/p-info-panel.js.map +1 -0
- package/dist/components/p-input-error.d.ts +11 -0
- package/dist/components/p-input-error.js +8 -0
- package/dist/components/p-input-error.js.map +1 -0
- package/dist/components/p-input-group.js +3 -91
- package/dist/components/p-input-group.js.map +1 -0
- package/dist/components/{p-tag.d.ts → p-label.d.ts} +4 -4
- package/dist/components/p-label.js +8 -0
- package/dist/components/p-label.js.map +1 -0
- package/dist/components/p-layout.js +4 -5
- package/dist/components/p-layout.js.map +1 -0
- package/dist/components/p-loader.js +2 -0
- package/dist/components/p-loader.js.map +1 -0
- package/dist/components/p-modal-body.js +2 -0
- package/dist/components/p-modal-body.js.map +1 -0
- package/dist/components/p-modal-container.js +2 -0
- package/dist/components/p-modal-container.js.map +1 -0
- package/dist/components/p-modal-footer.js +2 -0
- package/dist/components/p-modal-footer.js.map +1 -0
- package/dist/components/p-modal-header.js +2 -0
- package/dist/components/p-modal-header.js.map +1 -0
- package/dist/components/p-modal.js +55 -26
- package/dist/components/p-modal.js.map +1 -0
- package/dist/components/p-navbar.js +12 -10
- package/dist/components/p-navbar.js.map +1 -0
- package/dist/components/p-navigation-item.js +8 -5
- package/dist/components/p-navigation-item.js.map +1 -0
- package/dist/components/p-page-size-select.d.ts +11 -0
- package/dist/components/p-page-size-select.js +8 -0
- package/dist/components/p-page-size-select.js.map +1 -0
- package/dist/components/p-pagination-item.js +2 -0
- package/dist/components/p-pagination-item.js.map +1 -0
- package/dist/components/p-pagination.js +3 -195
- package/dist/components/p-pagination.js.map +1 -0
- package/dist/components/p-profile.js +15 -22
- package/dist/components/p-profile.js.map +1 -0
- package/dist/components/p-segment-container.js +3 -27
- package/dist/components/p-segment-container.js.map +1 -0
- package/dist/components/p-segment-item.js +3 -49
- package/dist/components/p-segment-item.js.map +1 -0
- package/dist/components/p-select.d.ts +11 -0
- package/dist/components/p-select.js +340 -0
- package/dist/components/p-select.js.map +1 -0
- package/dist/components/p-slider-indicator.js +2 -0
- package/dist/components/p-slider-indicator.js.map +1 -0
- package/dist/components/p-status.js +7 -5
- package/dist/components/p-status.js.map +1 -0
- package/dist/components/p-stepper-item.js +47 -1
- package/dist/components/p-stepper-item.js.map +1 -0
- package/dist/components/p-stepper-line.js +2 -0
- package/dist/components/p-stepper-line.js.map +1 -0
- package/dist/components/p-stepper.js +56 -58
- package/dist/components/p-stepper.js.map +1 -0
- package/dist/components/p-tab-group.js +4 -5
- package/dist/components/p-tab-group.js.map +1 -0
- package/dist/components/p-tab-item.js +4 -5
- package/dist/components/p-tab-item.js.map +1 -0
- package/dist/components/p-table-cell.d.ts +11 -0
- package/dist/components/p-table-cell.js +8 -0
- package/dist/components/p-table-cell.js.map +1 -0
- package/dist/components/p-table-column.d.ts +11 -0
- package/dist/components/p-table-column.js +52 -0
- package/dist/components/p-table-column.js.map +1 -0
- package/dist/components/p-table-container.d.ts +11 -0
- package/dist/components/p-table-container.js +8 -0
- package/dist/components/p-table-container.js.map +1 -0
- package/dist/components/p-table-footer.d.ts +11 -0
- package/dist/components/p-table-footer.js +8 -0
- package/dist/components/p-table-footer.js.map +1 -0
- package/dist/components/p-table-header.d.ts +11 -0
- package/dist/components/p-table-header.js +8 -0
- package/dist/components/p-table-header.js.map +1 -0
- package/dist/components/p-table-row.d.ts +11 -0
- package/dist/components/p-table-row.js +8 -0
- package/dist/components/p-table-row.js.map +1 -0
- package/dist/components/p-table.d.ts +11 -0
- package/dist/components/p-table.js +552 -0
- package/dist/components/p-table.js.map +1 -0
- package/dist/components/p-toast-container.d.ts +11 -0
- package/dist/components/p-toast-container.js +38 -0
- package/dist/components/p-toast-container.js.map +1 -0
- package/dist/components/p-toast.d.ts +11 -0
- package/dist/components/p-toast.js +75 -0
- package/dist/components/p-toast.js.map +1 -0
- package/dist/components/p-tooltip.js +2 -0
- package/dist/components/p-tooltip.js.map +1 -0
- package/dist/components/page-size-select.component.js +107 -0
- package/dist/components/page-size-select.component.js.map +1 -0
- package/dist/components/pagination-item.component.js +4 -5
- package/dist/components/pagination-item.component.js.map +1 -0
- package/dist/components/pagination.component.js +196 -0
- package/dist/components/pagination.component.js.map +1 -0
- package/dist/components/segment-container.component.js +31 -0
- package/dist/components/segment-container.component.js.map +1 -0
- package/dist/components/segment-item.component.js +53 -0
- package/dist/components/segment-item.component.js.map +1 -0
- package/dist/components/slider-indicator.component.js +4 -5
- package/dist/components/slider-indicator.component.js.map +1 -0
- package/dist/components/stepper-line.component.js +4 -8
- package/dist/components/stepper-line.component.js.map +1 -0
- package/dist/components/table-cell.component.js +179 -0
- package/dist/components/table-cell.component.js.map +1 -0
- package/dist/components/table-container.component.js +32 -0
- package/dist/components/table-container.component.js.map +1 -0
- package/dist/components/table-footer.component.js +129 -0
- package/dist/components/table-footer.component.js.map +1 -0
- package/dist/components/table-header.component.js +1070 -0
- package/dist/components/table-header.component.js.map +1 -0
- package/dist/components/table-row.component.js +45 -0
- package/dist/components/table-row.component.js.map +1 -0
- package/dist/components/tooltip.component.js +60 -61
- package/dist/components/tooltip.component.js.map +1 -0
- package/dist/esm/child-of-90a8c4b5.js +9 -0
- package/dist/esm/child-of-90a8c4b5.js.map +1 -0
- package/dist/esm/constants-826f9460.js +6 -0
- package/dist/esm/constants-826f9460.js.map +1 -0
- package/dist/esm/floating-ui.dom.esm-314a52b2.js +1327 -0
- package/dist/esm/floating-ui.dom.esm-314a52b2.js.map +1 -0
- package/dist/esm/{index-9062156b.js → index-2c1bdb40.js} +980 -340
- package/dist/esm/index-2c1bdb40.js.map +1 -0
- package/dist/esm/index-934ac6da.js +2300 -0
- package/dist/esm/index-934ac6da.js.map +1 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +6 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/localization-901dc2d3.js +59 -0
- package/dist/esm/localization-901dc2d3.js.map +1 -0
- package/dist/esm/object-get-by-path-8f4f94b8.js +16 -0
- package/dist/esm/object-get-by-path-8f4f94b8.js.map +1 -0
- package/dist/esm/p-accordion.entry.js +5 -11
- package/dist/esm/p-accordion.entry.js.map +1 -0
- package/dist/esm/p-attachment.entry.js +35 -0
- package/dist/esm/p-attachment.entry.js.map +1 -0
- package/dist/esm/p-avatar-group.entry.js +5 -2
- package/dist/esm/p-avatar-group.entry.js.map +1 -0
- package/dist/esm/p-avatar.entry.js +41 -0
- package/dist/esm/p-avatar.entry.js.map +1 -0
- package/dist/esm/p-backdrop.entry.js +39 -0
- package/dist/esm/p-backdrop.entry.js.map +1 -0
- package/dist/esm/p-button_3.entry.js +142 -148
- package/dist/esm/p-button_3.entry.js.map +1 -0
- package/dist/esm/p-calendar.entry.js +699 -0
- package/dist/esm/p-calendar.entry.js.map +1 -0
- package/dist/esm/p-card-body.entry.js +4 -5
- package/dist/esm/p-card-body.entry.js.map +1 -0
- package/dist/esm/p-card-container.entry.js +4 -8
- package/dist/esm/p-card-container.entry.js.map +1 -0
- package/dist/esm/p-card-header.entry.js +5 -5
- package/dist/esm/p-card-header.entry.js.map +1 -0
- package/dist/esm/p-content-slider.entry.js +115 -56
- package/dist/esm/p-content-slider.entry.js.map +1 -0
- package/dist/esm/p-counter.entry.js +4 -8
- package/dist/esm/p-counter.entry.js.map +1 -0
- package/dist/esm/p-datepicker.entry.js +3039 -0
- package/dist/esm/p-datepicker.entry.js.map +1 -0
- package/dist/esm/p-divider.entry.js +4 -2
- package/dist/esm/p-divider.entry.js.map +1 -0
- package/dist/esm/p-drawer-body_3.entry.js +45 -0
- package/dist/esm/p-drawer-body_3.entry.js.map +1 -0
- package/dist/esm/p-drawer.entry.js +61 -0
- package/dist/esm/p-drawer.entry.js.map +1 -0
- package/dist/esm/p-dropdown-menu-container.entry.js +7 -3
- package/dist/esm/p-dropdown-menu-container.entry.js.map +1 -0
- package/dist/esm/p-dropdown_2.entry.js +158 -0
- package/dist/esm/p-dropdown_2.entry.js.map +1 -0
- package/dist/esm/p-helper_3.entry.js +144 -0
- package/dist/esm/p-helper_3.entry.js.map +1 -0
- package/dist/esm/{p-illustration.entry.js → p-illustration_6.entry.js} +1417 -8
- package/dist/esm/p-illustration_6.entry.js.map +1 -0
- package/dist/esm/p-info-panel.entry.js +6 -8
- package/dist/esm/p-info-panel.entry.js.map +1 -0
- package/dist/esm/p-label_3.entry.js +59 -0
- package/dist/esm/p-label_3.entry.js.map +1 -0
- package/dist/esm/p-layout.entry.js +4 -5
- package/dist/esm/p-layout.entry.js.map +1 -0
- package/dist/esm/p-modal-body_4.entry.js +72 -0
- package/dist/esm/p-modal-body_4.entry.js.map +1 -0
- package/dist/esm/p-modal.entry.js +34 -21
- package/dist/esm/p-modal.entry.js.map +1 -0
- package/dist/esm/p-navbar.entry.js +5 -9
- package/dist/esm/p-navbar.entry.js.map +1 -0
- package/dist/esm/p-navigation-item.entry.js +8 -5
- package/dist/esm/p-navigation-item.entry.js.map +1 -0
- package/dist/esm/p-page-size-select_3.entry.js +218 -0
- package/dist/esm/p-page-size-select_3.entry.js.map +1 -0
- package/dist/esm/p-profile.entry.js +14 -15
- package/dist/esm/p-profile.entry.js.map +1 -0
- package/dist/esm/p-select.entry.js +241 -0
- package/dist/esm/p-select.entry.js.map +1 -0
- package/dist/esm/p-slider-indicator.entry.js +4 -5
- package/dist/esm/p-slider-indicator.entry.js.map +1 -0
- package/dist/esm/p-status.entry.js +7 -5
- package/dist/esm/p-status.entry.js.map +1 -0
- package/dist/esm/p-stepper-item.entry.js +22 -0
- package/dist/esm/p-stepper-item.entry.js.map +1 -0
- package/dist/esm/p-stepper-line.entry.js +19 -0
- package/dist/esm/p-stepper-line.entry.js.map +1 -0
- package/dist/esm/p-stepper.entry.js +53 -44
- package/dist/esm/p-stepper.entry.js.map +1 -0
- package/dist/esm/p-tab-group.entry.js +11 -10
- package/dist/esm/p-tab-group.entry.js.map +1 -0
- package/dist/esm/p-tab-item.entry.js +4 -5
- package/dist/esm/p-tab-item.entry.js.map +1 -0
- package/dist/esm/p-table-column.entry.js +26 -0
- package/dist/esm/p-table-column.entry.js.map +1 -0
- package/dist/esm/p-table.entry.js +356 -0
- package/dist/esm/p-table.entry.js.map +1 -0
- package/dist/esm/p-toast-container.entry.js +18 -0
- package/dist/esm/p-toast-container.entry.js.map +1 -0
- package/dist/esm/p-toast.entry.js +31 -0
- package/dist/esm/p-toast.entry.js.map +1 -0
- package/dist/esm/p-tooltip.entry.js +59 -61
- package/dist/esm/p-tooltip.entry.js.map +1 -0
- package/dist/esm/paperless.js +9 -3
- package/dist/esm/paperless.js.map +1 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/index.esm.js +2 -0
- package/dist/paperless/index.esm.js.map +1 -0
- package/dist/paperless/p-07259c61.entry.js +2 -0
- package/dist/paperless/p-07259c61.entry.js.map +1 -0
- package/dist/paperless/p-11f5c8c7.entry.js +2 -0
- package/dist/paperless/p-11f5c8c7.entry.js.map +1 -0
- package/dist/paperless/p-12171df4.entry.js +2 -0
- package/dist/paperless/p-12171df4.entry.js.map +1 -0
- package/dist/paperless/p-1630e39b.entry.js +2 -0
- package/dist/paperless/p-1630e39b.entry.js.map +1 -0
- package/dist/paperless/p-18c0dd17.entry.js +2 -0
- package/dist/paperless/p-18c0dd17.entry.js.map +1 -0
- package/dist/paperless/p-195632a8.entry.js +2 -0
- package/dist/paperless/p-195632a8.entry.js.map +1 -0
- package/dist/paperless/p-1f55126f.entry.js +2 -0
- package/dist/paperless/p-1f55126f.entry.js.map +1 -0
- package/dist/paperless/p-26da620b.entry.js +2 -0
- package/dist/paperless/p-26da620b.entry.js.map +1 -0
- package/dist/paperless/p-2a668e75.entry.js +2 -0
- package/dist/paperless/p-2a668e75.entry.js.map +1 -0
- package/dist/paperless/p-350d452b.entry.js +2 -0
- package/dist/paperless/p-350d452b.entry.js.map +1 -0
- package/dist/paperless/p-36967a97.entry.js +2 -0
- package/dist/paperless/p-36967a97.entry.js.map +1 -0
- package/dist/paperless/p-3d8b2178.entry.js +2 -0
- package/dist/paperless/p-3d8b2178.entry.js.map +1 -0
- package/dist/paperless/p-47bcc23e.entry.js +2 -0
- package/dist/paperless/p-47bcc23e.entry.js.map +1 -0
- package/dist/paperless/p-47e461b7.entry.js +2 -0
- package/dist/paperless/p-47e461b7.entry.js.map +1 -0
- package/dist/paperless/p-4c51a801.entry.js +2 -0
- package/dist/paperless/p-4c51a801.entry.js.map +1 -0
- package/dist/paperless/p-4e650fe4.js +2 -0
- package/dist/paperless/p-4e650fe4.js.map +1 -0
- package/dist/paperless/p-51408aca.entry.js +2 -0
- package/dist/paperless/p-51408aca.entry.js.map +1 -0
- package/dist/paperless/p-594b28a7.entry.js +2 -0
- package/dist/paperless/p-594b28a7.entry.js.map +1 -0
- package/dist/paperless/p-5c7b20a3.entry.js +2 -0
- package/dist/paperless/p-5c7b20a3.entry.js.map +1 -0
- package/dist/paperless/p-6124f388.entry.js +2 -0
- package/dist/paperless/p-6124f388.entry.js.map +1 -0
- package/dist/paperless/p-6c60fd3d.js +2 -0
- package/dist/paperless/p-6c60fd3d.js.map +1 -0
- package/dist/paperless/p-6ccf5cdd.js +3 -0
- package/dist/paperless/p-6ccf5cdd.js.map +1 -0
- package/dist/paperless/p-6d5aa646.entry.js +2 -0
- package/dist/paperless/p-6d5aa646.entry.js.map +1 -0
- package/dist/paperless/p-6f1352e0.entry.js +2 -0
- package/dist/paperless/p-6f1352e0.entry.js.map +1 -0
- package/dist/paperless/p-8a6728d5.js +2 -0
- package/dist/paperless/p-8a6728d5.js.map +1 -0
- package/dist/paperless/p-910bd6bc.entry.js +2 -0
- package/dist/paperless/p-910bd6bc.entry.js.map +1 -0
- package/dist/paperless/p-91725831.entry.js +2 -0
- package/dist/paperless/p-91725831.entry.js.map +1 -0
- package/dist/paperless/p-946286e2.entry.js +2 -0
- package/dist/paperless/p-946286e2.entry.js.map +1 -0
- package/dist/paperless/p-a1c1d95b.entry.js +2 -0
- package/dist/paperless/p-a1c1d95b.entry.js.map +1 -0
- package/dist/paperless/p-a23ea8fe.entry.js +2 -0
- package/dist/paperless/p-a23ea8fe.entry.js.map +1 -0
- package/dist/paperless/p-abcd80e9.entry.js +2 -0
- package/dist/paperless/p-abcd80e9.entry.js.map +1 -0
- package/dist/paperless/p-ae248aef.js +2 -0
- package/dist/paperless/p-ae248aef.js.map +1 -0
- package/dist/paperless/p-b0398d3b.entry.js +2 -0
- package/dist/paperless/p-b0398d3b.entry.js.map +1 -0
- package/dist/paperless/p-b2bc1d2a.entry.js +2 -0
- package/dist/paperless/p-b2bc1d2a.entry.js.map +1 -0
- package/dist/paperless/p-b5ce8cd4.entry.js +2 -0
- package/dist/paperless/p-b5ce8cd4.entry.js.map +1 -0
- package/dist/paperless/p-b92dd098.entry.js +2 -0
- package/dist/paperless/p-b92dd098.entry.js.map +1 -0
- package/dist/paperless/p-b9f742e0.entry.js +2 -0
- package/dist/paperless/p-b9f742e0.entry.js.map +1 -0
- package/dist/paperless/p-bf0eca4f.entry.js +2 -0
- package/dist/paperless/p-bf0eca4f.entry.js.map +1 -0
- package/dist/paperless/p-ce1abd74.entry.js +2 -0
- package/dist/paperless/p-ce1abd74.entry.js.map +1 -0
- package/dist/paperless/p-ce443f5b.entry.js +2 -0
- package/dist/paperless/p-ce443f5b.entry.js.map +1 -0
- package/dist/paperless/p-da2426c7.js +2 -0
- package/dist/paperless/p-da2426c7.js.map +1 -0
- package/dist/paperless/p-da6e5abd.entry.js +2 -0
- package/dist/paperless/p-da6e5abd.entry.js.map +1 -0
- package/dist/paperless/p-e17560e6.entry.js +2 -0
- package/dist/paperless/p-e17560e6.entry.js.map +1 -0
- package/dist/paperless/p-e1da7376.entry.js +2 -0
- package/dist/paperless/p-e1da7376.entry.js.map +1 -0
- package/dist/paperless/p-e9a1b51e.entry.js +2 -0
- package/dist/paperless/p-e9a1b51e.entry.js.map +1 -0
- package/dist/paperless/p-ec850aca.entry.js +2 -0
- package/dist/paperless/p-ec850aca.entry.js.map +1 -0
- package/dist/paperless/p-ed6edf0a.entry.js +2 -0
- package/dist/paperless/p-ed6edf0a.entry.js.map +1 -0
- package/dist/paperless/p-f47247a6.entry.js +2 -0
- package/dist/paperless/p-f47247a6.entry.js.map +1 -0
- package/dist/paperless/p-fef32402.js +2 -0
- package/dist/paperless/p-fef32402.js.map +1 -0
- package/dist/paperless/paperless.css +1003 -801
- package/dist/paperless/paperless.esm.js +2 -1
- package/dist/paperless/paperless.esm.js.map +1 -0
- package/dist/style/_fonts.scss +70 -0
- package/dist/style/_helpers.scss +5 -0
- package/dist/style/_mixins.scss +1 -0
- package/dist/style/_reset.scss +30 -0
- package/dist/style/_tailwind.scss +3 -0
- package/dist/style/_typograhpy.scss +29 -0
- package/dist/style/_variables.scss +2 -0
- package/dist/style/form/_checkbox.scss +111 -0
- package/dist/style/form/_input.scss +31 -0
- package/dist/style/form/_mixins.scss +114 -0
- package/dist/style/form/_radio.scss +58 -0
- package/dist/style/form/_textarea.scss +18 -0
- package/dist/style/form/index.scss +4 -0
- package/dist/style/mixins/_scrollbar.scss +32 -0
- package/dist/style/paperless.scss +12 -0
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/tailwind/animation.js +72 -2
- package/dist/tailwind/border-radius.js +1 -0
- package/dist/tailwind/height.js +5 -0
- package/dist/tailwind/plugins/safe-area.js +98 -0
- package/dist/tailwind/screens.js +6 -6
- package/dist/tailwind/shadows.js +2 -0
- package/dist/tailwind/width.js +19 -13
- package/dist/tailwind/z-index.js +15 -1
- package/dist/tailwind.config.js +9 -2
- package/dist/types/components/atoms/avatar/avatar.component.d.ts +3 -1
- package/dist/types/components/atoms/backdrop/backdrop.component.d.ts +31 -0
- package/dist/types/components/atoms/button/button.component.d.ts +5 -5
- package/dist/types/components/atoms/drawer-body/drawer-body.component.d.ts +7 -0
- package/dist/types/components/atoms/drawer-container/drawer-container.component.d.ts +7 -0
- package/dist/types/components/atoms/drawer-header/drawer-header.component.d.ts +12 -0
- package/dist/types/components/atoms/dropdown-menu-container/dropdown-menu-container.component.d.ts +8 -0
- package/dist/types/components/atoms/dropdown-menu-item/dropdown-menu-item.component.d.ts +4 -0
- package/dist/types/components/atoms/helper/helper.component.d.ts +1 -1
- package/dist/types/components/atoms/icon/icon.component.d.ts +3 -3
- package/dist/types/components/atoms/illustration/illustration.component.d.ts +1 -1
- package/dist/types/components/atoms/label/label.component.d.ts +33 -0
- package/dist/types/components/atoms/layout/layout.component.d.ts +1 -1
- package/dist/types/components/atoms/loader/loader.component.d.ts +1 -1
- package/dist/types/components/atoms/modal-body/modal-body.component.d.ts +4 -0
- package/dist/types/components/atoms/modal-container/modal-container.component.d.ts +4 -0
- package/dist/types/components/atoms/modal-footer/modal-footer.component.d.ts +0 -4
- package/dist/types/components/atoms/modal-header/modal-header.component.d.ts +1 -1
- package/dist/types/components/atoms/segment-item/segment-item.component.d.ts +1 -1
- package/dist/types/components/atoms/status/status.component.d.ts +1 -1
- package/dist/types/components/atoms/stepper-item/stepper-item.component.d.ts +4 -0
- package/dist/types/components/atoms/table-container/table-container.component.d.ts +3 -0
- package/dist/types/components/atoms/toast-container/toast-container.component.d.ts +7 -0
- package/dist/types/components/atoms/tooltip/tooltip.component.d.ts +10 -5
- package/dist/types/components/helpers/table-column/table-column.component.d.ts +42 -0
- package/dist/types/components/molecules/attachment/attachment.component.d.ts +28 -0
- package/dist/types/components/molecules/calendar/calendar.component.d.ts +76 -0
- package/dist/types/components/molecules/content-slider/content-slider.component.d.ts +14 -5
- package/dist/types/components/molecules/datepicker/datepicker.component.d.ts +97 -0
- package/dist/types/components/molecules/dropdown/dropdown.component.d.ts +29 -6
- package/dist/types/components/molecules/input-error/input-error.component.d.ts +12 -0
- package/dist/types/components/molecules/input-group/input-group.component.d.ts +22 -3
- package/dist/types/components/molecules/page-size-select/constants.d.ts +2 -0
- package/dist/types/components/molecules/page-size-select/page-size-select.component.d.ts +50 -0
- package/dist/types/components/molecules/pagination/pagination.component.d.ts +7 -0
- package/dist/types/components/molecules/profile/profile.component.d.ts +2 -1
- package/dist/types/components/molecules/select/select.component.d.ts +141 -0
- package/dist/types/components/molecules/stepper/stepper.component.d.ts +5 -2
- package/dist/types/components/molecules/table-cell/table-cell.component.d.ts +42 -0
- package/dist/types/components/molecules/table-footer/table-footer.component.d.ts +63 -0
- package/dist/types/components/molecules/table-header/table-header.component.d.ts +101 -0
- package/dist/types/components/molecules/table-row/table-row.component.d.ts +11 -0
- package/dist/types/components/molecules/toast/toast.component.d.ts +39 -0
- package/dist/types/components/organisms/drawer/drawer.component.d.ts +52 -0
- package/dist/types/components/organisms/modal/modal.component.d.ts +24 -4
- package/dist/types/components/organisms/table/table.component.d.ts +240 -0
- package/dist/types/components.d.ts +2508 -535
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +92 -19
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/table.d.ts +29 -0
- package/dist/types/types/tailwind.d.ts +2 -0
- package/dist/types/utils/icons.d.ts +6 -0
- package/dist/types/utils/illustrations.d.ts +3 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/localization.d.ts +2 -0
- package/dist/types/utils/object-get-by-path.d.ts +1 -0
- package/dist/types/utils/transformers.d.ts +2 -0
- package/dist/{workbox-5fe694da.js → workbox-bc53c9ad.js} +2 -2
- package/dist/workbox-bc53c9ad.js.map +1 -0
- package/hydrate/index.d.ts +218 -0
- package/hydrate/index.js +21136 -0
- package/hydrate/package.json +6 -0
- package/loader/index.d.ts +9 -0
- package/loader/package.json +1 -0
- package/package.json +24 -18
- package/dist/build/p-113baa35.entry.js +0 -1
- package/dist/build/p-1e7d45e4.entry.js +0 -1
- package/dist/build/p-1ef22f4e.entry.js +0 -1
- package/dist/build/p-2672f14b.entry.js +0 -1
- package/dist/build/p-2beaf0e8.entry.js +0 -1
- package/dist/build/p-3f6c9d44.entry.js +0 -1
- package/dist/build/p-4336cbbc.entry.js +0 -1
- package/dist/build/p-58ce5668.entry.js +0 -1
- package/dist/build/p-6088647a.entry.js +0 -1
- package/dist/build/p-6835a9e3.entry.js +0 -1
- package/dist/build/p-6e778574.entry.js +0 -1
- package/dist/build/p-79d3258f.entry.js +0 -1
- package/dist/build/p-801d05b6.entry.js +0 -1
- package/dist/build/p-829c4101.entry.js +0 -1
- package/dist/build/p-89fda3a8.entry.js +0 -1
- package/dist/build/p-8ac8a69d.entry.js +0 -1
- package/dist/build/p-8b743795.entry.js +0 -1
- package/dist/build/p-92b6c76c.entry.js +0 -1
- package/dist/build/p-938f52ee.entry.js +0 -1
- package/dist/build/p-9d98d0d9.entry.js +0 -1
- package/dist/build/p-a5ebbd0c.entry.js +0 -1
- package/dist/build/p-a6127c75.entry.js +0 -1
- package/dist/build/p-a7086ffa.js +0 -1
- package/dist/build/p-aa14483b.entry.js +0 -1
- package/dist/build/p-bc7e8cc4.js +0 -2
- package/dist/build/p-bd50db3d.entry.js +0 -1
- package/dist/build/p-c27046e6.entry.js +0 -1
- package/dist/build/p-c59d9fc2.entry.js +0 -1
- package/dist/build/p-cc177072.entry.js +0 -1
- package/dist/build/p-d32f2578.entry.js +0 -1
- package/dist/build/p-e20a1842.entry.js +0 -1
- package/dist/build/p-e2a98d53.entry.js +0 -1
- package/dist/build/p-e934ef94.entry.js +0 -1
- package/dist/build/p-e9e20ac3.entry.js +0 -1
- package/dist/build/p-ec2a5f95.entry.js +0 -1
- package/dist/build/p-ede5e914.entry.js +0 -1
- package/dist/cjs/p-avatar_2.cjs.entry.js +0 -179
- package/dist/cjs/p-dropdown-menu-item.cjs.entry.js +0 -23
- package/dist/cjs/p-helper.cjs.entry.js +0 -23
- package/dist/cjs/p-input-group.cjs.entry.js +0 -51
- package/dist/cjs/p-modal-backdrop_5.cjs.entry.js +0 -101
- package/dist/cjs/p-pagination-item.cjs.entry.js +0 -23
- package/dist/cjs/p-pagination.cjs.entry.js +0 -171
- package/dist/cjs/p-segment-container.cjs.entry.js +0 -19
- package/dist/cjs/p-segment-item.cjs.entry.js +0 -29
- package/dist/cjs/p-stepper-item_2.cjs.entry.js +0 -56
- package/dist/cjs/p-tag.cjs.entry.js +0 -27
- package/dist/cjs/popper-e0c4ed4c.js +0 -1790
- package/dist/collection/components/atoms/modal-backdrop/modal-backdrop.component.css +0 -7
- package/dist/collection/components/atoms/modal-backdrop/modal-backdrop.component.js +0 -15
- package/dist/collection/components/atoms/tab-group/tab-group.component.css +0 -9
- package/dist/collection/components/atoms/tag/tag.component.css +0 -51
- package/dist/collection/components/atoms/tag/tag.component.js +0 -64
- package/dist/collection/utils/types.js +0 -1
- package/dist/collection/utils/utils.js +0 -3
- package/dist/components/avatar.component.js +0 -54
- package/dist/components/modal-backdrop.component.js +0 -30
- package/dist/components/p-modal-backdrop.js +0 -6
- package/dist/components/p-tag.js +0 -44
- package/dist/components/popper.js +0 -1788
- package/dist/components/stepper-item.component.js +0 -57
- package/dist/esm/p-avatar_2.entry.js +0 -174
- package/dist/esm/p-dropdown-menu-item.entry.js +0 -19
- package/dist/esm/p-helper.entry.js +0 -19
- package/dist/esm/p-input-group.entry.js +0 -47
- package/dist/esm/p-modal-backdrop_5.entry.js +0 -93
- package/dist/esm/p-pagination-item.entry.js +0 -19
- package/dist/esm/p-pagination.entry.js +0 -167
- package/dist/esm/p-segment-container.entry.js +0 -15
- package/dist/esm/p-segment-item.entry.js +0 -25
- package/dist/esm/p-stepper-item_2.entry.js +0 -51
- package/dist/esm/p-tag.entry.js +0 -23
- package/dist/esm/popper-41c6f9cd.js +0 -1788
- package/dist/paperless/p-113baa35.entry.js +0 -1
- package/dist/paperless/p-1e7d45e4.entry.js +0 -1
- package/dist/paperless/p-1ef22f4e.entry.js +0 -1
- package/dist/paperless/p-2672f14b.entry.js +0 -1
- package/dist/paperless/p-2beaf0e8.entry.js +0 -1
- package/dist/paperless/p-3f6c9d44.entry.js +0 -1
- package/dist/paperless/p-4336cbbc.entry.js +0 -1
- package/dist/paperless/p-58ce5668.entry.js +0 -1
- package/dist/paperless/p-6088647a.entry.js +0 -1
- package/dist/paperless/p-6835a9e3.entry.js +0 -1
- package/dist/paperless/p-6e778574.entry.js +0 -1
- package/dist/paperless/p-79d3258f.entry.js +0 -1
- package/dist/paperless/p-801d05b6.entry.js +0 -1
- package/dist/paperless/p-829c4101.entry.js +0 -1
- package/dist/paperless/p-89fda3a8.entry.js +0 -1
- package/dist/paperless/p-8ac8a69d.entry.js +0 -1
- package/dist/paperless/p-8b743795.entry.js +0 -1
- package/dist/paperless/p-92b6c76c.entry.js +0 -1
- package/dist/paperless/p-938f52ee.entry.js +0 -1
- package/dist/paperless/p-9d98d0d9.entry.js +0 -1
- package/dist/paperless/p-a5ebbd0c.entry.js +0 -1
- package/dist/paperless/p-a6127c75.entry.js +0 -1
- package/dist/paperless/p-a7086ffa.js +0 -1
- package/dist/paperless/p-aa14483b.entry.js +0 -1
- package/dist/paperless/p-bc7e8cc4.js +0 -2
- package/dist/paperless/p-bd50db3d.entry.js +0 -1
- package/dist/paperless/p-c27046e6.entry.js +0 -1
- package/dist/paperless/p-c59d9fc2.entry.js +0 -1
- package/dist/paperless/p-cc177072.entry.js +0 -1
- package/dist/paperless/p-d32f2578.entry.js +0 -1
- package/dist/paperless/p-e20a1842.entry.js +0 -1
- package/dist/paperless/p-e2a98d53.entry.js +0 -1
- package/dist/paperless/p-e934ef94.entry.js +0 -1
- package/dist/paperless/p-e9e20ac3.entry.js +0 -1
- package/dist/paperless/p-ec2a5f95.entry.js +0 -1
- package/dist/paperless/p-ede5e914.entry.js +0 -1
- package/dist/types/components/atoms/modal-backdrop/modal-backdrop.component.d.ts +0 -3
- package/dist/types/components/atoms/tag/tag.component.d.ts +0 -11
- package/dist/types/utils/types.d.ts +0 -2
- package/dist/types/utils/utils.d.ts +0 -1
- package/dist/workbox-5fe694da.js.map +0 -1
|
@@ -0,0 +1,3043 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index$1 = require('./index-dfc4dfec.js');
|
|
6
|
+
const childOf = require('./child-of-e472f812.js');
|
|
7
|
+
const index = require('./index-b59a0544.js');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Days in 1 week.
|
|
11
|
+
*
|
|
12
|
+
* @name daysInWeek
|
|
13
|
+
* @constant
|
|
14
|
+
* @type {number}
|
|
15
|
+
* @default
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Milliseconds in 1 minute
|
|
20
|
+
*
|
|
21
|
+
* @name millisecondsInMinute
|
|
22
|
+
* @constant
|
|
23
|
+
* @type {number}
|
|
24
|
+
* @default
|
|
25
|
+
*/
|
|
26
|
+
var millisecondsInMinute = 60000;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Milliseconds in 1 hour
|
|
30
|
+
*
|
|
31
|
+
* @name millisecondsInHour
|
|
32
|
+
* @constant
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @default
|
|
35
|
+
*/
|
|
36
|
+
var millisecondsInHour = 3600000;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Milliseconds in 1 second
|
|
40
|
+
*
|
|
41
|
+
* @name millisecondsInSecond
|
|
42
|
+
* @constant
|
|
43
|
+
* @type {number}
|
|
44
|
+
* @default
|
|
45
|
+
*/
|
|
46
|
+
var millisecondsInSecond = 1000;
|
|
47
|
+
|
|
48
|
+
function assign(target, object) {
|
|
49
|
+
if (target == null) {
|
|
50
|
+
throw new TypeError('assign requires that input parameter not be null or undefined');
|
|
51
|
+
}
|
|
52
|
+
for (var property in object) {
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(object, property)) {
|
|
54
|
+
target[property] = object[property];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return target;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function _arrayLikeToArray(arr, len) {
|
|
61
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
62
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
63
|
+
return arr2;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
67
|
+
if (!o) return;
|
|
68
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
69
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
70
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
71
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
72
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
76
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
77
|
+
if (!it) {
|
|
78
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
79
|
+
if (it) o = it;
|
|
80
|
+
var i = 0;
|
|
81
|
+
var F = function F() {};
|
|
82
|
+
return {
|
|
83
|
+
s: F,
|
|
84
|
+
n: function n() {
|
|
85
|
+
if (i >= o.length) return {
|
|
86
|
+
done: true
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
done: false,
|
|
90
|
+
value: o[i++]
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
e: function e(_e) {
|
|
94
|
+
throw _e;
|
|
95
|
+
},
|
|
96
|
+
f: F
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
100
|
+
}
|
|
101
|
+
var normalCompletion = true,
|
|
102
|
+
didErr = false,
|
|
103
|
+
err;
|
|
104
|
+
return {
|
|
105
|
+
s: function s() {
|
|
106
|
+
it = it.call(o);
|
|
107
|
+
},
|
|
108
|
+
n: function n() {
|
|
109
|
+
var step = it.next();
|
|
110
|
+
normalCompletion = step.done;
|
|
111
|
+
return step;
|
|
112
|
+
},
|
|
113
|
+
e: function e(_e2) {
|
|
114
|
+
didErr = true;
|
|
115
|
+
err = _e2;
|
|
116
|
+
},
|
|
117
|
+
f: function f() {
|
|
118
|
+
try {
|
|
119
|
+
if (!normalCompletion && it["return"] != null) it["return"]();
|
|
120
|
+
} finally {
|
|
121
|
+
if (didErr) throw err;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function _assertThisInitialized(self) {
|
|
128
|
+
if (self === void 0) {
|
|
129
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
130
|
+
}
|
|
131
|
+
return self;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function _setPrototypeOf(o, p) {
|
|
135
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
136
|
+
o.__proto__ = p;
|
|
137
|
+
return o;
|
|
138
|
+
};
|
|
139
|
+
return _setPrototypeOf(o, p);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function _inherits(subClass, superClass) {
|
|
143
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
144
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
145
|
+
}
|
|
146
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
147
|
+
constructor: {
|
|
148
|
+
value: subClass,
|
|
149
|
+
writable: true,
|
|
150
|
+
configurable: true
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
Object.defineProperty(subClass, "prototype", {
|
|
154
|
+
writable: false
|
|
155
|
+
});
|
|
156
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function _getPrototypeOf(o) {
|
|
160
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
161
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
162
|
+
};
|
|
163
|
+
return _getPrototypeOf(o);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function _isNativeReflectConstruct() {
|
|
167
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
168
|
+
if (Reflect.construct.sham) return false;
|
|
169
|
+
if (typeof Proxy === "function") return true;
|
|
170
|
+
try {
|
|
171
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
172
|
+
return true;
|
|
173
|
+
} catch (e) {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function _possibleConstructorReturn(self, call) {
|
|
179
|
+
if (call && (index._typeof(call) === "object" || typeof call === "function")) {
|
|
180
|
+
return call;
|
|
181
|
+
} else if (call !== void 0) {
|
|
182
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
183
|
+
}
|
|
184
|
+
return _assertThisInitialized(self);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function _createSuper(Derived) {
|
|
188
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
189
|
+
return function _createSuperInternal() {
|
|
190
|
+
var Super = _getPrototypeOf(Derived),
|
|
191
|
+
result;
|
|
192
|
+
if (hasNativeReflectConstruct) {
|
|
193
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
194
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
195
|
+
} else {
|
|
196
|
+
result = Super.apply(this, arguments);
|
|
197
|
+
}
|
|
198
|
+
return _possibleConstructorReturn(this, result);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function _classCallCheck(instance, Constructor) {
|
|
203
|
+
if (!(instance instanceof Constructor)) {
|
|
204
|
+
throw new TypeError("Cannot call a class as a function");
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function _toPrimitive(input, hint) {
|
|
209
|
+
if (index._typeof(input) !== "object" || input === null) return input;
|
|
210
|
+
var prim = input[Symbol.toPrimitive];
|
|
211
|
+
if (prim !== undefined) {
|
|
212
|
+
var res = prim.call(input, hint || "default");
|
|
213
|
+
if (index._typeof(res) !== "object") return res;
|
|
214
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
215
|
+
}
|
|
216
|
+
return (hint === "string" ? String : Number)(input);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function _toPropertyKey(arg) {
|
|
220
|
+
var key = _toPrimitive(arg, "string");
|
|
221
|
+
return index._typeof(key) === "symbol" ? key : String(key);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function _defineProperties(target, props) {
|
|
225
|
+
for (var i = 0; i < props.length; i++) {
|
|
226
|
+
var descriptor = props[i];
|
|
227
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
228
|
+
descriptor.configurable = true;
|
|
229
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
230
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
234
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
235
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
236
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
237
|
+
writable: false
|
|
238
|
+
});
|
|
239
|
+
return Constructor;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function _defineProperty(obj, key, value) {
|
|
243
|
+
key = _toPropertyKey(key);
|
|
244
|
+
if (key in obj) {
|
|
245
|
+
Object.defineProperty(obj, key, {
|
|
246
|
+
value: value,
|
|
247
|
+
enumerable: true,
|
|
248
|
+
configurable: true,
|
|
249
|
+
writable: true
|
|
250
|
+
});
|
|
251
|
+
} else {
|
|
252
|
+
obj[key] = value;
|
|
253
|
+
}
|
|
254
|
+
return obj;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
var TIMEZONE_UNIT_PRIORITY = 10;
|
|
258
|
+
var Setter = /*#__PURE__*/function () {
|
|
259
|
+
function Setter() {
|
|
260
|
+
_classCallCheck(this, Setter);
|
|
261
|
+
_defineProperty(this, "priority", void 0);
|
|
262
|
+
_defineProperty(this, "subPriority", 0);
|
|
263
|
+
}
|
|
264
|
+
_createClass(Setter, [{
|
|
265
|
+
key: "validate",
|
|
266
|
+
value: function validate(_utcDate, _options) {
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
}]);
|
|
270
|
+
return Setter;
|
|
271
|
+
}();
|
|
272
|
+
var ValueSetter = /*#__PURE__*/function (_Setter) {
|
|
273
|
+
_inherits(ValueSetter, _Setter);
|
|
274
|
+
var _super = _createSuper(ValueSetter);
|
|
275
|
+
function ValueSetter(value, validateValue, setValue, priority, subPriority) {
|
|
276
|
+
var _this;
|
|
277
|
+
_classCallCheck(this, ValueSetter);
|
|
278
|
+
_this = _super.call(this);
|
|
279
|
+
_this.value = value;
|
|
280
|
+
_this.validateValue = validateValue;
|
|
281
|
+
_this.setValue = setValue;
|
|
282
|
+
_this.priority = priority;
|
|
283
|
+
if (subPriority) {
|
|
284
|
+
_this.subPriority = subPriority;
|
|
285
|
+
}
|
|
286
|
+
return _this;
|
|
287
|
+
}
|
|
288
|
+
_createClass(ValueSetter, [{
|
|
289
|
+
key: "validate",
|
|
290
|
+
value: function validate(utcDate, options) {
|
|
291
|
+
return this.validateValue(utcDate, this.value, options);
|
|
292
|
+
}
|
|
293
|
+
}, {
|
|
294
|
+
key: "set",
|
|
295
|
+
value: function set(utcDate, flags, options) {
|
|
296
|
+
return this.setValue(utcDate, flags, this.value, options);
|
|
297
|
+
}
|
|
298
|
+
}]);
|
|
299
|
+
return ValueSetter;
|
|
300
|
+
}(Setter);
|
|
301
|
+
var DateToSystemTimezoneSetter = /*#__PURE__*/function (_Setter2) {
|
|
302
|
+
_inherits(DateToSystemTimezoneSetter, _Setter2);
|
|
303
|
+
var _super2 = _createSuper(DateToSystemTimezoneSetter);
|
|
304
|
+
function DateToSystemTimezoneSetter() {
|
|
305
|
+
var _this2;
|
|
306
|
+
_classCallCheck(this, DateToSystemTimezoneSetter);
|
|
307
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
308
|
+
args[_key] = arguments[_key];
|
|
309
|
+
}
|
|
310
|
+
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
311
|
+
_defineProperty(_assertThisInitialized(_this2), "priority", TIMEZONE_UNIT_PRIORITY);
|
|
312
|
+
_defineProperty(_assertThisInitialized(_this2), "subPriority", -1);
|
|
313
|
+
return _this2;
|
|
314
|
+
}
|
|
315
|
+
_createClass(DateToSystemTimezoneSetter, [{
|
|
316
|
+
key: "set",
|
|
317
|
+
value: function set(date, flags) {
|
|
318
|
+
if (flags.timestampIsSet) {
|
|
319
|
+
return date;
|
|
320
|
+
}
|
|
321
|
+
var convertedDate = new Date(0);
|
|
322
|
+
convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
323
|
+
convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
|
|
324
|
+
return convertedDate;
|
|
325
|
+
}
|
|
326
|
+
}]);
|
|
327
|
+
return DateToSystemTimezoneSetter;
|
|
328
|
+
}(Setter);
|
|
329
|
+
|
|
330
|
+
var Parser = /*#__PURE__*/function () {
|
|
331
|
+
function Parser() {
|
|
332
|
+
_classCallCheck(this, Parser);
|
|
333
|
+
_defineProperty(this, "incompatibleTokens", void 0);
|
|
334
|
+
_defineProperty(this, "priority", void 0);
|
|
335
|
+
_defineProperty(this, "subPriority", void 0);
|
|
336
|
+
}
|
|
337
|
+
_createClass(Parser, [{
|
|
338
|
+
key: "run",
|
|
339
|
+
value: function run(dateString, token, match, options) {
|
|
340
|
+
var result = this.parse(dateString, token, match, options);
|
|
341
|
+
if (!result) {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
return {
|
|
345
|
+
setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
|
|
346
|
+
rest: result.rest
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
}, {
|
|
350
|
+
key: "validate",
|
|
351
|
+
value: function validate(_utcDate, _value, _options) {
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
}]);
|
|
355
|
+
return Parser;
|
|
356
|
+
}();
|
|
357
|
+
|
|
358
|
+
var EraParser = /*#__PURE__*/function (_Parser) {
|
|
359
|
+
_inherits(EraParser, _Parser);
|
|
360
|
+
var _super = _createSuper(EraParser);
|
|
361
|
+
function EraParser() {
|
|
362
|
+
var _this;
|
|
363
|
+
_classCallCheck(this, EraParser);
|
|
364
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
365
|
+
args[_key] = arguments[_key];
|
|
366
|
+
}
|
|
367
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
368
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 140);
|
|
369
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['R', 'u', 't', 'T']);
|
|
370
|
+
return _this;
|
|
371
|
+
}
|
|
372
|
+
_createClass(EraParser, [{
|
|
373
|
+
key: "parse",
|
|
374
|
+
value: function parse(dateString, token, match) {
|
|
375
|
+
switch (token) {
|
|
376
|
+
// AD, BC
|
|
377
|
+
case 'G':
|
|
378
|
+
case 'GG':
|
|
379
|
+
case 'GGG':
|
|
380
|
+
return match.era(dateString, {
|
|
381
|
+
width: 'abbreviated'
|
|
382
|
+
}) || match.era(dateString, {
|
|
383
|
+
width: 'narrow'
|
|
384
|
+
});
|
|
385
|
+
// A, B
|
|
386
|
+
case 'GGGGG':
|
|
387
|
+
return match.era(dateString, {
|
|
388
|
+
width: 'narrow'
|
|
389
|
+
});
|
|
390
|
+
// Anno Domini, Before Christ
|
|
391
|
+
case 'GGGG':
|
|
392
|
+
default:
|
|
393
|
+
return match.era(dateString, {
|
|
394
|
+
width: 'wide'
|
|
395
|
+
}) || match.era(dateString, {
|
|
396
|
+
width: 'abbreviated'
|
|
397
|
+
}) || match.era(dateString, {
|
|
398
|
+
width: 'narrow'
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}, {
|
|
403
|
+
key: "set",
|
|
404
|
+
value: function set(date, flags, value) {
|
|
405
|
+
flags.era = value;
|
|
406
|
+
date.setUTCFullYear(value, 0, 1);
|
|
407
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
408
|
+
return date;
|
|
409
|
+
}
|
|
410
|
+
}]);
|
|
411
|
+
return EraParser;
|
|
412
|
+
}(Parser);
|
|
413
|
+
|
|
414
|
+
var numericPatterns = {
|
|
415
|
+
month: /^(1[0-2]|0?\d)/,
|
|
416
|
+
// 0 to 12
|
|
417
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
418
|
+
// 0 to 31
|
|
419
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
420
|
+
// 0 to 366
|
|
421
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
422
|
+
// 0 to 53
|
|
423
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
424
|
+
// 0 to 23
|
|
425
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
426
|
+
// 0 to 24
|
|
427
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
428
|
+
// 0 to 11
|
|
429
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
430
|
+
// 0 to 12
|
|
431
|
+
minute: /^[0-5]?\d/,
|
|
432
|
+
// 0 to 59
|
|
433
|
+
second: /^[0-5]?\d/,
|
|
434
|
+
// 0 to 59
|
|
435
|
+
|
|
436
|
+
singleDigit: /^\d/,
|
|
437
|
+
// 0 to 9
|
|
438
|
+
twoDigits: /^\d{1,2}/,
|
|
439
|
+
// 0 to 99
|
|
440
|
+
threeDigits: /^\d{1,3}/,
|
|
441
|
+
// 0 to 999
|
|
442
|
+
fourDigits: /^\d{1,4}/,
|
|
443
|
+
// 0 to 9999
|
|
444
|
+
|
|
445
|
+
anyDigitsSigned: /^-?\d+/,
|
|
446
|
+
singleDigitSigned: /^-?\d/,
|
|
447
|
+
// 0 to 9, -0 to -9
|
|
448
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
449
|
+
// 0 to 99, -0 to -99
|
|
450
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
451
|
+
// 0 to 999, -0 to -999
|
|
452
|
+
fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
var timezonePatterns = {
|
|
456
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
457
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
458
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
459
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
460
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
function mapValue(parseFnResult, mapFn) {
|
|
464
|
+
if (!parseFnResult) {
|
|
465
|
+
return parseFnResult;
|
|
466
|
+
}
|
|
467
|
+
return {
|
|
468
|
+
value: mapFn(parseFnResult.value),
|
|
469
|
+
rest: parseFnResult.rest
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
function parseNumericPattern(pattern, dateString) {
|
|
473
|
+
var matchResult = dateString.match(pattern);
|
|
474
|
+
if (!matchResult) {
|
|
475
|
+
return null;
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
value: parseInt(matchResult[0], 10),
|
|
479
|
+
rest: dateString.slice(matchResult[0].length)
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
function parseTimezonePattern(pattern, dateString) {
|
|
483
|
+
var matchResult = dateString.match(pattern);
|
|
484
|
+
if (!matchResult) {
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
// Input is 'Z'
|
|
489
|
+
if (matchResult[0] === 'Z') {
|
|
490
|
+
return {
|
|
491
|
+
value: 0,
|
|
492
|
+
rest: dateString.slice(1)
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
var sign = matchResult[1] === '+' ? 1 : -1;
|
|
496
|
+
var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
|
|
497
|
+
var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
|
|
498
|
+
var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
|
|
499
|
+
return {
|
|
500
|
+
value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
|
|
501
|
+
rest: dateString.slice(matchResult[0].length)
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
function parseAnyDigitsSigned(dateString) {
|
|
505
|
+
return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
|
|
506
|
+
}
|
|
507
|
+
function parseNDigits(n, dateString) {
|
|
508
|
+
switch (n) {
|
|
509
|
+
case 1:
|
|
510
|
+
return parseNumericPattern(numericPatterns.singleDigit, dateString);
|
|
511
|
+
case 2:
|
|
512
|
+
return parseNumericPattern(numericPatterns.twoDigits, dateString);
|
|
513
|
+
case 3:
|
|
514
|
+
return parseNumericPattern(numericPatterns.threeDigits, dateString);
|
|
515
|
+
case 4:
|
|
516
|
+
return parseNumericPattern(numericPatterns.fourDigits, dateString);
|
|
517
|
+
default:
|
|
518
|
+
return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), dateString);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
function parseNDigitsSigned(n, dateString) {
|
|
522
|
+
switch (n) {
|
|
523
|
+
case 1:
|
|
524
|
+
return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
|
|
525
|
+
case 2:
|
|
526
|
+
return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
|
|
527
|
+
case 3:
|
|
528
|
+
return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
|
|
529
|
+
case 4:
|
|
530
|
+
return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
|
|
531
|
+
default:
|
|
532
|
+
return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), dateString);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function dayPeriodEnumToHours(dayPeriod) {
|
|
536
|
+
switch (dayPeriod) {
|
|
537
|
+
case 'morning':
|
|
538
|
+
return 4;
|
|
539
|
+
case 'evening':
|
|
540
|
+
return 17;
|
|
541
|
+
case 'pm':
|
|
542
|
+
case 'noon':
|
|
543
|
+
case 'afternoon':
|
|
544
|
+
return 12;
|
|
545
|
+
case 'am':
|
|
546
|
+
case 'midnight':
|
|
547
|
+
case 'night':
|
|
548
|
+
default:
|
|
549
|
+
return 0;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
553
|
+
var isCommonEra = currentYear > 0;
|
|
554
|
+
// Absolute number of the current year:
|
|
555
|
+
// 1 -> 1 AC
|
|
556
|
+
// 0 -> 1 BC
|
|
557
|
+
// -1 -> 2 BC
|
|
558
|
+
var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
559
|
+
var result;
|
|
560
|
+
if (absCurrentYear <= 50) {
|
|
561
|
+
result = twoDigitYear || 100;
|
|
562
|
+
} else {
|
|
563
|
+
var rangeEnd = absCurrentYear + 50;
|
|
564
|
+
var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
|
|
565
|
+
var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
566
|
+
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
567
|
+
}
|
|
568
|
+
return isCommonEra ? result : 1 - result;
|
|
569
|
+
}
|
|
570
|
+
function isLeapYearIndex(year) {
|
|
571
|
+
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
|
|
575
|
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
576
|
+
// |----------|-------|----|-------|-------|-------|
|
|
577
|
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
578
|
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
579
|
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
580
|
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
581
|
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
582
|
+
var YearParser = /*#__PURE__*/function (_Parser) {
|
|
583
|
+
_inherits(YearParser, _Parser);
|
|
584
|
+
var _super = _createSuper(YearParser);
|
|
585
|
+
function YearParser() {
|
|
586
|
+
var _this;
|
|
587
|
+
_classCallCheck(this, YearParser);
|
|
588
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
589
|
+
args[_key] = arguments[_key];
|
|
590
|
+
}
|
|
591
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
592
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 130);
|
|
593
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
|
|
594
|
+
return _this;
|
|
595
|
+
}
|
|
596
|
+
_createClass(YearParser, [{
|
|
597
|
+
key: "parse",
|
|
598
|
+
value: function parse(dateString, token, match) {
|
|
599
|
+
var valueCallback = function valueCallback(year) {
|
|
600
|
+
return {
|
|
601
|
+
year: year,
|
|
602
|
+
isTwoDigitYear: token === 'yy'
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
switch (token) {
|
|
606
|
+
case 'y':
|
|
607
|
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
|
608
|
+
case 'yo':
|
|
609
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
610
|
+
unit: 'year'
|
|
611
|
+
}), valueCallback);
|
|
612
|
+
default:
|
|
613
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}, {
|
|
617
|
+
key: "validate",
|
|
618
|
+
value: function validate(_date, value) {
|
|
619
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
620
|
+
}
|
|
621
|
+
}, {
|
|
622
|
+
key: "set",
|
|
623
|
+
value: function set(date, flags, value) {
|
|
624
|
+
var currentYear = date.getUTCFullYear();
|
|
625
|
+
if (value.isTwoDigitYear) {
|
|
626
|
+
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
|
|
627
|
+
date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
|
|
628
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
629
|
+
return date;
|
|
630
|
+
}
|
|
631
|
+
var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
632
|
+
date.setUTCFullYear(year, 0, 1);
|
|
633
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
634
|
+
return date;
|
|
635
|
+
}
|
|
636
|
+
}]);
|
|
637
|
+
return YearParser;
|
|
638
|
+
}(Parser);
|
|
639
|
+
|
|
640
|
+
// Local week-numbering year
|
|
641
|
+
var LocalWeekYearParser = /*#__PURE__*/function (_Parser) {
|
|
642
|
+
_inherits(LocalWeekYearParser, _Parser);
|
|
643
|
+
var _super = _createSuper(LocalWeekYearParser);
|
|
644
|
+
function LocalWeekYearParser() {
|
|
645
|
+
var _this;
|
|
646
|
+
_classCallCheck(this, LocalWeekYearParser);
|
|
647
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
648
|
+
args[_key] = arguments[_key];
|
|
649
|
+
}
|
|
650
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
651
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 130);
|
|
652
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
|
|
653
|
+
return _this;
|
|
654
|
+
}
|
|
655
|
+
_createClass(LocalWeekYearParser, [{
|
|
656
|
+
key: "parse",
|
|
657
|
+
value: function parse(dateString, token, match) {
|
|
658
|
+
var valueCallback = function valueCallback(year) {
|
|
659
|
+
return {
|
|
660
|
+
year: year,
|
|
661
|
+
isTwoDigitYear: token === 'YY'
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
switch (token) {
|
|
665
|
+
case 'Y':
|
|
666
|
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
|
667
|
+
case 'Yo':
|
|
668
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
669
|
+
unit: 'year'
|
|
670
|
+
}), valueCallback);
|
|
671
|
+
default:
|
|
672
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}, {
|
|
676
|
+
key: "validate",
|
|
677
|
+
value: function validate(_date, value) {
|
|
678
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
679
|
+
}
|
|
680
|
+
}, {
|
|
681
|
+
key: "set",
|
|
682
|
+
value: function set(date, flags, value, options) {
|
|
683
|
+
var currentYear = index.getUTCWeekYear(date, options);
|
|
684
|
+
if (value.isTwoDigitYear) {
|
|
685
|
+
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
|
|
686
|
+
date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
|
|
687
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
688
|
+
return index.startOfUTCWeek(date, options);
|
|
689
|
+
}
|
|
690
|
+
var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
691
|
+
date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
|
|
692
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
693
|
+
return index.startOfUTCWeek(date, options);
|
|
694
|
+
}
|
|
695
|
+
}]);
|
|
696
|
+
return LocalWeekYearParser;
|
|
697
|
+
}(Parser);
|
|
698
|
+
|
|
699
|
+
var ISOWeekYearParser = /*#__PURE__*/function (_Parser) {
|
|
700
|
+
_inherits(ISOWeekYearParser, _Parser);
|
|
701
|
+
var _super = _createSuper(ISOWeekYearParser);
|
|
702
|
+
function ISOWeekYearParser() {
|
|
703
|
+
var _this;
|
|
704
|
+
_classCallCheck(this, ISOWeekYearParser);
|
|
705
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
706
|
+
args[_key] = arguments[_key];
|
|
707
|
+
}
|
|
708
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
709
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 130);
|
|
710
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
|
|
711
|
+
return _this;
|
|
712
|
+
}
|
|
713
|
+
_createClass(ISOWeekYearParser, [{
|
|
714
|
+
key: "parse",
|
|
715
|
+
value: function parse(dateString, token) {
|
|
716
|
+
if (token === 'R') {
|
|
717
|
+
return parseNDigitsSigned(4, dateString);
|
|
718
|
+
}
|
|
719
|
+
return parseNDigitsSigned(token.length, dateString);
|
|
720
|
+
}
|
|
721
|
+
}, {
|
|
722
|
+
key: "set",
|
|
723
|
+
value: function set(_date, _flags, value) {
|
|
724
|
+
var firstWeekOfYear = new Date(0);
|
|
725
|
+
firstWeekOfYear.setUTCFullYear(value, 0, 4);
|
|
726
|
+
firstWeekOfYear.setUTCHours(0, 0, 0, 0);
|
|
727
|
+
return index.startOfUTCISOWeek(firstWeekOfYear);
|
|
728
|
+
}
|
|
729
|
+
}]);
|
|
730
|
+
return ISOWeekYearParser;
|
|
731
|
+
}(Parser);
|
|
732
|
+
|
|
733
|
+
var ExtendedYearParser = /*#__PURE__*/function (_Parser) {
|
|
734
|
+
_inherits(ExtendedYearParser, _Parser);
|
|
735
|
+
var _super = _createSuper(ExtendedYearParser);
|
|
736
|
+
function ExtendedYearParser() {
|
|
737
|
+
var _this;
|
|
738
|
+
_classCallCheck(this, ExtendedYearParser);
|
|
739
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
740
|
+
args[_key] = arguments[_key];
|
|
741
|
+
}
|
|
742
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
743
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 130);
|
|
744
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
|
|
745
|
+
return _this;
|
|
746
|
+
}
|
|
747
|
+
_createClass(ExtendedYearParser, [{
|
|
748
|
+
key: "parse",
|
|
749
|
+
value: function parse(dateString, token) {
|
|
750
|
+
if (token === 'u') {
|
|
751
|
+
return parseNDigitsSigned(4, dateString);
|
|
752
|
+
}
|
|
753
|
+
return parseNDigitsSigned(token.length, dateString);
|
|
754
|
+
}
|
|
755
|
+
}, {
|
|
756
|
+
key: "set",
|
|
757
|
+
value: function set(date, _flags, value) {
|
|
758
|
+
date.setUTCFullYear(value, 0, 1);
|
|
759
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
760
|
+
return date;
|
|
761
|
+
}
|
|
762
|
+
}]);
|
|
763
|
+
return ExtendedYearParser;
|
|
764
|
+
}(Parser);
|
|
765
|
+
|
|
766
|
+
var QuarterParser = /*#__PURE__*/function (_Parser) {
|
|
767
|
+
_inherits(QuarterParser, _Parser);
|
|
768
|
+
var _super = _createSuper(QuarterParser);
|
|
769
|
+
function QuarterParser() {
|
|
770
|
+
var _this;
|
|
771
|
+
_classCallCheck(this, QuarterParser);
|
|
772
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
773
|
+
args[_key] = arguments[_key];
|
|
774
|
+
}
|
|
775
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
776
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 120);
|
|
777
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
778
|
+
return _this;
|
|
779
|
+
}
|
|
780
|
+
_createClass(QuarterParser, [{
|
|
781
|
+
key: "parse",
|
|
782
|
+
value: function parse(dateString, token, match) {
|
|
783
|
+
switch (token) {
|
|
784
|
+
// 1, 2, 3, 4
|
|
785
|
+
case 'Q':
|
|
786
|
+
case 'QQ':
|
|
787
|
+
// 01, 02, 03, 04
|
|
788
|
+
return parseNDigits(token.length, dateString);
|
|
789
|
+
// 1st, 2nd, 3rd, 4th
|
|
790
|
+
case 'Qo':
|
|
791
|
+
return match.ordinalNumber(dateString, {
|
|
792
|
+
unit: 'quarter'
|
|
793
|
+
});
|
|
794
|
+
// Q1, Q2, Q3, Q4
|
|
795
|
+
case 'QQQ':
|
|
796
|
+
return match.quarter(dateString, {
|
|
797
|
+
width: 'abbreviated',
|
|
798
|
+
context: 'formatting'
|
|
799
|
+
}) || match.quarter(dateString, {
|
|
800
|
+
width: 'narrow',
|
|
801
|
+
context: 'formatting'
|
|
802
|
+
});
|
|
803
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
804
|
+
case 'QQQQQ':
|
|
805
|
+
return match.quarter(dateString, {
|
|
806
|
+
width: 'narrow',
|
|
807
|
+
context: 'formatting'
|
|
808
|
+
});
|
|
809
|
+
// 1st quarter, 2nd quarter, ...
|
|
810
|
+
case 'QQQQ':
|
|
811
|
+
default:
|
|
812
|
+
return match.quarter(dateString, {
|
|
813
|
+
width: 'wide',
|
|
814
|
+
context: 'formatting'
|
|
815
|
+
}) || match.quarter(dateString, {
|
|
816
|
+
width: 'abbreviated',
|
|
817
|
+
context: 'formatting'
|
|
818
|
+
}) || match.quarter(dateString, {
|
|
819
|
+
width: 'narrow',
|
|
820
|
+
context: 'formatting'
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}, {
|
|
825
|
+
key: "validate",
|
|
826
|
+
value: function validate(_date, value) {
|
|
827
|
+
return value >= 1 && value <= 4;
|
|
828
|
+
}
|
|
829
|
+
}, {
|
|
830
|
+
key: "set",
|
|
831
|
+
value: function set(date, _flags, value) {
|
|
832
|
+
date.setUTCMonth((value - 1) * 3, 1);
|
|
833
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
834
|
+
return date;
|
|
835
|
+
}
|
|
836
|
+
}]);
|
|
837
|
+
return QuarterParser;
|
|
838
|
+
}(Parser);
|
|
839
|
+
|
|
840
|
+
var StandAloneQuarterParser = /*#__PURE__*/function (_Parser) {
|
|
841
|
+
_inherits(StandAloneQuarterParser, _Parser);
|
|
842
|
+
var _super = _createSuper(StandAloneQuarterParser);
|
|
843
|
+
function StandAloneQuarterParser() {
|
|
844
|
+
var _this;
|
|
845
|
+
_classCallCheck(this, StandAloneQuarterParser);
|
|
846
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
847
|
+
args[_key] = arguments[_key];
|
|
848
|
+
}
|
|
849
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
850
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 120);
|
|
851
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
852
|
+
return _this;
|
|
853
|
+
}
|
|
854
|
+
_createClass(StandAloneQuarterParser, [{
|
|
855
|
+
key: "parse",
|
|
856
|
+
value: function parse(dateString, token, match) {
|
|
857
|
+
switch (token) {
|
|
858
|
+
// 1, 2, 3, 4
|
|
859
|
+
case 'q':
|
|
860
|
+
case 'qq':
|
|
861
|
+
// 01, 02, 03, 04
|
|
862
|
+
return parseNDigits(token.length, dateString);
|
|
863
|
+
// 1st, 2nd, 3rd, 4th
|
|
864
|
+
case 'qo':
|
|
865
|
+
return match.ordinalNumber(dateString, {
|
|
866
|
+
unit: 'quarter'
|
|
867
|
+
});
|
|
868
|
+
// Q1, Q2, Q3, Q4
|
|
869
|
+
case 'qqq':
|
|
870
|
+
return match.quarter(dateString, {
|
|
871
|
+
width: 'abbreviated',
|
|
872
|
+
context: 'standalone'
|
|
873
|
+
}) || match.quarter(dateString, {
|
|
874
|
+
width: 'narrow',
|
|
875
|
+
context: 'standalone'
|
|
876
|
+
});
|
|
877
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
878
|
+
case 'qqqqq':
|
|
879
|
+
return match.quarter(dateString, {
|
|
880
|
+
width: 'narrow',
|
|
881
|
+
context: 'standalone'
|
|
882
|
+
});
|
|
883
|
+
// 1st quarter, 2nd quarter, ...
|
|
884
|
+
case 'qqqq':
|
|
885
|
+
default:
|
|
886
|
+
return match.quarter(dateString, {
|
|
887
|
+
width: 'wide',
|
|
888
|
+
context: 'standalone'
|
|
889
|
+
}) || match.quarter(dateString, {
|
|
890
|
+
width: 'abbreviated',
|
|
891
|
+
context: 'standalone'
|
|
892
|
+
}) || match.quarter(dateString, {
|
|
893
|
+
width: 'narrow',
|
|
894
|
+
context: 'standalone'
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}, {
|
|
899
|
+
key: "validate",
|
|
900
|
+
value: function validate(_date, value) {
|
|
901
|
+
return value >= 1 && value <= 4;
|
|
902
|
+
}
|
|
903
|
+
}, {
|
|
904
|
+
key: "set",
|
|
905
|
+
value: function set(date, _flags, value) {
|
|
906
|
+
date.setUTCMonth((value - 1) * 3, 1);
|
|
907
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
908
|
+
return date;
|
|
909
|
+
}
|
|
910
|
+
}]);
|
|
911
|
+
return StandAloneQuarterParser;
|
|
912
|
+
}(Parser);
|
|
913
|
+
|
|
914
|
+
var MonthParser = /*#__PURE__*/function (_Parser) {
|
|
915
|
+
_inherits(MonthParser, _Parser);
|
|
916
|
+
var _super = _createSuper(MonthParser);
|
|
917
|
+
function MonthParser() {
|
|
918
|
+
var _this;
|
|
919
|
+
_classCallCheck(this, MonthParser);
|
|
920
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
921
|
+
args[_key] = arguments[_key];
|
|
922
|
+
}
|
|
923
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
924
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
925
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 110);
|
|
926
|
+
return _this;
|
|
927
|
+
}
|
|
928
|
+
_createClass(MonthParser, [{
|
|
929
|
+
key: "parse",
|
|
930
|
+
value: function parse(dateString, token, match) {
|
|
931
|
+
var valueCallback = function valueCallback(value) {
|
|
932
|
+
return value - 1;
|
|
933
|
+
};
|
|
934
|
+
switch (token) {
|
|
935
|
+
// 1, 2, ..., 12
|
|
936
|
+
case 'M':
|
|
937
|
+
return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
|
|
938
|
+
// 01, 02, ..., 12
|
|
939
|
+
case 'MM':
|
|
940
|
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
|
941
|
+
// 1st, 2nd, ..., 12th
|
|
942
|
+
case 'Mo':
|
|
943
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
944
|
+
unit: 'month'
|
|
945
|
+
}), valueCallback);
|
|
946
|
+
// Jan, Feb, ..., Dec
|
|
947
|
+
case 'MMM':
|
|
948
|
+
return match.month(dateString, {
|
|
949
|
+
width: 'abbreviated',
|
|
950
|
+
context: 'formatting'
|
|
951
|
+
}) || match.month(dateString, {
|
|
952
|
+
width: 'narrow',
|
|
953
|
+
context: 'formatting'
|
|
954
|
+
});
|
|
955
|
+
// J, F, ..., D
|
|
956
|
+
case 'MMMMM':
|
|
957
|
+
return match.month(dateString, {
|
|
958
|
+
width: 'narrow',
|
|
959
|
+
context: 'formatting'
|
|
960
|
+
});
|
|
961
|
+
// January, February, ..., December
|
|
962
|
+
case 'MMMM':
|
|
963
|
+
default:
|
|
964
|
+
return match.month(dateString, {
|
|
965
|
+
width: 'wide',
|
|
966
|
+
context: 'formatting'
|
|
967
|
+
}) || match.month(dateString, {
|
|
968
|
+
width: 'abbreviated',
|
|
969
|
+
context: 'formatting'
|
|
970
|
+
}) || match.month(dateString, {
|
|
971
|
+
width: 'narrow',
|
|
972
|
+
context: 'formatting'
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}, {
|
|
977
|
+
key: "validate",
|
|
978
|
+
value: function validate(_date, value) {
|
|
979
|
+
return value >= 0 && value <= 11;
|
|
980
|
+
}
|
|
981
|
+
}, {
|
|
982
|
+
key: "set",
|
|
983
|
+
value: function set(date, _flags, value) {
|
|
984
|
+
date.setUTCMonth(value, 1);
|
|
985
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
986
|
+
return date;
|
|
987
|
+
}
|
|
988
|
+
}]);
|
|
989
|
+
return MonthParser;
|
|
990
|
+
}(Parser);
|
|
991
|
+
|
|
992
|
+
var StandAloneMonthParser = /*#__PURE__*/function (_Parser) {
|
|
993
|
+
_inherits(StandAloneMonthParser, _Parser);
|
|
994
|
+
var _super = _createSuper(StandAloneMonthParser);
|
|
995
|
+
function StandAloneMonthParser() {
|
|
996
|
+
var _this;
|
|
997
|
+
_classCallCheck(this, StandAloneMonthParser);
|
|
998
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
999
|
+
args[_key] = arguments[_key];
|
|
1000
|
+
}
|
|
1001
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1002
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 110);
|
|
1003
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
1004
|
+
return _this;
|
|
1005
|
+
}
|
|
1006
|
+
_createClass(StandAloneMonthParser, [{
|
|
1007
|
+
key: "parse",
|
|
1008
|
+
value: function parse(dateString, token, match) {
|
|
1009
|
+
var valueCallback = function valueCallback(value) {
|
|
1010
|
+
return value - 1;
|
|
1011
|
+
};
|
|
1012
|
+
switch (token) {
|
|
1013
|
+
// 1, 2, ..., 12
|
|
1014
|
+
case 'L':
|
|
1015
|
+
return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
|
|
1016
|
+
// 01, 02, ..., 12
|
|
1017
|
+
case 'LL':
|
|
1018
|
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
|
1019
|
+
// 1st, 2nd, ..., 12th
|
|
1020
|
+
case 'Lo':
|
|
1021
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
1022
|
+
unit: 'month'
|
|
1023
|
+
}), valueCallback);
|
|
1024
|
+
// Jan, Feb, ..., Dec
|
|
1025
|
+
case 'LLL':
|
|
1026
|
+
return match.month(dateString, {
|
|
1027
|
+
width: 'abbreviated',
|
|
1028
|
+
context: 'standalone'
|
|
1029
|
+
}) || match.month(dateString, {
|
|
1030
|
+
width: 'narrow',
|
|
1031
|
+
context: 'standalone'
|
|
1032
|
+
});
|
|
1033
|
+
// J, F, ..., D
|
|
1034
|
+
case 'LLLLL':
|
|
1035
|
+
return match.month(dateString, {
|
|
1036
|
+
width: 'narrow',
|
|
1037
|
+
context: 'standalone'
|
|
1038
|
+
});
|
|
1039
|
+
// January, February, ..., December
|
|
1040
|
+
case 'LLLL':
|
|
1041
|
+
default:
|
|
1042
|
+
return match.month(dateString, {
|
|
1043
|
+
width: 'wide',
|
|
1044
|
+
context: 'standalone'
|
|
1045
|
+
}) || match.month(dateString, {
|
|
1046
|
+
width: 'abbreviated',
|
|
1047
|
+
context: 'standalone'
|
|
1048
|
+
}) || match.month(dateString, {
|
|
1049
|
+
width: 'narrow',
|
|
1050
|
+
context: 'standalone'
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}, {
|
|
1055
|
+
key: "validate",
|
|
1056
|
+
value: function validate(_date, value) {
|
|
1057
|
+
return value >= 0 && value <= 11;
|
|
1058
|
+
}
|
|
1059
|
+
}, {
|
|
1060
|
+
key: "set",
|
|
1061
|
+
value: function set(date, _flags, value) {
|
|
1062
|
+
date.setUTCMonth(value, 1);
|
|
1063
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1064
|
+
return date;
|
|
1065
|
+
}
|
|
1066
|
+
}]);
|
|
1067
|
+
return StandAloneMonthParser;
|
|
1068
|
+
}(Parser);
|
|
1069
|
+
|
|
1070
|
+
function setUTCWeek(dirtyDate, dirtyWeek, options) {
|
|
1071
|
+
index.requiredArgs(2, arguments);
|
|
1072
|
+
var date = index.toDate(dirtyDate);
|
|
1073
|
+
var week = index.toInteger(dirtyWeek);
|
|
1074
|
+
var diff = index.getUTCWeek(date, options) - week;
|
|
1075
|
+
date.setUTCDate(date.getUTCDate() - diff * 7);
|
|
1076
|
+
return date;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
var LocalWeekParser = /*#__PURE__*/function (_Parser) {
|
|
1080
|
+
_inherits(LocalWeekParser, _Parser);
|
|
1081
|
+
var _super = _createSuper(LocalWeekParser);
|
|
1082
|
+
function LocalWeekParser() {
|
|
1083
|
+
var _this;
|
|
1084
|
+
_classCallCheck(this, LocalWeekParser);
|
|
1085
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1086
|
+
args[_key] = arguments[_key];
|
|
1087
|
+
}
|
|
1088
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1089
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 100);
|
|
1090
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
|
|
1091
|
+
return _this;
|
|
1092
|
+
}
|
|
1093
|
+
_createClass(LocalWeekParser, [{
|
|
1094
|
+
key: "parse",
|
|
1095
|
+
value: function parse(dateString, token, match) {
|
|
1096
|
+
switch (token) {
|
|
1097
|
+
case 'w':
|
|
1098
|
+
return parseNumericPattern(numericPatterns.week, dateString);
|
|
1099
|
+
case 'wo':
|
|
1100
|
+
return match.ordinalNumber(dateString, {
|
|
1101
|
+
unit: 'week'
|
|
1102
|
+
});
|
|
1103
|
+
default:
|
|
1104
|
+
return parseNDigits(token.length, dateString);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}, {
|
|
1108
|
+
key: "validate",
|
|
1109
|
+
value: function validate(_date, value) {
|
|
1110
|
+
return value >= 1 && value <= 53;
|
|
1111
|
+
}
|
|
1112
|
+
}, {
|
|
1113
|
+
key: "set",
|
|
1114
|
+
value: function set(date, _flags, value, options) {
|
|
1115
|
+
return index.startOfUTCWeek(setUTCWeek(date, value, options), options);
|
|
1116
|
+
}
|
|
1117
|
+
}]);
|
|
1118
|
+
return LocalWeekParser;
|
|
1119
|
+
}(Parser);
|
|
1120
|
+
|
|
1121
|
+
function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
|
|
1122
|
+
index.requiredArgs(2, arguments);
|
|
1123
|
+
var date = index.toDate(dirtyDate);
|
|
1124
|
+
var isoWeek = index.toInteger(dirtyISOWeek);
|
|
1125
|
+
var diff = index.getUTCISOWeek(date) - isoWeek;
|
|
1126
|
+
date.setUTCDate(date.getUTCDate() - diff * 7);
|
|
1127
|
+
return date;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
var ISOWeekParser = /*#__PURE__*/function (_Parser) {
|
|
1131
|
+
_inherits(ISOWeekParser, _Parser);
|
|
1132
|
+
var _super = _createSuper(ISOWeekParser);
|
|
1133
|
+
function ISOWeekParser() {
|
|
1134
|
+
var _this;
|
|
1135
|
+
_classCallCheck(this, ISOWeekParser);
|
|
1136
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1137
|
+
args[_key] = arguments[_key];
|
|
1138
|
+
}
|
|
1139
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1140
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 100);
|
|
1141
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
|
|
1142
|
+
return _this;
|
|
1143
|
+
}
|
|
1144
|
+
_createClass(ISOWeekParser, [{
|
|
1145
|
+
key: "parse",
|
|
1146
|
+
value: function parse(dateString, token, match) {
|
|
1147
|
+
switch (token) {
|
|
1148
|
+
case 'I':
|
|
1149
|
+
return parseNumericPattern(numericPatterns.week, dateString);
|
|
1150
|
+
case 'Io':
|
|
1151
|
+
return match.ordinalNumber(dateString, {
|
|
1152
|
+
unit: 'week'
|
|
1153
|
+
});
|
|
1154
|
+
default:
|
|
1155
|
+
return parseNDigits(token.length, dateString);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}, {
|
|
1159
|
+
key: "validate",
|
|
1160
|
+
value: function validate(_date, value) {
|
|
1161
|
+
return value >= 1 && value <= 53;
|
|
1162
|
+
}
|
|
1163
|
+
}, {
|
|
1164
|
+
key: "set",
|
|
1165
|
+
value: function set(date, _flags, value) {
|
|
1166
|
+
return index.startOfUTCISOWeek(setUTCISOWeek(date, value));
|
|
1167
|
+
}
|
|
1168
|
+
}]);
|
|
1169
|
+
return ISOWeekParser;
|
|
1170
|
+
}(Parser);
|
|
1171
|
+
|
|
1172
|
+
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1173
|
+
var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1174
|
+
|
|
1175
|
+
// Day of the month
|
|
1176
|
+
var DateParser = /*#__PURE__*/function (_Parser) {
|
|
1177
|
+
_inherits(DateParser, _Parser);
|
|
1178
|
+
var _super = _createSuper(DateParser);
|
|
1179
|
+
function DateParser() {
|
|
1180
|
+
var _this;
|
|
1181
|
+
_classCallCheck(this, DateParser);
|
|
1182
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1183
|
+
args[_key] = arguments[_key];
|
|
1184
|
+
}
|
|
1185
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1186
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 90);
|
|
1187
|
+
_defineProperty(_assertThisInitialized(_this), "subPriority", 1);
|
|
1188
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
1189
|
+
return _this;
|
|
1190
|
+
}
|
|
1191
|
+
_createClass(DateParser, [{
|
|
1192
|
+
key: "parse",
|
|
1193
|
+
value: function parse(dateString, token, match) {
|
|
1194
|
+
switch (token) {
|
|
1195
|
+
case 'd':
|
|
1196
|
+
return parseNumericPattern(numericPatterns.date, dateString);
|
|
1197
|
+
case 'do':
|
|
1198
|
+
return match.ordinalNumber(dateString, {
|
|
1199
|
+
unit: 'date'
|
|
1200
|
+
});
|
|
1201
|
+
default:
|
|
1202
|
+
return parseNDigits(token.length, dateString);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
}, {
|
|
1206
|
+
key: "validate",
|
|
1207
|
+
value: function validate(date, value) {
|
|
1208
|
+
var year = date.getUTCFullYear();
|
|
1209
|
+
var isLeapYear = isLeapYearIndex(year);
|
|
1210
|
+
var month = date.getUTCMonth();
|
|
1211
|
+
if (isLeapYear) {
|
|
1212
|
+
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
|
|
1213
|
+
} else {
|
|
1214
|
+
return value >= 1 && value <= DAYS_IN_MONTH[month];
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}, {
|
|
1218
|
+
key: "set",
|
|
1219
|
+
value: function set(date, _flags, value) {
|
|
1220
|
+
date.setUTCDate(value);
|
|
1221
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1222
|
+
return date;
|
|
1223
|
+
}
|
|
1224
|
+
}]);
|
|
1225
|
+
return DateParser;
|
|
1226
|
+
}(Parser);
|
|
1227
|
+
|
|
1228
|
+
var DayOfYearParser = /*#__PURE__*/function (_Parser) {
|
|
1229
|
+
_inherits(DayOfYearParser, _Parser);
|
|
1230
|
+
var _super = _createSuper(DayOfYearParser);
|
|
1231
|
+
function DayOfYearParser() {
|
|
1232
|
+
var _this;
|
|
1233
|
+
_classCallCheck(this, DayOfYearParser);
|
|
1234
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1235
|
+
args[_key] = arguments[_key];
|
|
1236
|
+
}
|
|
1237
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1238
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 90);
|
|
1239
|
+
_defineProperty(_assertThisInitialized(_this), "subpriority", 1);
|
|
1240
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']);
|
|
1241
|
+
return _this;
|
|
1242
|
+
}
|
|
1243
|
+
_createClass(DayOfYearParser, [{
|
|
1244
|
+
key: "parse",
|
|
1245
|
+
value: function parse(dateString, token, match) {
|
|
1246
|
+
switch (token) {
|
|
1247
|
+
case 'D':
|
|
1248
|
+
case 'DD':
|
|
1249
|
+
return parseNumericPattern(numericPatterns.dayOfYear, dateString);
|
|
1250
|
+
case 'Do':
|
|
1251
|
+
return match.ordinalNumber(dateString, {
|
|
1252
|
+
unit: 'date'
|
|
1253
|
+
});
|
|
1254
|
+
default:
|
|
1255
|
+
return parseNDigits(token.length, dateString);
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
}, {
|
|
1259
|
+
key: "validate",
|
|
1260
|
+
value: function validate(date, value) {
|
|
1261
|
+
var year = date.getUTCFullYear();
|
|
1262
|
+
var isLeapYear = isLeapYearIndex(year);
|
|
1263
|
+
if (isLeapYear) {
|
|
1264
|
+
return value >= 1 && value <= 366;
|
|
1265
|
+
} else {
|
|
1266
|
+
return value >= 1 && value <= 365;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}, {
|
|
1270
|
+
key: "set",
|
|
1271
|
+
value: function set(date, _flags, value) {
|
|
1272
|
+
date.setUTCMonth(0, value);
|
|
1273
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1274
|
+
return date;
|
|
1275
|
+
}
|
|
1276
|
+
}]);
|
|
1277
|
+
return DayOfYearParser;
|
|
1278
|
+
}(Parser);
|
|
1279
|
+
|
|
1280
|
+
function setUTCDay(dirtyDate, dirtyDay, options) {
|
|
1281
|
+
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
1282
|
+
index.requiredArgs(2, arguments);
|
|
1283
|
+
var defaultOptions = index.getDefaultOptions();
|
|
1284
|
+
var weekStartsOn = index.toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
|
|
1285
|
+
|
|
1286
|
+
// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
1287
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
1288
|
+
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
1289
|
+
}
|
|
1290
|
+
var date = index.toDate(dirtyDate);
|
|
1291
|
+
var day = index.toInteger(dirtyDay);
|
|
1292
|
+
var currentDay = date.getUTCDay();
|
|
1293
|
+
var remainder = day % 7;
|
|
1294
|
+
var dayIndex = (remainder + 7) % 7;
|
|
1295
|
+
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
|
|
1296
|
+
date.setUTCDate(date.getUTCDate() + diff);
|
|
1297
|
+
return date;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
var DayParser = /*#__PURE__*/function (_Parser) {
|
|
1301
|
+
_inherits(DayParser, _Parser);
|
|
1302
|
+
var _super = _createSuper(DayParser);
|
|
1303
|
+
function DayParser() {
|
|
1304
|
+
var _this;
|
|
1305
|
+
_classCallCheck(this, DayParser);
|
|
1306
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1307
|
+
args[_key] = arguments[_key];
|
|
1308
|
+
}
|
|
1309
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1310
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 90);
|
|
1311
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['D', 'i', 'e', 'c', 't', 'T']);
|
|
1312
|
+
return _this;
|
|
1313
|
+
}
|
|
1314
|
+
_createClass(DayParser, [{
|
|
1315
|
+
key: "parse",
|
|
1316
|
+
value: function parse(dateString, token, match) {
|
|
1317
|
+
switch (token) {
|
|
1318
|
+
// Tue
|
|
1319
|
+
case 'E':
|
|
1320
|
+
case 'EE':
|
|
1321
|
+
case 'EEE':
|
|
1322
|
+
return match.day(dateString, {
|
|
1323
|
+
width: 'abbreviated',
|
|
1324
|
+
context: 'formatting'
|
|
1325
|
+
}) || match.day(dateString, {
|
|
1326
|
+
width: 'short',
|
|
1327
|
+
context: 'formatting'
|
|
1328
|
+
}) || match.day(dateString, {
|
|
1329
|
+
width: 'narrow',
|
|
1330
|
+
context: 'formatting'
|
|
1331
|
+
});
|
|
1332
|
+
// T
|
|
1333
|
+
case 'EEEEE':
|
|
1334
|
+
return match.day(dateString, {
|
|
1335
|
+
width: 'narrow',
|
|
1336
|
+
context: 'formatting'
|
|
1337
|
+
});
|
|
1338
|
+
// Tu
|
|
1339
|
+
case 'EEEEEE':
|
|
1340
|
+
return match.day(dateString, {
|
|
1341
|
+
width: 'short',
|
|
1342
|
+
context: 'formatting'
|
|
1343
|
+
}) || match.day(dateString, {
|
|
1344
|
+
width: 'narrow',
|
|
1345
|
+
context: 'formatting'
|
|
1346
|
+
});
|
|
1347
|
+
// Tuesday
|
|
1348
|
+
case 'EEEE':
|
|
1349
|
+
default:
|
|
1350
|
+
return match.day(dateString, {
|
|
1351
|
+
width: 'wide',
|
|
1352
|
+
context: 'formatting'
|
|
1353
|
+
}) || match.day(dateString, {
|
|
1354
|
+
width: 'abbreviated',
|
|
1355
|
+
context: 'formatting'
|
|
1356
|
+
}) || match.day(dateString, {
|
|
1357
|
+
width: 'short',
|
|
1358
|
+
context: 'formatting'
|
|
1359
|
+
}) || match.day(dateString, {
|
|
1360
|
+
width: 'narrow',
|
|
1361
|
+
context: 'formatting'
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
}, {
|
|
1366
|
+
key: "validate",
|
|
1367
|
+
value: function validate(_date, value) {
|
|
1368
|
+
return value >= 0 && value <= 6;
|
|
1369
|
+
}
|
|
1370
|
+
}, {
|
|
1371
|
+
key: "set",
|
|
1372
|
+
value: function set(date, _flags, value, options) {
|
|
1373
|
+
date = setUTCDay(date, value, options);
|
|
1374
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1375
|
+
return date;
|
|
1376
|
+
}
|
|
1377
|
+
}]);
|
|
1378
|
+
return DayParser;
|
|
1379
|
+
}(Parser);
|
|
1380
|
+
|
|
1381
|
+
var LocalDayParser = /*#__PURE__*/function (_Parser) {
|
|
1382
|
+
_inherits(LocalDayParser, _Parser);
|
|
1383
|
+
var _super = _createSuper(LocalDayParser);
|
|
1384
|
+
function LocalDayParser() {
|
|
1385
|
+
var _this;
|
|
1386
|
+
_classCallCheck(this, LocalDayParser);
|
|
1387
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1388
|
+
args[_key] = arguments[_key];
|
|
1389
|
+
}
|
|
1390
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1391
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 90);
|
|
1392
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']);
|
|
1393
|
+
return _this;
|
|
1394
|
+
}
|
|
1395
|
+
_createClass(LocalDayParser, [{
|
|
1396
|
+
key: "parse",
|
|
1397
|
+
value: function parse(dateString, token, match, options) {
|
|
1398
|
+
var valueCallback = function valueCallback(value) {
|
|
1399
|
+
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
1400
|
+
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
1401
|
+
};
|
|
1402
|
+
switch (token) {
|
|
1403
|
+
// 3
|
|
1404
|
+
case 'e':
|
|
1405
|
+
case 'ee':
|
|
1406
|
+
// 03
|
|
1407
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
1408
|
+
// 3rd
|
|
1409
|
+
case 'eo':
|
|
1410
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
1411
|
+
unit: 'day'
|
|
1412
|
+
}), valueCallback);
|
|
1413
|
+
// Tue
|
|
1414
|
+
case 'eee':
|
|
1415
|
+
return match.day(dateString, {
|
|
1416
|
+
width: 'abbreviated',
|
|
1417
|
+
context: 'formatting'
|
|
1418
|
+
}) || match.day(dateString, {
|
|
1419
|
+
width: 'short',
|
|
1420
|
+
context: 'formatting'
|
|
1421
|
+
}) || match.day(dateString, {
|
|
1422
|
+
width: 'narrow',
|
|
1423
|
+
context: 'formatting'
|
|
1424
|
+
});
|
|
1425
|
+
// T
|
|
1426
|
+
case 'eeeee':
|
|
1427
|
+
return match.day(dateString, {
|
|
1428
|
+
width: 'narrow',
|
|
1429
|
+
context: 'formatting'
|
|
1430
|
+
});
|
|
1431
|
+
// Tu
|
|
1432
|
+
case 'eeeeee':
|
|
1433
|
+
return match.day(dateString, {
|
|
1434
|
+
width: 'short',
|
|
1435
|
+
context: 'formatting'
|
|
1436
|
+
}) || match.day(dateString, {
|
|
1437
|
+
width: 'narrow',
|
|
1438
|
+
context: 'formatting'
|
|
1439
|
+
});
|
|
1440
|
+
// Tuesday
|
|
1441
|
+
case 'eeee':
|
|
1442
|
+
default:
|
|
1443
|
+
return match.day(dateString, {
|
|
1444
|
+
width: 'wide',
|
|
1445
|
+
context: 'formatting'
|
|
1446
|
+
}) || match.day(dateString, {
|
|
1447
|
+
width: 'abbreviated',
|
|
1448
|
+
context: 'formatting'
|
|
1449
|
+
}) || match.day(dateString, {
|
|
1450
|
+
width: 'short',
|
|
1451
|
+
context: 'formatting'
|
|
1452
|
+
}) || match.day(dateString, {
|
|
1453
|
+
width: 'narrow',
|
|
1454
|
+
context: 'formatting'
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}, {
|
|
1459
|
+
key: "validate",
|
|
1460
|
+
value: function validate(_date, value) {
|
|
1461
|
+
return value >= 0 && value <= 6;
|
|
1462
|
+
}
|
|
1463
|
+
}, {
|
|
1464
|
+
key: "set",
|
|
1465
|
+
value: function set(date, _flags, value, options) {
|
|
1466
|
+
date = setUTCDay(date, value, options);
|
|
1467
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1468
|
+
return date;
|
|
1469
|
+
}
|
|
1470
|
+
}]);
|
|
1471
|
+
return LocalDayParser;
|
|
1472
|
+
}(Parser);
|
|
1473
|
+
|
|
1474
|
+
var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser) {
|
|
1475
|
+
_inherits(StandAloneLocalDayParser, _Parser);
|
|
1476
|
+
var _super = _createSuper(StandAloneLocalDayParser);
|
|
1477
|
+
function StandAloneLocalDayParser() {
|
|
1478
|
+
var _this;
|
|
1479
|
+
_classCallCheck(this, StandAloneLocalDayParser);
|
|
1480
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1481
|
+
args[_key] = arguments[_key];
|
|
1482
|
+
}
|
|
1483
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1484
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 90);
|
|
1485
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']);
|
|
1486
|
+
return _this;
|
|
1487
|
+
}
|
|
1488
|
+
_createClass(StandAloneLocalDayParser, [{
|
|
1489
|
+
key: "parse",
|
|
1490
|
+
value: function parse(dateString, token, match, options) {
|
|
1491
|
+
var valueCallback = function valueCallback(value) {
|
|
1492
|
+
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
1493
|
+
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
1494
|
+
};
|
|
1495
|
+
switch (token) {
|
|
1496
|
+
// 3
|
|
1497
|
+
case 'c':
|
|
1498
|
+
case 'cc':
|
|
1499
|
+
// 03
|
|
1500
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
1501
|
+
// 3rd
|
|
1502
|
+
case 'co':
|
|
1503
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
1504
|
+
unit: 'day'
|
|
1505
|
+
}), valueCallback);
|
|
1506
|
+
// Tue
|
|
1507
|
+
case 'ccc':
|
|
1508
|
+
return match.day(dateString, {
|
|
1509
|
+
width: 'abbreviated',
|
|
1510
|
+
context: 'standalone'
|
|
1511
|
+
}) || match.day(dateString, {
|
|
1512
|
+
width: 'short',
|
|
1513
|
+
context: 'standalone'
|
|
1514
|
+
}) || match.day(dateString, {
|
|
1515
|
+
width: 'narrow',
|
|
1516
|
+
context: 'standalone'
|
|
1517
|
+
});
|
|
1518
|
+
// T
|
|
1519
|
+
case 'ccccc':
|
|
1520
|
+
return match.day(dateString, {
|
|
1521
|
+
width: 'narrow',
|
|
1522
|
+
context: 'standalone'
|
|
1523
|
+
});
|
|
1524
|
+
// Tu
|
|
1525
|
+
case 'cccccc':
|
|
1526
|
+
return match.day(dateString, {
|
|
1527
|
+
width: 'short',
|
|
1528
|
+
context: 'standalone'
|
|
1529
|
+
}) || match.day(dateString, {
|
|
1530
|
+
width: 'narrow',
|
|
1531
|
+
context: 'standalone'
|
|
1532
|
+
});
|
|
1533
|
+
// Tuesday
|
|
1534
|
+
case 'cccc':
|
|
1535
|
+
default:
|
|
1536
|
+
return match.day(dateString, {
|
|
1537
|
+
width: 'wide',
|
|
1538
|
+
context: 'standalone'
|
|
1539
|
+
}) || match.day(dateString, {
|
|
1540
|
+
width: 'abbreviated',
|
|
1541
|
+
context: 'standalone'
|
|
1542
|
+
}) || match.day(dateString, {
|
|
1543
|
+
width: 'short',
|
|
1544
|
+
context: 'standalone'
|
|
1545
|
+
}) || match.day(dateString, {
|
|
1546
|
+
width: 'narrow',
|
|
1547
|
+
context: 'standalone'
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}, {
|
|
1552
|
+
key: "validate",
|
|
1553
|
+
value: function validate(_date, value) {
|
|
1554
|
+
return value >= 0 && value <= 6;
|
|
1555
|
+
}
|
|
1556
|
+
}, {
|
|
1557
|
+
key: "set",
|
|
1558
|
+
value: function set(date, _flags, value, options) {
|
|
1559
|
+
date = setUTCDay(date, value, options);
|
|
1560
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1561
|
+
return date;
|
|
1562
|
+
}
|
|
1563
|
+
}]);
|
|
1564
|
+
return StandAloneLocalDayParser;
|
|
1565
|
+
}(Parser);
|
|
1566
|
+
|
|
1567
|
+
function setUTCISODay(dirtyDate, dirtyDay) {
|
|
1568
|
+
index.requiredArgs(2, arguments);
|
|
1569
|
+
var day = index.toInteger(dirtyDay);
|
|
1570
|
+
if (day % 7 === 0) {
|
|
1571
|
+
day = day - 7;
|
|
1572
|
+
}
|
|
1573
|
+
var weekStartsOn = 1;
|
|
1574
|
+
var date = index.toDate(dirtyDate);
|
|
1575
|
+
var currentDay = date.getUTCDay();
|
|
1576
|
+
var remainder = day % 7;
|
|
1577
|
+
var dayIndex = (remainder + 7) % 7;
|
|
1578
|
+
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
|
|
1579
|
+
date.setUTCDate(date.getUTCDate() + diff);
|
|
1580
|
+
return date;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
var ISODayParser = /*#__PURE__*/function (_Parser) {
|
|
1584
|
+
_inherits(ISODayParser, _Parser);
|
|
1585
|
+
var _super = _createSuper(ISODayParser);
|
|
1586
|
+
function ISODayParser() {
|
|
1587
|
+
var _this;
|
|
1588
|
+
_classCallCheck(this, ISODayParser);
|
|
1589
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1590
|
+
args[_key] = arguments[_key];
|
|
1591
|
+
}
|
|
1592
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1593
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 90);
|
|
1594
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']);
|
|
1595
|
+
return _this;
|
|
1596
|
+
}
|
|
1597
|
+
_createClass(ISODayParser, [{
|
|
1598
|
+
key: "parse",
|
|
1599
|
+
value: function parse(dateString, token, match) {
|
|
1600
|
+
var valueCallback = function valueCallback(value) {
|
|
1601
|
+
if (value === 0) {
|
|
1602
|
+
return 7;
|
|
1603
|
+
}
|
|
1604
|
+
return value;
|
|
1605
|
+
};
|
|
1606
|
+
switch (token) {
|
|
1607
|
+
// 2
|
|
1608
|
+
case 'i':
|
|
1609
|
+
case 'ii':
|
|
1610
|
+
// 02
|
|
1611
|
+
return parseNDigits(token.length, dateString);
|
|
1612
|
+
// 2nd
|
|
1613
|
+
case 'io':
|
|
1614
|
+
return match.ordinalNumber(dateString, {
|
|
1615
|
+
unit: 'day'
|
|
1616
|
+
});
|
|
1617
|
+
// Tue
|
|
1618
|
+
case 'iii':
|
|
1619
|
+
return mapValue(match.day(dateString, {
|
|
1620
|
+
width: 'abbreviated',
|
|
1621
|
+
context: 'formatting'
|
|
1622
|
+
}) || match.day(dateString, {
|
|
1623
|
+
width: 'short',
|
|
1624
|
+
context: 'formatting'
|
|
1625
|
+
}) || match.day(dateString, {
|
|
1626
|
+
width: 'narrow',
|
|
1627
|
+
context: 'formatting'
|
|
1628
|
+
}), valueCallback);
|
|
1629
|
+
// T
|
|
1630
|
+
case 'iiiii':
|
|
1631
|
+
return mapValue(match.day(dateString, {
|
|
1632
|
+
width: 'narrow',
|
|
1633
|
+
context: 'formatting'
|
|
1634
|
+
}), valueCallback);
|
|
1635
|
+
// Tu
|
|
1636
|
+
case 'iiiiii':
|
|
1637
|
+
return mapValue(match.day(dateString, {
|
|
1638
|
+
width: 'short',
|
|
1639
|
+
context: 'formatting'
|
|
1640
|
+
}) || match.day(dateString, {
|
|
1641
|
+
width: 'narrow',
|
|
1642
|
+
context: 'formatting'
|
|
1643
|
+
}), valueCallback);
|
|
1644
|
+
// Tuesday
|
|
1645
|
+
case 'iiii':
|
|
1646
|
+
default:
|
|
1647
|
+
return mapValue(match.day(dateString, {
|
|
1648
|
+
width: 'wide',
|
|
1649
|
+
context: 'formatting'
|
|
1650
|
+
}) || match.day(dateString, {
|
|
1651
|
+
width: 'abbreviated',
|
|
1652
|
+
context: 'formatting'
|
|
1653
|
+
}) || match.day(dateString, {
|
|
1654
|
+
width: 'short',
|
|
1655
|
+
context: 'formatting'
|
|
1656
|
+
}) || match.day(dateString, {
|
|
1657
|
+
width: 'narrow',
|
|
1658
|
+
context: 'formatting'
|
|
1659
|
+
}), valueCallback);
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
}, {
|
|
1663
|
+
key: "validate",
|
|
1664
|
+
value: function validate(_date, value) {
|
|
1665
|
+
return value >= 1 && value <= 7;
|
|
1666
|
+
}
|
|
1667
|
+
}, {
|
|
1668
|
+
key: "set",
|
|
1669
|
+
value: function set(date, _flags, value) {
|
|
1670
|
+
date = setUTCISODay(date, value);
|
|
1671
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1672
|
+
return date;
|
|
1673
|
+
}
|
|
1674
|
+
}]);
|
|
1675
|
+
return ISODayParser;
|
|
1676
|
+
}(Parser);
|
|
1677
|
+
|
|
1678
|
+
var AMPMParser = /*#__PURE__*/function (_Parser) {
|
|
1679
|
+
_inherits(AMPMParser, _Parser);
|
|
1680
|
+
var _super = _createSuper(AMPMParser);
|
|
1681
|
+
function AMPMParser() {
|
|
1682
|
+
var _this;
|
|
1683
|
+
_classCallCheck(this, AMPMParser);
|
|
1684
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1685
|
+
args[_key] = arguments[_key];
|
|
1686
|
+
}
|
|
1687
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1688
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 80);
|
|
1689
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['b', 'B', 'H', 'k', 't', 'T']);
|
|
1690
|
+
return _this;
|
|
1691
|
+
}
|
|
1692
|
+
_createClass(AMPMParser, [{
|
|
1693
|
+
key: "parse",
|
|
1694
|
+
value: function parse(dateString, token, match) {
|
|
1695
|
+
switch (token) {
|
|
1696
|
+
case 'a':
|
|
1697
|
+
case 'aa':
|
|
1698
|
+
case 'aaa':
|
|
1699
|
+
return match.dayPeriod(dateString, {
|
|
1700
|
+
width: 'abbreviated',
|
|
1701
|
+
context: 'formatting'
|
|
1702
|
+
}) || match.dayPeriod(dateString, {
|
|
1703
|
+
width: 'narrow',
|
|
1704
|
+
context: 'formatting'
|
|
1705
|
+
});
|
|
1706
|
+
case 'aaaaa':
|
|
1707
|
+
return match.dayPeriod(dateString, {
|
|
1708
|
+
width: 'narrow',
|
|
1709
|
+
context: 'formatting'
|
|
1710
|
+
});
|
|
1711
|
+
case 'aaaa':
|
|
1712
|
+
default:
|
|
1713
|
+
return match.dayPeriod(dateString, {
|
|
1714
|
+
width: 'wide',
|
|
1715
|
+
context: 'formatting'
|
|
1716
|
+
}) || match.dayPeriod(dateString, {
|
|
1717
|
+
width: 'abbreviated',
|
|
1718
|
+
context: 'formatting'
|
|
1719
|
+
}) || match.dayPeriod(dateString, {
|
|
1720
|
+
width: 'narrow',
|
|
1721
|
+
context: 'formatting'
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
}, {
|
|
1726
|
+
key: "set",
|
|
1727
|
+
value: function set(date, _flags, value) {
|
|
1728
|
+
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
1729
|
+
return date;
|
|
1730
|
+
}
|
|
1731
|
+
}]);
|
|
1732
|
+
return AMPMParser;
|
|
1733
|
+
}(Parser);
|
|
1734
|
+
|
|
1735
|
+
var AMPMMidnightParser = /*#__PURE__*/function (_Parser) {
|
|
1736
|
+
_inherits(AMPMMidnightParser, _Parser);
|
|
1737
|
+
var _super = _createSuper(AMPMMidnightParser);
|
|
1738
|
+
function AMPMMidnightParser() {
|
|
1739
|
+
var _this;
|
|
1740
|
+
_classCallCheck(this, AMPMMidnightParser);
|
|
1741
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1742
|
+
args[_key] = arguments[_key];
|
|
1743
|
+
}
|
|
1744
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1745
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 80);
|
|
1746
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']);
|
|
1747
|
+
return _this;
|
|
1748
|
+
}
|
|
1749
|
+
_createClass(AMPMMidnightParser, [{
|
|
1750
|
+
key: "parse",
|
|
1751
|
+
value: function parse(dateString, token, match) {
|
|
1752
|
+
switch (token) {
|
|
1753
|
+
case 'b':
|
|
1754
|
+
case 'bb':
|
|
1755
|
+
case 'bbb':
|
|
1756
|
+
return match.dayPeriod(dateString, {
|
|
1757
|
+
width: 'abbreviated',
|
|
1758
|
+
context: 'formatting'
|
|
1759
|
+
}) || match.dayPeriod(dateString, {
|
|
1760
|
+
width: 'narrow',
|
|
1761
|
+
context: 'formatting'
|
|
1762
|
+
});
|
|
1763
|
+
case 'bbbbb':
|
|
1764
|
+
return match.dayPeriod(dateString, {
|
|
1765
|
+
width: 'narrow',
|
|
1766
|
+
context: 'formatting'
|
|
1767
|
+
});
|
|
1768
|
+
case 'bbbb':
|
|
1769
|
+
default:
|
|
1770
|
+
return match.dayPeriod(dateString, {
|
|
1771
|
+
width: 'wide',
|
|
1772
|
+
context: 'formatting'
|
|
1773
|
+
}) || match.dayPeriod(dateString, {
|
|
1774
|
+
width: 'abbreviated',
|
|
1775
|
+
context: 'formatting'
|
|
1776
|
+
}) || match.dayPeriod(dateString, {
|
|
1777
|
+
width: 'narrow',
|
|
1778
|
+
context: 'formatting'
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
}, {
|
|
1783
|
+
key: "set",
|
|
1784
|
+
value: function set(date, _flags, value) {
|
|
1785
|
+
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
1786
|
+
return date;
|
|
1787
|
+
}
|
|
1788
|
+
}]);
|
|
1789
|
+
return AMPMMidnightParser;
|
|
1790
|
+
}(Parser);
|
|
1791
|
+
|
|
1792
|
+
var DayPeriodParser = /*#__PURE__*/function (_Parser) {
|
|
1793
|
+
_inherits(DayPeriodParser, _Parser);
|
|
1794
|
+
var _super = _createSuper(DayPeriodParser);
|
|
1795
|
+
function DayPeriodParser() {
|
|
1796
|
+
var _this;
|
|
1797
|
+
_classCallCheck(this, DayPeriodParser);
|
|
1798
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1799
|
+
args[_key] = arguments[_key];
|
|
1800
|
+
}
|
|
1801
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1802
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 80);
|
|
1803
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 't', 'T']);
|
|
1804
|
+
return _this;
|
|
1805
|
+
}
|
|
1806
|
+
_createClass(DayPeriodParser, [{
|
|
1807
|
+
key: "parse",
|
|
1808
|
+
value: function parse(dateString, token, match) {
|
|
1809
|
+
switch (token) {
|
|
1810
|
+
case 'B':
|
|
1811
|
+
case 'BB':
|
|
1812
|
+
case 'BBB':
|
|
1813
|
+
return match.dayPeriod(dateString, {
|
|
1814
|
+
width: 'abbreviated',
|
|
1815
|
+
context: 'formatting'
|
|
1816
|
+
}) || match.dayPeriod(dateString, {
|
|
1817
|
+
width: 'narrow',
|
|
1818
|
+
context: 'formatting'
|
|
1819
|
+
});
|
|
1820
|
+
case 'BBBBB':
|
|
1821
|
+
return match.dayPeriod(dateString, {
|
|
1822
|
+
width: 'narrow',
|
|
1823
|
+
context: 'formatting'
|
|
1824
|
+
});
|
|
1825
|
+
case 'BBBB':
|
|
1826
|
+
default:
|
|
1827
|
+
return match.dayPeriod(dateString, {
|
|
1828
|
+
width: 'wide',
|
|
1829
|
+
context: 'formatting'
|
|
1830
|
+
}) || match.dayPeriod(dateString, {
|
|
1831
|
+
width: 'abbreviated',
|
|
1832
|
+
context: 'formatting'
|
|
1833
|
+
}) || match.dayPeriod(dateString, {
|
|
1834
|
+
width: 'narrow',
|
|
1835
|
+
context: 'formatting'
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
}, {
|
|
1840
|
+
key: "set",
|
|
1841
|
+
value: function set(date, _flags, value) {
|
|
1842
|
+
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
1843
|
+
return date;
|
|
1844
|
+
}
|
|
1845
|
+
}]);
|
|
1846
|
+
return DayPeriodParser;
|
|
1847
|
+
}(Parser);
|
|
1848
|
+
|
|
1849
|
+
var Hour1to12Parser = /*#__PURE__*/function (_Parser) {
|
|
1850
|
+
_inherits(Hour1to12Parser, _Parser);
|
|
1851
|
+
var _super = _createSuper(Hour1to12Parser);
|
|
1852
|
+
function Hour1to12Parser() {
|
|
1853
|
+
var _this;
|
|
1854
|
+
_classCallCheck(this, Hour1to12Parser);
|
|
1855
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1856
|
+
args[_key] = arguments[_key];
|
|
1857
|
+
}
|
|
1858
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1859
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 70);
|
|
1860
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['H', 'K', 'k', 't', 'T']);
|
|
1861
|
+
return _this;
|
|
1862
|
+
}
|
|
1863
|
+
_createClass(Hour1to12Parser, [{
|
|
1864
|
+
key: "parse",
|
|
1865
|
+
value: function parse(dateString, token, match) {
|
|
1866
|
+
switch (token) {
|
|
1867
|
+
case 'h':
|
|
1868
|
+
return parseNumericPattern(numericPatterns.hour12h, dateString);
|
|
1869
|
+
case 'ho':
|
|
1870
|
+
return match.ordinalNumber(dateString, {
|
|
1871
|
+
unit: 'hour'
|
|
1872
|
+
});
|
|
1873
|
+
default:
|
|
1874
|
+
return parseNDigits(token.length, dateString);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
}, {
|
|
1878
|
+
key: "validate",
|
|
1879
|
+
value: function validate(_date, value) {
|
|
1880
|
+
return value >= 1 && value <= 12;
|
|
1881
|
+
}
|
|
1882
|
+
}, {
|
|
1883
|
+
key: "set",
|
|
1884
|
+
value: function set(date, _flags, value) {
|
|
1885
|
+
var isPM = date.getUTCHours() >= 12;
|
|
1886
|
+
if (isPM && value < 12) {
|
|
1887
|
+
date.setUTCHours(value + 12, 0, 0, 0);
|
|
1888
|
+
} else if (!isPM && value === 12) {
|
|
1889
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1890
|
+
} else {
|
|
1891
|
+
date.setUTCHours(value, 0, 0, 0);
|
|
1892
|
+
}
|
|
1893
|
+
return date;
|
|
1894
|
+
}
|
|
1895
|
+
}]);
|
|
1896
|
+
return Hour1to12Parser;
|
|
1897
|
+
}(Parser);
|
|
1898
|
+
|
|
1899
|
+
var Hour0to23Parser = /*#__PURE__*/function (_Parser) {
|
|
1900
|
+
_inherits(Hour0to23Parser, _Parser);
|
|
1901
|
+
var _super = _createSuper(Hour0to23Parser);
|
|
1902
|
+
function Hour0to23Parser() {
|
|
1903
|
+
var _this;
|
|
1904
|
+
_classCallCheck(this, Hour0to23Parser);
|
|
1905
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1906
|
+
args[_key] = arguments[_key];
|
|
1907
|
+
}
|
|
1908
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1909
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 70);
|
|
1910
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 'h', 'K', 'k', 't', 'T']);
|
|
1911
|
+
return _this;
|
|
1912
|
+
}
|
|
1913
|
+
_createClass(Hour0to23Parser, [{
|
|
1914
|
+
key: "parse",
|
|
1915
|
+
value: function parse(dateString, token, match) {
|
|
1916
|
+
switch (token) {
|
|
1917
|
+
case 'H':
|
|
1918
|
+
return parseNumericPattern(numericPatterns.hour23h, dateString);
|
|
1919
|
+
case 'Ho':
|
|
1920
|
+
return match.ordinalNumber(dateString, {
|
|
1921
|
+
unit: 'hour'
|
|
1922
|
+
});
|
|
1923
|
+
default:
|
|
1924
|
+
return parseNDigits(token.length, dateString);
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
}, {
|
|
1928
|
+
key: "validate",
|
|
1929
|
+
value: function validate(_date, value) {
|
|
1930
|
+
return value >= 0 && value <= 23;
|
|
1931
|
+
}
|
|
1932
|
+
}, {
|
|
1933
|
+
key: "set",
|
|
1934
|
+
value: function set(date, _flags, value) {
|
|
1935
|
+
date.setUTCHours(value, 0, 0, 0);
|
|
1936
|
+
return date;
|
|
1937
|
+
}
|
|
1938
|
+
}]);
|
|
1939
|
+
return Hour0to23Parser;
|
|
1940
|
+
}(Parser);
|
|
1941
|
+
|
|
1942
|
+
var Hour0To11Parser = /*#__PURE__*/function (_Parser) {
|
|
1943
|
+
_inherits(Hour0To11Parser, _Parser);
|
|
1944
|
+
var _super = _createSuper(Hour0To11Parser);
|
|
1945
|
+
function Hour0To11Parser() {
|
|
1946
|
+
var _this;
|
|
1947
|
+
_classCallCheck(this, Hour0To11Parser);
|
|
1948
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1949
|
+
args[_key] = arguments[_key];
|
|
1950
|
+
}
|
|
1951
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1952
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 70);
|
|
1953
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['h', 'H', 'k', 't', 'T']);
|
|
1954
|
+
return _this;
|
|
1955
|
+
}
|
|
1956
|
+
_createClass(Hour0To11Parser, [{
|
|
1957
|
+
key: "parse",
|
|
1958
|
+
value: function parse(dateString, token, match) {
|
|
1959
|
+
switch (token) {
|
|
1960
|
+
case 'K':
|
|
1961
|
+
return parseNumericPattern(numericPatterns.hour11h, dateString);
|
|
1962
|
+
case 'Ko':
|
|
1963
|
+
return match.ordinalNumber(dateString, {
|
|
1964
|
+
unit: 'hour'
|
|
1965
|
+
});
|
|
1966
|
+
default:
|
|
1967
|
+
return parseNDigits(token.length, dateString);
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
}, {
|
|
1971
|
+
key: "validate",
|
|
1972
|
+
value: function validate(_date, value) {
|
|
1973
|
+
return value >= 0 && value <= 11;
|
|
1974
|
+
}
|
|
1975
|
+
}, {
|
|
1976
|
+
key: "set",
|
|
1977
|
+
value: function set(date, _flags, value) {
|
|
1978
|
+
var isPM = date.getUTCHours() >= 12;
|
|
1979
|
+
if (isPM && value < 12) {
|
|
1980
|
+
date.setUTCHours(value + 12, 0, 0, 0);
|
|
1981
|
+
} else {
|
|
1982
|
+
date.setUTCHours(value, 0, 0, 0);
|
|
1983
|
+
}
|
|
1984
|
+
return date;
|
|
1985
|
+
}
|
|
1986
|
+
}]);
|
|
1987
|
+
return Hour0To11Parser;
|
|
1988
|
+
}(Parser);
|
|
1989
|
+
|
|
1990
|
+
var Hour1To24Parser = /*#__PURE__*/function (_Parser) {
|
|
1991
|
+
_inherits(Hour1To24Parser, _Parser);
|
|
1992
|
+
var _super = _createSuper(Hour1To24Parser);
|
|
1993
|
+
function Hour1To24Parser() {
|
|
1994
|
+
var _this;
|
|
1995
|
+
_classCallCheck(this, Hour1To24Parser);
|
|
1996
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1997
|
+
args[_key] = arguments[_key];
|
|
1998
|
+
}
|
|
1999
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2000
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 70);
|
|
2001
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 'h', 'H', 'K', 't', 'T']);
|
|
2002
|
+
return _this;
|
|
2003
|
+
}
|
|
2004
|
+
_createClass(Hour1To24Parser, [{
|
|
2005
|
+
key: "parse",
|
|
2006
|
+
value: function parse(dateString, token, match) {
|
|
2007
|
+
switch (token) {
|
|
2008
|
+
case 'k':
|
|
2009
|
+
return parseNumericPattern(numericPatterns.hour24h, dateString);
|
|
2010
|
+
case 'ko':
|
|
2011
|
+
return match.ordinalNumber(dateString, {
|
|
2012
|
+
unit: 'hour'
|
|
2013
|
+
});
|
|
2014
|
+
default:
|
|
2015
|
+
return parseNDigits(token.length, dateString);
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
}, {
|
|
2019
|
+
key: "validate",
|
|
2020
|
+
value: function validate(_date, value) {
|
|
2021
|
+
return value >= 1 && value <= 24;
|
|
2022
|
+
}
|
|
2023
|
+
}, {
|
|
2024
|
+
key: "set",
|
|
2025
|
+
value: function set(date, _flags, value) {
|
|
2026
|
+
var hours = value <= 24 ? value % 24 : value;
|
|
2027
|
+
date.setUTCHours(hours, 0, 0, 0);
|
|
2028
|
+
return date;
|
|
2029
|
+
}
|
|
2030
|
+
}]);
|
|
2031
|
+
return Hour1To24Parser;
|
|
2032
|
+
}(Parser);
|
|
2033
|
+
|
|
2034
|
+
var MinuteParser = /*#__PURE__*/function (_Parser) {
|
|
2035
|
+
_inherits(MinuteParser, _Parser);
|
|
2036
|
+
var _super = _createSuper(MinuteParser);
|
|
2037
|
+
function MinuteParser() {
|
|
2038
|
+
var _this;
|
|
2039
|
+
_classCallCheck(this, MinuteParser);
|
|
2040
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2041
|
+
args[_key] = arguments[_key];
|
|
2042
|
+
}
|
|
2043
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2044
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 60);
|
|
2045
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']);
|
|
2046
|
+
return _this;
|
|
2047
|
+
}
|
|
2048
|
+
_createClass(MinuteParser, [{
|
|
2049
|
+
key: "parse",
|
|
2050
|
+
value: function parse(dateString, token, match) {
|
|
2051
|
+
switch (token) {
|
|
2052
|
+
case 'm':
|
|
2053
|
+
return parseNumericPattern(numericPatterns.minute, dateString);
|
|
2054
|
+
case 'mo':
|
|
2055
|
+
return match.ordinalNumber(dateString, {
|
|
2056
|
+
unit: 'minute'
|
|
2057
|
+
});
|
|
2058
|
+
default:
|
|
2059
|
+
return parseNDigits(token.length, dateString);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
}, {
|
|
2063
|
+
key: "validate",
|
|
2064
|
+
value: function validate(_date, value) {
|
|
2065
|
+
return value >= 0 && value <= 59;
|
|
2066
|
+
}
|
|
2067
|
+
}, {
|
|
2068
|
+
key: "set",
|
|
2069
|
+
value: function set(date, _flags, value) {
|
|
2070
|
+
date.setUTCMinutes(value, 0, 0);
|
|
2071
|
+
return date;
|
|
2072
|
+
}
|
|
2073
|
+
}]);
|
|
2074
|
+
return MinuteParser;
|
|
2075
|
+
}(Parser);
|
|
2076
|
+
|
|
2077
|
+
var SecondParser = /*#__PURE__*/function (_Parser) {
|
|
2078
|
+
_inherits(SecondParser, _Parser);
|
|
2079
|
+
var _super = _createSuper(SecondParser);
|
|
2080
|
+
function SecondParser() {
|
|
2081
|
+
var _this;
|
|
2082
|
+
_classCallCheck(this, SecondParser);
|
|
2083
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2084
|
+
args[_key] = arguments[_key];
|
|
2085
|
+
}
|
|
2086
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2087
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 50);
|
|
2088
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']);
|
|
2089
|
+
return _this;
|
|
2090
|
+
}
|
|
2091
|
+
_createClass(SecondParser, [{
|
|
2092
|
+
key: "parse",
|
|
2093
|
+
value: function parse(dateString, token, match) {
|
|
2094
|
+
switch (token) {
|
|
2095
|
+
case 's':
|
|
2096
|
+
return parseNumericPattern(numericPatterns.second, dateString);
|
|
2097
|
+
case 'so':
|
|
2098
|
+
return match.ordinalNumber(dateString, {
|
|
2099
|
+
unit: 'second'
|
|
2100
|
+
});
|
|
2101
|
+
default:
|
|
2102
|
+
return parseNDigits(token.length, dateString);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
}, {
|
|
2106
|
+
key: "validate",
|
|
2107
|
+
value: function validate(_date, value) {
|
|
2108
|
+
return value >= 0 && value <= 59;
|
|
2109
|
+
}
|
|
2110
|
+
}, {
|
|
2111
|
+
key: "set",
|
|
2112
|
+
value: function set(date, _flags, value) {
|
|
2113
|
+
date.setUTCSeconds(value, 0);
|
|
2114
|
+
return date;
|
|
2115
|
+
}
|
|
2116
|
+
}]);
|
|
2117
|
+
return SecondParser;
|
|
2118
|
+
}(Parser);
|
|
2119
|
+
|
|
2120
|
+
var FractionOfSecondParser = /*#__PURE__*/function (_Parser) {
|
|
2121
|
+
_inherits(FractionOfSecondParser, _Parser);
|
|
2122
|
+
var _super = _createSuper(FractionOfSecondParser);
|
|
2123
|
+
function FractionOfSecondParser() {
|
|
2124
|
+
var _this;
|
|
2125
|
+
_classCallCheck(this, FractionOfSecondParser);
|
|
2126
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2127
|
+
args[_key] = arguments[_key];
|
|
2128
|
+
}
|
|
2129
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2130
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 30);
|
|
2131
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']);
|
|
2132
|
+
return _this;
|
|
2133
|
+
}
|
|
2134
|
+
_createClass(FractionOfSecondParser, [{
|
|
2135
|
+
key: "parse",
|
|
2136
|
+
value: function parse(dateString, token) {
|
|
2137
|
+
var valueCallback = function valueCallback(value) {
|
|
2138
|
+
return Math.floor(value * Math.pow(10, -token.length + 3));
|
|
2139
|
+
};
|
|
2140
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
2141
|
+
}
|
|
2142
|
+
}, {
|
|
2143
|
+
key: "set",
|
|
2144
|
+
value: function set(date, _flags, value) {
|
|
2145
|
+
date.setUTCMilliseconds(value);
|
|
2146
|
+
return date;
|
|
2147
|
+
}
|
|
2148
|
+
}]);
|
|
2149
|
+
return FractionOfSecondParser;
|
|
2150
|
+
}(Parser);
|
|
2151
|
+
|
|
2152
|
+
var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser) {
|
|
2153
|
+
_inherits(ISOTimezoneWithZParser, _Parser);
|
|
2154
|
+
var _super = _createSuper(ISOTimezoneWithZParser);
|
|
2155
|
+
function ISOTimezoneWithZParser() {
|
|
2156
|
+
var _this;
|
|
2157
|
+
_classCallCheck(this, ISOTimezoneWithZParser);
|
|
2158
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2159
|
+
args[_key] = arguments[_key];
|
|
2160
|
+
}
|
|
2161
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2162
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 10);
|
|
2163
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T', 'x']);
|
|
2164
|
+
return _this;
|
|
2165
|
+
}
|
|
2166
|
+
_createClass(ISOTimezoneWithZParser, [{
|
|
2167
|
+
key: "parse",
|
|
2168
|
+
value: function parse(dateString, token) {
|
|
2169
|
+
switch (token) {
|
|
2170
|
+
case 'X':
|
|
2171
|
+
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
|
|
2172
|
+
case 'XX':
|
|
2173
|
+
return parseTimezonePattern(timezonePatterns.basic, dateString);
|
|
2174
|
+
case 'XXXX':
|
|
2175
|
+
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
|
|
2176
|
+
case 'XXXXX':
|
|
2177
|
+
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
|
|
2178
|
+
case 'XXX':
|
|
2179
|
+
default:
|
|
2180
|
+
return parseTimezonePattern(timezonePatterns.extended, dateString);
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
}, {
|
|
2184
|
+
key: "set",
|
|
2185
|
+
value: function set(date, flags, value) {
|
|
2186
|
+
if (flags.timestampIsSet) {
|
|
2187
|
+
return date;
|
|
2188
|
+
}
|
|
2189
|
+
return new Date(date.getTime() - value);
|
|
2190
|
+
}
|
|
2191
|
+
}]);
|
|
2192
|
+
return ISOTimezoneWithZParser;
|
|
2193
|
+
}(Parser);
|
|
2194
|
+
|
|
2195
|
+
var ISOTimezoneParser = /*#__PURE__*/function (_Parser) {
|
|
2196
|
+
_inherits(ISOTimezoneParser, _Parser);
|
|
2197
|
+
var _super = _createSuper(ISOTimezoneParser);
|
|
2198
|
+
function ISOTimezoneParser() {
|
|
2199
|
+
var _this;
|
|
2200
|
+
_classCallCheck(this, ISOTimezoneParser);
|
|
2201
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2202
|
+
args[_key] = arguments[_key];
|
|
2203
|
+
}
|
|
2204
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2205
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 10);
|
|
2206
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T', 'X']);
|
|
2207
|
+
return _this;
|
|
2208
|
+
}
|
|
2209
|
+
_createClass(ISOTimezoneParser, [{
|
|
2210
|
+
key: "parse",
|
|
2211
|
+
value: function parse(dateString, token) {
|
|
2212
|
+
switch (token) {
|
|
2213
|
+
case 'x':
|
|
2214
|
+
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
|
|
2215
|
+
case 'xx':
|
|
2216
|
+
return parseTimezonePattern(timezonePatterns.basic, dateString);
|
|
2217
|
+
case 'xxxx':
|
|
2218
|
+
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
|
|
2219
|
+
case 'xxxxx':
|
|
2220
|
+
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
|
|
2221
|
+
case 'xxx':
|
|
2222
|
+
default:
|
|
2223
|
+
return parseTimezonePattern(timezonePatterns.extended, dateString);
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
}, {
|
|
2227
|
+
key: "set",
|
|
2228
|
+
value: function set(date, flags, value) {
|
|
2229
|
+
if (flags.timestampIsSet) {
|
|
2230
|
+
return date;
|
|
2231
|
+
}
|
|
2232
|
+
return new Date(date.getTime() - value);
|
|
2233
|
+
}
|
|
2234
|
+
}]);
|
|
2235
|
+
return ISOTimezoneParser;
|
|
2236
|
+
}(Parser);
|
|
2237
|
+
|
|
2238
|
+
var TimestampSecondsParser = /*#__PURE__*/function (_Parser) {
|
|
2239
|
+
_inherits(TimestampSecondsParser, _Parser);
|
|
2240
|
+
var _super = _createSuper(TimestampSecondsParser);
|
|
2241
|
+
function TimestampSecondsParser() {
|
|
2242
|
+
var _this;
|
|
2243
|
+
_classCallCheck(this, TimestampSecondsParser);
|
|
2244
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2245
|
+
args[_key] = arguments[_key];
|
|
2246
|
+
}
|
|
2247
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2248
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 40);
|
|
2249
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", '*');
|
|
2250
|
+
return _this;
|
|
2251
|
+
}
|
|
2252
|
+
_createClass(TimestampSecondsParser, [{
|
|
2253
|
+
key: "parse",
|
|
2254
|
+
value: function parse(dateString) {
|
|
2255
|
+
return parseAnyDigitsSigned(dateString);
|
|
2256
|
+
}
|
|
2257
|
+
}, {
|
|
2258
|
+
key: "set",
|
|
2259
|
+
value: function set(_date, _flags, value) {
|
|
2260
|
+
return [new Date(value * 1000), {
|
|
2261
|
+
timestampIsSet: true
|
|
2262
|
+
}];
|
|
2263
|
+
}
|
|
2264
|
+
}]);
|
|
2265
|
+
return TimestampSecondsParser;
|
|
2266
|
+
}(Parser);
|
|
2267
|
+
|
|
2268
|
+
var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser) {
|
|
2269
|
+
_inherits(TimestampMillisecondsParser, _Parser);
|
|
2270
|
+
var _super = _createSuper(TimestampMillisecondsParser);
|
|
2271
|
+
function TimestampMillisecondsParser() {
|
|
2272
|
+
var _this;
|
|
2273
|
+
_classCallCheck(this, TimestampMillisecondsParser);
|
|
2274
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2275
|
+
args[_key] = arguments[_key];
|
|
2276
|
+
}
|
|
2277
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2278
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 20);
|
|
2279
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", '*');
|
|
2280
|
+
return _this;
|
|
2281
|
+
}
|
|
2282
|
+
_createClass(TimestampMillisecondsParser, [{
|
|
2283
|
+
key: "parse",
|
|
2284
|
+
value: function parse(dateString) {
|
|
2285
|
+
return parseAnyDigitsSigned(dateString);
|
|
2286
|
+
}
|
|
2287
|
+
}, {
|
|
2288
|
+
key: "set",
|
|
2289
|
+
value: function set(_date, _flags, value) {
|
|
2290
|
+
return [new Date(value), {
|
|
2291
|
+
timestampIsSet: true
|
|
2292
|
+
}];
|
|
2293
|
+
}
|
|
2294
|
+
}]);
|
|
2295
|
+
return TimestampMillisecondsParser;
|
|
2296
|
+
}(Parser);
|
|
2297
|
+
|
|
2298
|
+
/*
|
|
2299
|
+
* | | Unit | | Unit |
|
|
2300
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
2301
|
+
* | a | AM, PM | A* | Milliseconds in day |
|
|
2302
|
+
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
2303
|
+
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
2304
|
+
* | d | Day of month | D | Day of year |
|
|
2305
|
+
* | e | Local day of week | E | Day of week |
|
|
2306
|
+
* | f | | F* | Day of week in month |
|
|
2307
|
+
* | g* | Modified Julian day | G | Era |
|
|
2308
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
2309
|
+
* | i! | ISO day of week | I! | ISO week of year |
|
|
2310
|
+
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
2311
|
+
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
2312
|
+
* | l* | (deprecated) | L | Stand-alone month |
|
|
2313
|
+
* | m | Minute | M | Month |
|
|
2314
|
+
* | n | | N | |
|
|
2315
|
+
* | o! | Ordinal number modifier | O* | Timezone (GMT) |
|
|
2316
|
+
* | p | | P | |
|
|
2317
|
+
* | q | Stand-alone quarter | Q | Quarter |
|
|
2318
|
+
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
2319
|
+
* | s | Second | S | Fraction of second |
|
|
2320
|
+
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
2321
|
+
* | u | Extended year | U* | Cyclic year |
|
|
2322
|
+
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
2323
|
+
* | w | Local week of year | W* | Week of month |
|
|
2324
|
+
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
2325
|
+
* | y | Year (abs) | Y | Local week-numbering year |
|
|
2326
|
+
* | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
2327
|
+
*
|
|
2328
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
2329
|
+
*
|
|
2330
|
+
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
2331
|
+
* - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
|
|
2332
|
+
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
2333
|
+
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
2334
|
+
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
2335
|
+
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
2336
|
+
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
2337
|
+
* for universal ISO week-numbering date, whereas
|
|
2338
|
+
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
2339
|
+
* for week-numbering date specific to the locale.
|
|
2340
|
+
*/
|
|
2341
|
+
var parsers = {
|
|
2342
|
+
G: new EraParser(),
|
|
2343
|
+
y: new YearParser(),
|
|
2344
|
+
Y: new LocalWeekYearParser(),
|
|
2345
|
+
R: new ISOWeekYearParser(),
|
|
2346
|
+
u: new ExtendedYearParser(),
|
|
2347
|
+
Q: new QuarterParser(),
|
|
2348
|
+
q: new StandAloneQuarterParser(),
|
|
2349
|
+
M: new MonthParser(),
|
|
2350
|
+
L: new StandAloneMonthParser(),
|
|
2351
|
+
w: new LocalWeekParser(),
|
|
2352
|
+
I: new ISOWeekParser(),
|
|
2353
|
+
d: new DateParser(),
|
|
2354
|
+
D: new DayOfYearParser(),
|
|
2355
|
+
E: new DayParser(),
|
|
2356
|
+
e: new LocalDayParser(),
|
|
2357
|
+
c: new StandAloneLocalDayParser(),
|
|
2358
|
+
i: new ISODayParser(),
|
|
2359
|
+
a: new AMPMParser(),
|
|
2360
|
+
b: new AMPMMidnightParser(),
|
|
2361
|
+
B: new DayPeriodParser(),
|
|
2362
|
+
h: new Hour1to12Parser(),
|
|
2363
|
+
H: new Hour0to23Parser(),
|
|
2364
|
+
K: new Hour0To11Parser(),
|
|
2365
|
+
k: new Hour1To24Parser(),
|
|
2366
|
+
m: new MinuteParser(),
|
|
2367
|
+
s: new SecondParser(),
|
|
2368
|
+
S: new FractionOfSecondParser(),
|
|
2369
|
+
X: new ISOTimezoneWithZParser(),
|
|
2370
|
+
x: new ISOTimezoneParser(),
|
|
2371
|
+
t: new TimestampSecondsParser(),
|
|
2372
|
+
T: new TimestampMillisecondsParser()
|
|
2373
|
+
};
|
|
2374
|
+
|
|
2375
|
+
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
|
|
2376
|
+
// (one of the certain letters followed by `o`)
|
|
2377
|
+
// - (\w)\1* matches any sequences of the same letter
|
|
2378
|
+
// - '' matches two quote characters in a row
|
|
2379
|
+
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
|
|
2380
|
+
// except a single quote symbol, which ends the sequence.
|
|
2381
|
+
// Two quote characters do not end the sequence.
|
|
2382
|
+
// If there is no matching single quote
|
|
2383
|
+
// then the sequence will continue until the end of the string.
|
|
2384
|
+
// - . matches any single character unmatched by previous parts of the RegExps
|
|
2385
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
2386
|
+
|
|
2387
|
+
// This RegExp catches symbols escaped by quotes, and also
|
|
2388
|
+
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
|
|
2389
|
+
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
2390
|
+
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
2391
|
+
var doubleQuoteRegExp = /''/g;
|
|
2392
|
+
var notWhitespaceRegExp = /\S/;
|
|
2393
|
+
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
2394
|
+
|
|
2395
|
+
/**
|
|
2396
|
+
* @name parse
|
|
2397
|
+
* @category Common Helpers
|
|
2398
|
+
* @summary Parse the date.
|
|
2399
|
+
*
|
|
2400
|
+
* @description
|
|
2401
|
+
* Return the date parsed from string using the given format string.
|
|
2402
|
+
*
|
|
2403
|
+
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
2404
|
+
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2405
|
+
*
|
|
2406
|
+
* The characters in the format string wrapped between two single quotes characters (') are escaped.
|
|
2407
|
+
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
2408
|
+
*
|
|
2409
|
+
* Format of the format string is based on Unicode Technical Standard #35:
|
|
2410
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
2411
|
+
* with a few additions (see note 5 below the table).
|
|
2412
|
+
*
|
|
2413
|
+
* Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
|
|
2414
|
+
* and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
|
|
2415
|
+
*
|
|
2416
|
+
* ```javascript
|
|
2417
|
+
* parse('23 AM', 'HH a', new Date())
|
|
2418
|
+
* //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
|
|
2419
|
+
* ```
|
|
2420
|
+
*
|
|
2421
|
+
* See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
|
|
2422
|
+
*
|
|
2423
|
+
* Accepted format string patterns:
|
|
2424
|
+
* | Unit |Prior| Pattern | Result examples | Notes |
|
|
2425
|
+
* |---------------------------------|-----|---------|-----------------------------------|-------|
|
|
2426
|
+
* | Era | 140 | G..GGG | AD, BC | |
|
|
2427
|
+
* | | | GGGG | Anno Domini, Before Christ | 2 |
|
|
2428
|
+
* | | | GGGGG | A, B | |
|
|
2429
|
+
* | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
|
|
2430
|
+
* | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
2431
|
+
* | | | yy | 44, 01, 00, 17 | 4 |
|
|
2432
|
+
* | | | yyy | 044, 001, 123, 999 | 4 |
|
|
2433
|
+
* | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
|
|
2434
|
+
* | | | yyyyy | ... | 2,4 |
|
|
2435
|
+
* | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
|
|
2436
|
+
* | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
2437
|
+
* | | | YY | 44, 01, 00, 17 | 4,6 |
|
|
2438
|
+
* | | | YYY | 044, 001, 123, 999 | 4 |
|
|
2439
|
+
* | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
|
|
2440
|
+
* | | | YYYYY | ... | 2,4 |
|
|
2441
|
+
* | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
|
|
2442
|
+
* | | | RR | -43, 01, 00, 17 | 4,5 |
|
|
2443
|
+
* | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
|
|
2444
|
+
* | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
|
|
2445
|
+
* | | | RRRRR | ... | 2,4,5 |
|
|
2446
|
+
* | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
|
|
2447
|
+
* | | | uu | -43, 01, 99, -99 | 4 |
|
|
2448
|
+
* | | | uuu | -043, 001, 123, 999, -999 | 4 |
|
|
2449
|
+
* | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
|
|
2450
|
+
* | | | uuuuu | ... | 2,4 |
|
|
2451
|
+
* | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
|
|
2452
|
+
* | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
2453
|
+
* | | | QQ | 01, 02, 03, 04 | |
|
|
2454
|
+
* | | | QQQ | Q1, Q2, Q3, Q4 | |
|
|
2455
|
+
* | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
|
|
2456
|
+
* | | | QQQQQ | 1, 2, 3, 4 | 4 |
|
|
2457
|
+
* | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
|
|
2458
|
+
* | | | qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
2459
|
+
* | | | qq | 01, 02, 03, 04 | |
|
|
2460
|
+
* | | | qqq | Q1, Q2, Q3, Q4 | |
|
|
2461
|
+
* | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
|
|
2462
|
+
* | | | qqqqq | 1, 2, 3, 4 | 3 |
|
|
2463
|
+
* | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
|
|
2464
|
+
* | | | Mo | 1st, 2nd, ..., 12th | 5 |
|
|
2465
|
+
* | | | MM | 01, 02, ..., 12 | |
|
|
2466
|
+
* | | | MMM | Jan, Feb, ..., Dec | |
|
|
2467
|
+
* | | | MMMM | January, February, ..., December | 2 |
|
|
2468
|
+
* | | | MMMMM | J, F, ..., D | |
|
|
2469
|
+
* | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
|
|
2470
|
+
* | | | Lo | 1st, 2nd, ..., 12th | 5 |
|
|
2471
|
+
* | | | LL | 01, 02, ..., 12 | |
|
|
2472
|
+
* | | | LLL | Jan, Feb, ..., Dec | |
|
|
2473
|
+
* | | | LLLL | January, February, ..., December | 2 |
|
|
2474
|
+
* | | | LLLLL | J, F, ..., D | |
|
|
2475
|
+
* | Local week of year | 100 | w | 1, 2, ..., 53 | |
|
|
2476
|
+
* | | | wo | 1st, 2nd, ..., 53th | 5 |
|
|
2477
|
+
* | | | ww | 01, 02, ..., 53 | |
|
|
2478
|
+
* | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
|
|
2479
|
+
* | | | Io | 1st, 2nd, ..., 53th | 5 |
|
|
2480
|
+
* | | | II | 01, 02, ..., 53 | 5 |
|
|
2481
|
+
* | Day of month | 90 | d | 1, 2, ..., 31 | |
|
|
2482
|
+
* | | | do | 1st, 2nd, ..., 31st | 5 |
|
|
2483
|
+
* | | | dd | 01, 02, ..., 31 | |
|
|
2484
|
+
* | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
|
|
2485
|
+
* | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
|
|
2486
|
+
* | | | DD | 01, 02, ..., 365, 366 | 7 |
|
|
2487
|
+
* | | | DDD | 001, 002, ..., 365, 366 | |
|
|
2488
|
+
* | | | DDDD | ... | 2 |
|
|
2489
|
+
* | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
|
2490
|
+
* | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
2491
|
+
* | | | EEEEE | M, T, W, T, F, S, S | |
|
|
2492
|
+
* | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
2493
|
+
* | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
|
|
2494
|
+
* | | | io | 1st, 2nd, ..., 7th | 5 |
|
|
2495
|
+
* | | | ii | 01, 02, ..., 07 | 5 |
|
|
2496
|
+
* | | | iii | Mon, Tue, Wed, ..., Sun | 5 |
|
|
2497
|
+
* | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
|
|
2498
|
+
* | | | iiiii | M, T, W, T, F, S, S | 5 |
|
|
2499
|
+
* | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
|
|
2500
|
+
* | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
|
|
2501
|
+
* | | | eo | 2nd, 3rd, ..., 1st | 5 |
|
|
2502
|
+
* | | | ee | 02, 03, ..., 01 | |
|
|
2503
|
+
* | | | eee | Mon, Tue, Wed, ..., Sun | |
|
|
2504
|
+
* | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
2505
|
+
* | | | eeeee | M, T, W, T, F, S, S | |
|
|
2506
|
+
* | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
2507
|
+
* | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
|
|
2508
|
+
* | | | co | 2nd, 3rd, ..., 1st | 5 |
|
|
2509
|
+
* | | | cc | 02, 03, ..., 01 | |
|
|
2510
|
+
* | | | ccc | Mon, Tue, Wed, ..., Sun | |
|
|
2511
|
+
* | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
2512
|
+
* | | | ccccc | M, T, W, T, F, S, S | |
|
|
2513
|
+
* | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
2514
|
+
* | AM, PM | 80 | a..aaa | AM, PM | |
|
|
2515
|
+
* | | | aaaa | a.m., p.m. | 2 |
|
|
2516
|
+
* | | | aaaaa | a, p | |
|
|
2517
|
+
* | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
|
|
2518
|
+
* | | | bbbb | a.m., p.m., noon, midnight | 2 |
|
|
2519
|
+
* | | | bbbbb | a, p, n, mi | |
|
|
2520
|
+
* | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
|
|
2521
|
+
* | | | BBBB | at night, in the morning, ... | 2 |
|
|
2522
|
+
* | | | BBBBB | at night, in the morning, ... | |
|
|
2523
|
+
* | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
|
|
2524
|
+
* | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
|
|
2525
|
+
* | | | hh | 01, 02, ..., 11, 12 | |
|
|
2526
|
+
* | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
|
|
2527
|
+
* | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
|
|
2528
|
+
* | | | HH | 00, 01, 02, ..., 23 | |
|
|
2529
|
+
* | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
|
|
2530
|
+
* | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
|
|
2531
|
+
* | | | KK | 01, 02, ..., 11, 00 | |
|
|
2532
|
+
* | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
|
|
2533
|
+
* | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
|
|
2534
|
+
* | | | kk | 24, 01, 02, ..., 23 | |
|
|
2535
|
+
* | Minute | 60 | m | 0, 1, ..., 59 | |
|
|
2536
|
+
* | | | mo | 0th, 1st, ..., 59th | 5 |
|
|
2537
|
+
* | | | mm | 00, 01, ..., 59 | |
|
|
2538
|
+
* | Second | 50 | s | 0, 1, ..., 59 | |
|
|
2539
|
+
* | | | so | 0th, 1st, ..., 59th | 5 |
|
|
2540
|
+
* | | | ss | 00, 01, ..., 59 | |
|
|
2541
|
+
* | Seconds timestamp | 40 | t | 512969520 | |
|
|
2542
|
+
* | | | tt | ... | 2 |
|
|
2543
|
+
* | Fraction of second | 30 | S | 0, 1, ..., 9 | |
|
|
2544
|
+
* | | | SS | 00, 01, ..., 99 | |
|
|
2545
|
+
* | | | SSS | 000, 001, ..., 999 | |
|
|
2546
|
+
* | | | SSSS | ... | 2 |
|
|
2547
|
+
* | Milliseconds timestamp | 20 | T | 512969520900 | |
|
|
2548
|
+
* | | | TT | ... | 2 |
|
|
2549
|
+
* | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
|
|
2550
|
+
* | | | XX | -0800, +0530, Z | |
|
|
2551
|
+
* | | | XXX | -08:00, +05:30, Z | |
|
|
2552
|
+
* | | | XXXX | -0800, +0530, Z, +123456 | 2 |
|
|
2553
|
+
* | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
|
|
2554
|
+
* | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
|
|
2555
|
+
* | | | xx | -0800, +0530, +0000 | |
|
|
2556
|
+
* | | | xxx | -08:00, +05:30, +00:00 | 2 |
|
|
2557
|
+
* | | | xxxx | -0800, +0530, +0000, +123456 | |
|
|
2558
|
+
* | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
|
|
2559
|
+
* | Long localized date | NA | P | 05/29/1453 | 5,8 |
|
|
2560
|
+
* | | | PP | May 29, 1453 | |
|
|
2561
|
+
* | | | PPP | May 29th, 1453 | |
|
|
2562
|
+
* | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
|
|
2563
|
+
* | Long localized time | NA | p | 12:00 AM | 5,8 |
|
|
2564
|
+
* | | | pp | 12:00:00 AM | |
|
|
2565
|
+
* | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
|
|
2566
|
+
* | | | PPpp | May 29, 1453, 12:00:00 AM | |
|
|
2567
|
+
* | | | PPPpp | May 29th, 1453 at ... | |
|
|
2568
|
+
* | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
|
|
2569
|
+
* Notes:
|
|
2570
|
+
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
|
|
2571
|
+
* are the same as "stand-alone" units, but are different in some languages.
|
|
2572
|
+
* "Formatting" units are declined according to the rules of the language
|
|
2573
|
+
* in the context of a date. "Stand-alone" units are always nominative singular.
|
|
2574
|
+
* In `format` function, they will produce different result:
|
|
2575
|
+
*
|
|
2576
|
+
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
|
|
2577
|
+
*
|
|
2578
|
+
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
|
|
2579
|
+
*
|
|
2580
|
+
* `parse` will try to match both formatting and stand-alone units interchangably.
|
|
2581
|
+
*
|
|
2582
|
+
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
|
|
2583
|
+
* the single quote characters (see below).
|
|
2584
|
+
* If the sequence is longer than listed in table:
|
|
2585
|
+
* - for numerical units (`yyyyyyyy`) `parse` will try to match a number
|
|
2586
|
+
* as wide as the sequence
|
|
2587
|
+
* - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
|
|
2588
|
+
* These variations are marked with "2" in the last column of the table.
|
|
2589
|
+
*
|
|
2590
|
+
* 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
|
|
2591
|
+
* These tokens represent the shortest form of the quarter.
|
|
2592
|
+
*
|
|
2593
|
+
* 4. The main difference between `y` and `u` patterns are B.C. years:
|
|
2594
|
+
*
|
|
2595
|
+
* | Year | `y` | `u` |
|
|
2596
|
+
* |------|-----|-----|
|
|
2597
|
+
* | AC 1 | 1 | 1 |
|
|
2598
|
+
* | BC 1 | 1 | 0 |
|
|
2599
|
+
* | BC 2 | 2 | -1 |
|
|
2600
|
+
*
|
|
2601
|
+
* Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
|
|
2602
|
+
*
|
|
2603
|
+
* `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
|
|
2604
|
+
*
|
|
2605
|
+
* `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
|
|
2606
|
+
*
|
|
2607
|
+
* while `uu` will just assign the year as is:
|
|
2608
|
+
*
|
|
2609
|
+
* `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
|
|
2610
|
+
*
|
|
2611
|
+
* `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
|
|
2612
|
+
*
|
|
2613
|
+
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
|
|
2614
|
+
* except local week-numbering years are dependent on `options.weekStartsOn`
|
|
2615
|
+
* and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}
|
|
2616
|
+
* and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).
|
|
2617
|
+
*
|
|
2618
|
+
* 5. These patterns are not in the Unicode Technical Standard #35:
|
|
2619
|
+
* - `i`: ISO day of week
|
|
2620
|
+
* - `I`: ISO week of year
|
|
2621
|
+
* - `R`: ISO week-numbering year
|
|
2622
|
+
* - `o`: ordinal number modifier
|
|
2623
|
+
* - `P`: long localized date
|
|
2624
|
+
* - `p`: long localized time
|
|
2625
|
+
*
|
|
2626
|
+
* 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
2627
|
+
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2628
|
+
*
|
|
2629
|
+
* 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
|
|
2630
|
+
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2631
|
+
*
|
|
2632
|
+
* 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
|
|
2633
|
+
* on the given locale.
|
|
2634
|
+
*
|
|
2635
|
+
* using `en-US` locale: `P` => `MM/dd/yyyy`
|
|
2636
|
+
* using `en-US` locale: `p` => `hh:mm a`
|
|
2637
|
+
* using `pt-BR` locale: `P` => `dd/MM/yyyy`
|
|
2638
|
+
* using `pt-BR` locale: `p` => `HH:mm`
|
|
2639
|
+
*
|
|
2640
|
+
* Values will be assigned to the date in the descending order of its unit's priority.
|
|
2641
|
+
* Units of an equal priority overwrite each other in the order of appearance.
|
|
2642
|
+
*
|
|
2643
|
+
* If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
|
|
2644
|
+
* the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
|
|
2645
|
+
*
|
|
2646
|
+
* `referenceDate` must be passed for correct work of the function.
|
|
2647
|
+
* If you're not sure which `referenceDate` to supply, create a new instance of Date:
|
|
2648
|
+
* `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
|
|
2649
|
+
* In this case parsing will be done in the context of the current date.
|
|
2650
|
+
* If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
|
|
2651
|
+
* then `Invalid Date` will be returned.
|
|
2652
|
+
*
|
|
2653
|
+
* The result may vary by locale.
|
|
2654
|
+
*
|
|
2655
|
+
* If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
|
|
2656
|
+
*
|
|
2657
|
+
* If parsing failed, `Invalid Date` will be returned.
|
|
2658
|
+
* Invalid Date is a Date, whose time value is NaN.
|
|
2659
|
+
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
2660
|
+
*
|
|
2661
|
+
* @param {String} dateString - the string to parse
|
|
2662
|
+
* @param {String} formatString - the string of tokens
|
|
2663
|
+
* @param {Date|Number} referenceDate - defines values missing from the parsed dateString
|
|
2664
|
+
* @param {Object} [options] - an object with options.
|
|
2665
|
+
* @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
|
|
2666
|
+
* @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
|
|
2667
|
+
* @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
|
|
2668
|
+
* @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
|
|
2669
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2670
|
+
* @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
|
|
2671
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2672
|
+
* @returns {Date} the parsed date
|
|
2673
|
+
* @throws {TypeError} 3 arguments required
|
|
2674
|
+
* @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
|
|
2675
|
+
* @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
|
|
2676
|
+
* @throws {RangeError} `options.locale` must contain `match` property
|
|
2677
|
+
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2678
|
+
* @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2679
|
+
* @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2680
|
+
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
2681
|
+
* @throws {RangeError} format string contains an unescaped latin alphabet character
|
|
2682
|
+
*
|
|
2683
|
+
* @example
|
|
2684
|
+
* // Parse 11 February 2014 from middle-endian format:
|
|
2685
|
+
* var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
|
|
2686
|
+
* //=> Tue Feb 11 2014 00:00:00
|
|
2687
|
+
*
|
|
2688
|
+
* @example
|
|
2689
|
+
* // Parse 28th of February in Esperanto locale in the context of 2010 year:
|
|
2690
|
+
* import eo from 'date-fns/locale/eo'
|
|
2691
|
+
* var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
|
|
2692
|
+
* locale: eo
|
|
2693
|
+
* })
|
|
2694
|
+
* //=> Sun Feb 28 2010 00:00:00
|
|
2695
|
+
*/
|
|
2696
|
+
function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, options) {
|
|
2697
|
+
var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
|
|
2698
|
+
index.requiredArgs(3, arguments);
|
|
2699
|
+
var dateString = String(dirtyDateString);
|
|
2700
|
+
var formatString = String(dirtyFormatString);
|
|
2701
|
+
var defaultOptions = index.getDefaultOptions();
|
|
2702
|
+
var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : index.locale;
|
|
2703
|
+
if (!locale.match) {
|
|
2704
|
+
throw new RangeError('locale must contain match property');
|
|
2705
|
+
}
|
|
2706
|
+
var firstWeekContainsDate = index.toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
|
|
2707
|
+
|
|
2708
|
+
// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
2709
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
2710
|
+
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
2711
|
+
}
|
|
2712
|
+
var weekStartsOn = index.toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
|
|
2713
|
+
|
|
2714
|
+
// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
2715
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
2716
|
+
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
2717
|
+
}
|
|
2718
|
+
if (formatString === '') {
|
|
2719
|
+
if (dateString === '') {
|
|
2720
|
+
return index.toDate(dirtyReferenceDate);
|
|
2721
|
+
} else {
|
|
2722
|
+
return new Date(NaN);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
var subFnOptions = {
|
|
2726
|
+
firstWeekContainsDate: firstWeekContainsDate,
|
|
2727
|
+
weekStartsOn: weekStartsOn,
|
|
2728
|
+
locale: locale
|
|
2729
|
+
};
|
|
2730
|
+
|
|
2731
|
+
// If timezone isn't specified, it will be set to the system timezone
|
|
2732
|
+
var setters = [new DateToSystemTimezoneSetter()];
|
|
2733
|
+
var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {
|
|
2734
|
+
var firstCharacter = substring[0];
|
|
2735
|
+
if (firstCharacter in index.longFormatters) {
|
|
2736
|
+
var longFormatter = index.longFormatters[firstCharacter];
|
|
2737
|
+
return longFormatter(substring, locale.formatLong);
|
|
2738
|
+
}
|
|
2739
|
+
return substring;
|
|
2740
|
+
}).join('').match(formattingTokensRegExp);
|
|
2741
|
+
var usedTokens = [];
|
|
2742
|
+
var _iterator = _createForOfIteratorHelper(tokens),
|
|
2743
|
+
_step;
|
|
2744
|
+
try {
|
|
2745
|
+
var _loop = function _loop() {
|
|
2746
|
+
var token = _step.value;
|
|
2747
|
+
if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && index.isProtectedWeekYearToken(token)) {
|
|
2748
|
+
index.throwProtectedError(token, formatString, dirtyDateString);
|
|
2749
|
+
}
|
|
2750
|
+
if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && index.isProtectedDayOfYearToken(token)) {
|
|
2751
|
+
index.throwProtectedError(token, formatString, dirtyDateString);
|
|
2752
|
+
}
|
|
2753
|
+
var firstCharacter = token[0];
|
|
2754
|
+
var parser = parsers[firstCharacter];
|
|
2755
|
+
if (parser) {
|
|
2756
|
+
var incompatibleTokens = parser.incompatibleTokens;
|
|
2757
|
+
if (Array.isArray(incompatibleTokens)) {
|
|
2758
|
+
var incompatibleToken = usedTokens.find(function (usedToken) {
|
|
2759
|
+
return incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter;
|
|
2760
|
+
});
|
|
2761
|
+
if (incompatibleToken) {
|
|
2762
|
+
throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
|
|
2763
|
+
}
|
|
2764
|
+
} else if (parser.incompatibleTokens === '*' && usedTokens.length > 0) {
|
|
2765
|
+
throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
|
|
2766
|
+
}
|
|
2767
|
+
usedTokens.push({
|
|
2768
|
+
token: firstCharacter,
|
|
2769
|
+
fullToken: token
|
|
2770
|
+
});
|
|
2771
|
+
var parseResult = parser.run(dateString, token, locale.match, subFnOptions);
|
|
2772
|
+
if (!parseResult) {
|
|
2773
|
+
return {
|
|
2774
|
+
v: new Date(NaN)
|
|
2775
|
+
};
|
|
2776
|
+
}
|
|
2777
|
+
setters.push(parseResult.setter);
|
|
2778
|
+
dateString = parseResult.rest;
|
|
2779
|
+
} else {
|
|
2780
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
2781
|
+
throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
// Replace two single quote characters with one single quote character
|
|
2785
|
+
if (token === "''") {
|
|
2786
|
+
token = "'";
|
|
2787
|
+
} else if (firstCharacter === "'") {
|
|
2788
|
+
token = cleanEscapedString(token);
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
// Cut token from string, or, if string doesn't match the token, return Invalid Date
|
|
2792
|
+
if (dateString.indexOf(token) === 0) {
|
|
2793
|
+
dateString = dateString.slice(token.length);
|
|
2794
|
+
} else {
|
|
2795
|
+
return {
|
|
2796
|
+
v: new Date(NaN)
|
|
2797
|
+
};
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
};
|
|
2801
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2802
|
+
var _ret = _loop();
|
|
2803
|
+
if (index._typeof(_ret) === "object") return _ret.v;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
// Check if the remaining input contains something other than whitespace
|
|
2807
|
+
} catch (err) {
|
|
2808
|
+
_iterator.e(err);
|
|
2809
|
+
} finally {
|
|
2810
|
+
_iterator.f();
|
|
2811
|
+
}
|
|
2812
|
+
if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
|
|
2813
|
+
return new Date(NaN);
|
|
2814
|
+
}
|
|
2815
|
+
var uniquePrioritySetters = setters.map(function (setter) {
|
|
2816
|
+
return setter.priority;
|
|
2817
|
+
}).sort(function (a, b) {
|
|
2818
|
+
return b - a;
|
|
2819
|
+
}).filter(function (priority, index, array) {
|
|
2820
|
+
return array.indexOf(priority) === index;
|
|
2821
|
+
}).map(function (priority) {
|
|
2822
|
+
return setters.filter(function (setter) {
|
|
2823
|
+
return setter.priority === priority;
|
|
2824
|
+
}).sort(function (a, b) {
|
|
2825
|
+
return b.subPriority - a.subPriority;
|
|
2826
|
+
});
|
|
2827
|
+
}).map(function (setterArray) {
|
|
2828
|
+
return setterArray[0];
|
|
2829
|
+
});
|
|
2830
|
+
var date = index.toDate(dirtyReferenceDate);
|
|
2831
|
+
if (isNaN(date.getTime())) {
|
|
2832
|
+
return new Date(NaN);
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
// Convert the date in system timezone to the same date in UTC+00:00 timezone.
|
|
2836
|
+
var utcDate = index.subMilliseconds(date, index.getTimezoneOffsetInMilliseconds(date));
|
|
2837
|
+
var flags = {};
|
|
2838
|
+
var _iterator2 = _createForOfIteratorHelper(uniquePrioritySetters),
|
|
2839
|
+
_step2;
|
|
2840
|
+
try {
|
|
2841
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
2842
|
+
var setter = _step2.value;
|
|
2843
|
+
if (!setter.validate(utcDate, subFnOptions)) {
|
|
2844
|
+
return new Date(NaN);
|
|
2845
|
+
}
|
|
2846
|
+
var result = setter.set(utcDate, flags, subFnOptions);
|
|
2847
|
+
// Result is tuple (date, flags)
|
|
2848
|
+
if (Array.isArray(result)) {
|
|
2849
|
+
utcDate = result[0];
|
|
2850
|
+
assign(flags, result[1]);
|
|
2851
|
+
// Result is date
|
|
2852
|
+
} else {
|
|
2853
|
+
utcDate = result;
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
} catch (err) {
|
|
2857
|
+
_iterator2.e(err);
|
|
2858
|
+
} finally {
|
|
2859
|
+
_iterator2.f();
|
|
2860
|
+
}
|
|
2861
|
+
return utcDate;
|
|
2862
|
+
}
|
|
2863
|
+
function cleanEscapedString(input) {
|
|
2864
|
+
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
const datepickerComponentCss = ".flex{display:flex!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column}:host input.read-only{text-overflow:ellipsis}.static{position:static!important}.cursor-pointer{cursor:pointer!important}.blur{--tw-blur:blur(8px)!important}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.visible{visibility:visible!important}.absolute{position:absolute!important}.-rotate-0{--tw-rotate:-0deg!important}.-rotate-0,.-rotate-135{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-135{--tw-rotate:-135deg!important}.-rotate-180{--tw-rotate:-180deg!important}.-rotate-180,.-rotate-225{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-225{--tw-rotate:-225deg!important}.-rotate-25{--tw-rotate:-25deg!important}.-rotate-25,.-rotate-270{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-270{--tw-rotate:-270deg!important}.-rotate-315{--tw-rotate:-315deg!important}.-rotate-315,.-rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-45{--tw-rotate:-45deg!important}.-rotate-90{--tw-rotate:-90deg!important}.-rotate-90,.rotate-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-0{--tw-rotate:0deg!important}.rotate-135{--tw-rotate:135deg!important}.rotate-135,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-180{--tw-rotate:180deg!important}.rotate-225{--tw-rotate:225deg!important}.rotate-225,.rotate-25{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-25{--tw-rotate:25deg!important}.rotate-270{--tw-rotate:270deg!important}.rotate-270,.rotate-315{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-315{--tw-rotate:315deg!important}.rotate-45{--tw-rotate:45deg!important}.rotate-45,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-90{--tw-rotate:90deg!important}.scale-x-flip{--tw-scale-x:-1!important}.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.scale-y-flip{--tw-scale-y:-1!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important}.text-5xl,.text-6xl{line-height:1!important}.text-6xl{font-size:3.75rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.text-xxs{font-size:.6875rem!important}.text-negative{--tw-text-opacity:1!important;color:rgb(185 30 40/var(--tw-text-opacity))!important}.text-negative-light{--tw-text-opacity:1!important;color:rgb(255 204 211/var(--tw-text-opacity))!important}.hover\\:text-negative:hover{--tw-text-opacity:1!important;color:rgb(185 30 40/var(--tw-text-opacity))!important}.ml-1{margin-left:.25rem!important}.ml-2{margin-left:.5rem!important}.w-full{width:100%!important}.items-end{align-items:flex-end!important}.justify-between{justify-content:space-between!important}.rounded-bl-none{border-bottom-left-radius:0!important}.rounded-br-none{border-bottom-right-radius:0!important}.rounded-tl-none{border-top-left-radius:0!important}.rounded-tr-none{border-top-right-radius:0!important}.border-l-0{border-left-width:0!important}.border-r-0{border-right-width:0!important}.pl-0{padding-left:0!important}.pr-0{padding-right:0!important}.col-start-1{grid-column-start:1!important}.col-start-2{grid-column-start:2!important}.col-start-3{grid-column-start:3!important}.col-start-4{grid-column-start:4!important}.col-start-5{grid-column-start:5!important}.col-start-6{grid-column-start:6!important}.col-start-7{grid-column-start:7!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";
|
|
2868
|
+
|
|
2869
|
+
const Datepicker = class {
|
|
2870
|
+
constructor(hostRef) {
|
|
2871
|
+
index$1.registerInstance(this, hostRef);
|
|
2872
|
+
this.valueChange = index$1.createEvent(this, "valueChange", 7);
|
|
2873
|
+
this._defaultFormats = {
|
|
2874
|
+
year: 'yyyy',
|
|
2875
|
+
month: 'LLLL, yyyy',
|
|
2876
|
+
day: 'dd-MM-yyyy',
|
|
2877
|
+
};
|
|
2878
|
+
this.placeholder = undefined;
|
|
2879
|
+
this.value = undefined;
|
|
2880
|
+
this.preselectToday = false;
|
|
2881
|
+
this.disabledDates = undefined;
|
|
2882
|
+
this.minDate = undefined;
|
|
2883
|
+
this.maxDate = undefined;
|
|
2884
|
+
this.disableWeekends = false;
|
|
2885
|
+
this.mode = 'day';
|
|
2886
|
+
this.format = 'dd-MM-yyyy';
|
|
2887
|
+
this.size = 'medium';
|
|
2888
|
+
this.prefix = undefined;
|
|
2889
|
+
this.label = undefined;
|
|
2890
|
+
this.helper = undefined;
|
|
2891
|
+
this.required = undefined;
|
|
2892
|
+
this.error = undefined;
|
|
2893
|
+
this.disabled = false;
|
|
2894
|
+
this._showDropdown = false;
|
|
2895
|
+
this._value = undefined;
|
|
2896
|
+
this._minDate = undefined;
|
|
2897
|
+
this._maxDate = undefined;
|
|
2898
|
+
this._disabledDates = [];
|
|
2899
|
+
}
|
|
2900
|
+
get formattedDate() {
|
|
2901
|
+
if (!this._value) {
|
|
2902
|
+
return;
|
|
2903
|
+
}
|
|
2904
|
+
return index.format(this._value, this.format);
|
|
2905
|
+
}
|
|
2906
|
+
parseValue(value) {
|
|
2907
|
+
if (!value && this.preselectToday) {
|
|
2908
|
+
value = new Date();
|
|
2909
|
+
}
|
|
2910
|
+
if (typeof value === 'string') {
|
|
2911
|
+
value = new Date(value);
|
|
2912
|
+
}
|
|
2913
|
+
this._setValue(value);
|
|
2914
|
+
}
|
|
2915
|
+
parseMinDate(minDate) {
|
|
2916
|
+
if (typeof minDate === 'string') {
|
|
2917
|
+
minDate = new Date(minDate);
|
|
2918
|
+
}
|
|
2919
|
+
if (!index.isValid(minDate)) {
|
|
2920
|
+
return;
|
|
2921
|
+
}
|
|
2922
|
+
this._minDate = minDate;
|
|
2923
|
+
if (index.isBefore(this._value, this._minDate)) {
|
|
2924
|
+
this._setValue(null);
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
parseMaxDate(maxDate) {
|
|
2928
|
+
if (typeof maxDate === 'string') {
|
|
2929
|
+
maxDate = new Date(maxDate);
|
|
2930
|
+
}
|
|
2931
|
+
if (!index.isValid(maxDate)) {
|
|
2932
|
+
return;
|
|
2933
|
+
}
|
|
2934
|
+
this._maxDate = maxDate;
|
|
2935
|
+
if (index.isAfter(this._value, this._maxDate)) {
|
|
2936
|
+
this._setValue(null);
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
parseDisabledDates(disabledDates) {
|
|
2940
|
+
if (typeof disabledDates === 'string') {
|
|
2941
|
+
disabledDates = JSON.parse(disabledDates);
|
|
2942
|
+
}
|
|
2943
|
+
if (!disabledDates || !Array.isArray(disabledDates)) {
|
|
2944
|
+
return;
|
|
2945
|
+
}
|
|
2946
|
+
// normalize all to date
|
|
2947
|
+
this._disabledDates = disabledDates
|
|
2948
|
+
.map((date) => {
|
|
2949
|
+
if (typeof date === 'string') {
|
|
2950
|
+
return new Date(date);
|
|
2951
|
+
}
|
|
2952
|
+
return date;
|
|
2953
|
+
})
|
|
2954
|
+
.filter((date) => index.isValid(date));
|
|
2955
|
+
if (this._isDisabledDay(this._value)) {
|
|
2956
|
+
this._setValue(null);
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
componentWillLoad() {
|
|
2960
|
+
if (this.disabledDates) {
|
|
2961
|
+
this.parseDisabledDates(this.disabledDates);
|
|
2962
|
+
}
|
|
2963
|
+
if (this.minDate) {
|
|
2964
|
+
this.parseMinDate(this.minDate);
|
|
2965
|
+
}
|
|
2966
|
+
if (this.maxDate) {
|
|
2967
|
+
this.parseMaxDate(this.maxDate);
|
|
2968
|
+
}
|
|
2969
|
+
if (this.mode !== 'day' &&
|
|
2970
|
+
this.format === this._defaultFormats['day']) {
|
|
2971
|
+
this.format = this._defaultFormats[this.mode];
|
|
2972
|
+
}
|
|
2973
|
+
this.parseValue(this.value);
|
|
2974
|
+
}
|
|
2975
|
+
render() {
|
|
2976
|
+
return (index$1.h(index$1.Host, { class: "p-datepicker" }, index$1.h("p-dropdown", { disableTriggerClick: true, applyMaxWidth: false, applyFullWidth: false, insideClick: true, show: this._showDropdown }, index$1.h("p-input-group", { slot: "trigger", icon: "calendar", iconPosition: "start", size: this.size, prefix: this.prefix, label: this.label, helper: this.helper, required: this.required, error: this.error, disabled: this.disabled, focused: this._showDropdown }, index$1.h("input", { slot: "input", type: "text", placeholder: this.placeholder, value: this.formattedDate, class: "p-input cursor-pointer", onFocus: () => this._onFocus(), onInput: (ev) => this._onInput(ev) })), index$1.h("div", { slot: "items" }, index$1.h("p-calendar", { variant: "embedded", value: this._value, onValueChange: ({ detail }) => (this.value = detail), preselectToday: this.preselectToday, disabledDates: this.disabledDates, minDate: this.minDate, maxDate: this.maxDate, disableWeekends: this.disableWeekends, mode: this.mode })))));
|
|
2977
|
+
}
|
|
2978
|
+
documentClickHandler({ target }) {
|
|
2979
|
+
if (!this._showDropdown || childOf.childOf(target, this._el)) {
|
|
2980
|
+
return;
|
|
2981
|
+
}
|
|
2982
|
+
this._showDropdown = false;
|
|
2983
|
+
}
|
|
2984
|
+
_onFocus() {
|
|
2985
|
+
this._showDropdown = true;
|
|
2986
|
+
}
|
|
2987
|
+
_onBlur() {
|
|
2988
|
+
this._showDropdown = false;
|
|
2989
|
+
}
|
|
2990
|
+
_onInput(ev) {
|
|
2991
|
+
if (this._onInputTimeout) {
|
|
2992
|
+
clearTimeout(this._onInputTimeout);
|
|
2993
|
+
this._onInputTimeout = null;
|
|
2994
|
+
}
|
|
2995
|
+
this._onInputTimeout = setTimeout(() => {
|
|
2996
|
+
const value = parse(ev.target.value, this.format, new Date());
|
|
2997
|
+
if (!index.isValid(value)) {
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
this._setValue(value, false);
|
|
3001
|
+
}, 250);
|
|
3002
|
+
}
|
|
3003
|
+
_setValue(value, blur = true) {
|
|
3004
|
+
if (value === null) {
|
|
3005
|
+
this._value = null;
|
|
3006
|
+
this.valueChange.emit(null);
|
|
3007
|
+
return;
|
|
3008
|
+
}
|
|
3009
|
+
if (!index.isValid(value)) {
|
|
3010
|
+
return;
|
|
3011
|
+
}
|
|
3012
|
+
if (this._isDisabledDay(value)) {
|
|
3013
|
+
return;
|
|
3014
|
+
}
|
|
3015
|
+
value = index.startOfDay(value);
|
|
3016
|
+
const isSameValue = index.isSameDay(value, this._value);
|
|
3017
|
+
if (isSameValue) {
|
|
3018
|
+
return;
|
|
3019
|
+
}
|
|
3020
|
+
if (blur) {
|
|
3021
|
+
this._onBlur();
|
|
3022
|
+
}
|
|
3023
|
+
this._value = value;
|
|
3024
|
+
this.valueChange.emit(value);
|
|
3025
|
+
}
|
|
3026
|
+
_isDisabledDay(day) {
|
|
3027
|
+
return (index.isBefore(day, this._minDate) ||
|
|
3028
|
+
(index.isAfter(day, this._maxDate) && !index.isSameDay(day, this._maxDate)) ||
|
|
3029
|
+
this._disabledDates.findIndex((date) => index.isSameDay(date, day)) >= 0);
|
|
3030
|
+
}
|
|
3031
|
+
get _el() { return index$1.getElement(this); }
|
|
3032
|
+
static get watchers() { return {
|
|
3033
|
+
"value": ["parseValue"],
|
|
3034
|
+
"minDate": ["parseMinDate"],
|
|
3035
|
+
"maxDate": ["parseMaxDate"],
|
|
3036
|
+
"disabledDates": ["parseDisabledDates"]
|
|
3037
|
+
}; }
|
|
3038
|
+
};
|
|
3039
|
+
Datepicker.style = datepickerComponentCss;
|
|
3040
|
+
|
|
3041
|
+
exports.p_datepicker = Datepicker;
|
|
3042
|
+
|
|
3043
|
+
//# sourceMappingURL=p-datepicker.cjs.entry.js.map
|