@jobber/components 4.85.6-CJS-to-ESM.1 → 4.85.6-CJS-to-ESM.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/Autocomplete/index.cjs +9 -10
- package/dist/Autocomplete/index.mjs +9 -10
- package/dist/{Autocomplete-CDpl009j.js → Autocomplete-1iO7JRX2.js} +8 -8
- package/dist/{Autocomplete-DcuJsI7Z.js → Autocomplete-CfntbJ6I.js} +8 -8
- package/dist/Banner/index.cjs +6 -2
- package/dist/Banner/index.mjs +6 -2
- package/dist/{Banner-zMyKdO1y.js → Banner-9-5fXphG.js} +2 -2
- package/dist/{Banner-B230_jsV.js → Banner-QqoLHMka.js} +2 -2
- package/dist/Card/index.cjs +5 -5
- package/dist/Card/index.mjs +5 -5
- package/dist/{Card-0WPJWxfz.js → Card-BeL8rCSY.js} +1 -1
- package/dist/{Card-BOD8v9wH.js → Card-DQB6rhwZ.js} +1 -1
- package/dist/Chip/index.cjs +6 -5
- package/dist/Chip/index.mjs +6 -5
- package/dist/{Chip-tWHAQezL.js → Chip-Cvuqhi_q.js} +4 -4
- package/dist/{Chip-Div4v8At.js → Chip-DSy6Xm8R.js} +4 -4
- package/dist/{ChipDismissible-B0DslYTJ.js → ChipDismissible-BtVU1TDW.js} +1 -1
- package/dist/{ChipDismissible-DSLoDRyq.js → ChipDismissible-C8X7PyuZ.js} +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +9 -10
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +9 -10
- package/dist/Chips/InternalChipDismissible/index.cjs +14 -14
- package/dist/Chips/InternalChipDismissible/index.mjs +14 -14
- package/dist/Chips/index.cjs +16 -16
- package/dist/Chips/index.mjs +16 -16
- package/dist/{Chips-DzPxRiFY.js → Chips-DKCvpzfp.js} +1 -1
- package/dist/{Chips-tdDqEKfy.js → Chips-PXZl-nIG.js} +1 -1
- package/dist/Combobox/components/ComboboxActivator/index.cjs +6 -5
- package/dist/Combobox/components/ComboboxActivator/index.mjs +6 -5
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.cjs +4 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.mjs +4 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.cjs +3 -2
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.mjs +3 -2
- package/dist/Combobox/components/ComboboxContent/index.cjs +8 -7
- package/dist/Combobox/components/ComboboxContent/index.mjs +8 -7
- package/dist/Combobox/components/ComboboxTrigger/index.cjs +6 -5
- package/dist/Combobox/components/ComboboxTrigger/index.mjs +6 -5
- package/dist/Combobox/index.cjs +20 -19
- package/dist/Combobox/index.mjs +20 -19
- package/dist/{Combobox-Dr5ftH9X.js → Combobox-CL1tRKd3.js} +7 -7
- package/dist/{Combobox-BwSFlPWt.js → Combobox-D44taKUg.js} +7 -7
- package/dist/{ComboboxActivator-DkcbNfv5.js → ComboboxActivator-D41tfwAg.js} +1 -1
- package/dist/{ComboboxActivator-B-2nmWQ-.js → ComboboxActivator-DT29yQ2v.js} +1 -1
- package/dist/{ComboboxContent-B108quRR.js → ComboboxContent-BRgUJ7J4.js} +7 -7
- package/dist/{ComboboxContent-D44NnZaD.js → ComboboxContent-C3MIJd9a.js} +7 -7
- package/dist/{ComboboxContentList-DmdT_cqp.js → ComboboxContentList-B_KlRjj7.js} +1 -1
- package/dist/{ComboboxContentList-DHQ0x2ml.js → ComboboxContentList-wTyr0j1u.js} +1 -1
- package/dist/{ComboboxLoadMore-Dk2tUBxS.js → ComboboxLoadMore-Bfg4pEkg.js} +2 -2
- package/dist/{ComboboxLoadMore-C3JuiaZf.js → ComboboxLoadMore-CBXYoxXv.js} +2 -2
- package/dist/{ComboboxTrigger-BAOfY8Og.js → ComboboxTrigger-DdG9k28y.js} +1 -1
- package/dist/{ComboboxTrigger-ZqNl11Qy.js → ComboboxTrigger-zTO01W3n.js} +1 -1
- package/dist/ConfirmationModal/index.cjs +10 -7
- package/dist/ConfirmationModal/index.mjs +10 -7
- package/dist/{ConfirmationModal-CZTiORX4.js → ConfirmationModal-Bg7ftIT2.js} +4 -4
- package/dist/{ConfirmationModal-CPNH-chF.js → ConfirmationModal-CrH9KKYd.js} +4 -4
- package/dist/Countdown/index.cjs +3 -2
- package/dist/Countdown/index.mjs +3 -2
- package/dist/Countdown-6Bkj7xkV.js +659 -0
- package/dist/Countdown-XLp-r4PS.js +657 -0
- package/dist/DataDump/index.cjs +6 -6
- package/dist/DataDump/index.mjs +6 -6
- package/dist/{DataDump-BhkXdMFl.js → DataDump-BQOPiKBi.js} +1 -1
- package/dist/{DataDump-BoNQd_3r.js → DataDump-DFesmG7X.js} +1 -1
- package/dist/DataList/components/DataListActions/index.cjs +18 -18
- package/dist/DataList/components/DataListActions/index.mjs +18 -18
- package/dist/DataList/components/DataListActionsMenu/index.cjs +4 -4
- package/dist/DataList/components/DataListActionsMenu/index.mjs +4 -4
- package/dist/DataList/components/DataListBulkActions/index.cjs +19 -19
- package/dist/DataList/components/DataListBulkActions/index.mjs +19 -19
- package/dist/DataList/components/DataListEmptyState/index.cjs +4 -4
- package/dist/DataList/components/DataListEmptyState/index.mjs +4 -4
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +22 -21
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +22 -21
- package/dist/DataList/components/DataListFilters/index.cjs +28 -27
- package/dist/DataList/components/DataListFilters/index.mjs +28 -27
- package/dist/DataList/components/DataListHeader/index.cjs +22 -22
- package/dist/DataList/components/DataListHeader/index.mjs +22 -22
- package/dist/DataList/components/DataListHeaderTile/components/index.cjs +3 -3
- package/dist/DataList/components/DataListHeaderTile/components/index.mjs +3 -3
- package/dist/DataList/components/DataListHeaderTile/index.cjs +8 -8
- package/dist/DataList/components/DataListHeaderTile/index.mjs +8 -8
- package/dist/DataList/components/DataListItem/components/DataListItemClickable/index.cjs +4 -4
- package/dist/DataList/components/DataListItem/components/DataListItemClickable/index.mjs +4 -4
- package/dist/DataList/components/DataListItem/index.cjs +23 -23
- package/dist/DataList/components/DataListItem/index.mjs +23 -23
- package/dist/DataList/components/DataListItemActions/index.cjs +19 -19
- package/dist/DataList/components/DataListItemActions/index.mjs +19 -19
- package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +7 -7
- package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +7 -7
- package/dist/DataList/components/DataListItems/index.cjs +24 -24
- package/dist/DataList/components/DataListItems/index.mjs +24 -24
- package/dist/DataList/components/DataListLayout/index.cjs +26 -26
- package/dist/DataList/components/DataListLayout/index.mjs +26 -26
- package/dist/DataList/components/DataListLayoutActions/index.cjs +12 -12
- package/dist/DataList/components/DataListLayoutActions/index.mjs +12 -12
- package/dist/DataList/components/DataListLoadMore/index.cjs +5 -5
- package/dist/DataList/components/DataListLoadMore/index.mjs +5 -5
- package/dist/DataList/components/DataListLoadingState/index.cjs +5 -5
- package/dist/DataList/components/DataListLoadingState/index.mjs +5 -5
- package/dist/DataList/components/DataListOverflowFade/index.cjs +3 -2
- package/dist/DataList/components/DataListOverflowFade/index.mjs +3 -2
- package/dist/DataList/components/DataListSearch/index.cjs +10 -11
- package/dist/DataList/components/DataListSearch/index.mjs +10 -11
- package/dist/DataList/components/DataListStatusBar/index.cjs +12 -12
- package/dist/DataList/components/DataListStatusBar/index.mjs +12 -12
- package/dist/DataList/context/DataListContext/index.cjs +3 -3
- package/dist/DataList/context/DataListContext/index.mjs +3 -3
- package/dist/DataList/context/DataListLayoutContext/index.cjs +3 -3
- package/dist/DataList/context/DataListLayoutContext/index.mjs +3 -3
- package/dist/DataList/index.cjs +50 -50
- package/dist/DataList/index.mjs +50 -50
- package/dist/{DataList-UzxXqfXV.js → DataList-D67E3-Ka.js} +13 -13
- package/dist/{DataList-DcPfsE4o.js → DataList-DqrdT8B4.js} +13 -13
- package/dist/{DataList.utils-B0hOFZaX.js → DataList.utils-DTLgRGnD.js} +3 -3
- package/dist/{DataList.utils-C931OWj0.js → DataList.utils-DoGRceLK.js} +3 -3
- package/dist/{DataListActions-D2xI1Gnz.js → DataListActions-CeuvLm4e.js} +4 -4
- package/dist/{DataListActions-DYrocbl7.js → DataListActions-DiFKUVOd.js} +4 -4
- package/dist/{DataListActionsMenu-CjBKmZT6.js → DataListActionsMenu-BOJ6GBFf.js} +6 -6
- package/dist/{DataListActionsMenu-3JxvPbGZ.js → DataListActionsMenu-BtZsN7F7.js} +6 -6
- package/dist/{DataListBulkActions-OLJ1EzI6.js → DataListBulkActions-BBh5Yg_B.js} +2 -2
- package/dist/{DataListBulkActions-BSjCVCSw.js → DataListBulkActions-DWmugOCQ.js} +2 -2
- package/dist/{DataListContext-DHdRjGCC.js → DataListContext-9uw8XwzP.js} +1 -1
- package/dist/{DataListContext-CWEeA357.js → DataListContext-B4eBw_aH.js} +1 -1
- package/dist/{DataListEmptyState-CvRFHlYt.js → DataListEmptyState-B7Yug5IF.js} +1 -1
- package/dist/{DataListEmptyState-Rk1OowmR.js → DataListEmptyState-bCN6CJ0x.js} +1 -1
- package/dist/{DataListFilters-y0CrJgWe.js → DataListFilters-BjCiSdX2.js} +4 -4
- package/dist/{DataListFilters-Dfw7ptNa.js → DataListFilters-C8PRbG6B.js} +4 -4
- package/dist/{DataListHeader-DB1ikJ1G.js → DataListHeader-1UOL7n9h.js} +5 -5
- package/dist/{DataListHeader-BFg0X9Jz.js → DataListHeader-Baxtt1sP.js} +5 -5
- package/dist/{DataListHeaderTile-BcvpRQqc.js → DataListHeaderTile-Bmb-3jk4.js} +6 -6
- package/dist/{DataListHeaderTile-CUaHgFkG.js → DataListHeaderTile-CawTnwxZ.js} +6 -6
- package/dist/{DataListItem-CEcG1clf.js → DataListItem-B2PBp6pr.js} +7 -7
- package/dist/{DataListItem-27SGm5NU.js → DataListItem-CVmLNaR9.js} +7 -7
- package/dist/{DataListItemActions-B0IR13cA.js → DataListItemActions-BDMYnI5D.js} +1 -1
- package/dist/{DataListItemActions-DbMxVTo5.js → DataListItemActions-BNZ702t2.js} +1 -1
- package/dist/{DataListItemActionsOverflow-B1XTLLAZ.js → DataListItemActionsOverflow-Cv89cyOn.js} +2 -2
- package/dist/{DataListItemActionsOverflow-Dt1rZ_ch.js → DataListItemActionsOverflow-jnHamzf7.js} +2 -2
- package/dist/{DataListItemClickable-a9vfumwQ.js → DataListItemClickable-8iEm6BU0.js} +1 -1
- package/dist/{DataListItemClickable-CPGV8QJU.js → DataListItemClickable-BZ7u37GY.js} +1 -1
- package/dist/{DataListItems-C37QwFLL.js → DataListItems-C2afygvC.js} +3 -3
- package/dist/{DataListItems-CmmwaaoF.js → DataListItems-DWx1TECw.js} +3 -3
- package/dist/{DataListLayout-BkqOAi5X.js → DataListLayout-DMY8Io7b.js} +3 -3
- package/dist/{DataListLayout-fuctDjAR.js → DataListLayout-KiPC1zwI.js} +3 -3
- package/dist/{DataListLayoutActions-BrXEXuWB.js → DataListLayoutActions-AijXG655.js} +3 -3
- package/dist/{DataListLayoutActions-C1xVkV8F.js → DataListLayoutActions-DrTY5Ejw.js} +3 -3
- package/dist/{DataListLayoutContext-D5Jhd_ZG.js → DataListLayoutContext-CavOWAD3.js} +1 -1
- package/dist/{DataListLayoutContext-BiMbo7LQ.js → DataListLayoutContext-DvTtBMxW.js} +1 -1
- package/dist/{DataListLoadMore-BThmoeQ0.js → DataListLoadMore-BgEh97cj.js} +3 -3
- package/dist/{DataListLoadMore-eMdC9JGb.js → DataListLoadMore-RU8ynOhk.js} +3 -3
- package/dist/{DataListLoadingState-DKSypijq.js → DataListLoadingState-Bvrt8fF7.js} +2 -2
- package/dist/{DataListLoadingState-BovqtnV7.js → DataListLoadingState-Cm3mAc4V.js} +2 -2
- package/dist/{DataListOverflowFade-DxUdWrD0.js → DataListOverflowFade-BZk4jUAc.js} +3 -3
- package/dist/{DataListOverflowFade-DUocP0Jz.js → DataListOverflowFade-DqAHrxFC.js} +3 -3
- package/dist/{DataListSearch-DiHOG8VU.js → DataListSearch-2s_UETky.js} +3 -3
- package/dist/{DataListSearch-D0pqhE8d.js → DataListSearch-P9-j_TtT.js} +3 -3
- package/dist/{DataListSort-CQ62ewRY.js → DataListSort-BPIPnVXL.js} +3 -3
- package/dist/{DataListSort-CW4v1psG.js → DataListSort-D1Ng8x7t.js} +3 -3
- package/dist/{DataListSortingOptions-BGNu0KOG.js → DataListSortingOptions-Ciu5gWGt.js} +4 -4
- package/dist/{DataListSortingOptions-ZiARzP5b.js → DataListSortingOptions-SfZWLgFS.js} +4 -4
- package/dist/{DataListStatusBar-Va-ssWph.js → DataListStatusBar-D-j7Wk18.js} +2 -2
- package/dist/{DataListStatusBar-EQKC5MHS.js → DataListStatusBar-wvLYlUTP.js} +2 -2
- package/dist/DataTable/index.cjs +9 -6
- package/dist/DataTable/index.mjs +9 -6
- package/dist/DataTable/test-utilities/index.cjs +7 -2
- package/dist/DataTable/test-utilities/index.mjs +7 -2
- package/dist/{DataTable-D1Q5tABs.js → DataTable-CMTFBvO6.js} +5 -5
- package/dist/{DataTable-BOZ_Zf4q.js → DataTable-D0MIpeXc.js} +5 -5
- package/dist/DatePicker/index.cjs +9 -9
- package/dist/DatePicker/index.mjs +9 -9
- package/dist/{DatePicker-CqYEsDX3.js → DatePicker-B2LXoRjW.js} +8 -8
- package/dist/{DatePicker-DBObDXoW.js → DatePicker-BuD8xaKB.js} +8 -8
- package/dist/Disclosure/index.cjs +6 -2
- package/dist/Disclosure/index.mjs +6 -2
- package/dist/{Disclosure-Bikm1B9V.js → Disclosure-CWNmDoE_.js} +3 -3
- package/dist/{Disclosure-D7kJi1Df.js → Disclosure-CXQ8I0Xh.js} +3 -3
- package/dist/FeatureSwitch/index.cjs +6 -3
- package/dist/FeatureSwitch/index.mjs +6 -3
- package/dist/{FeatureSwitch-C66nDoAy.js → FeatureSwitch-C6OjQJWH.js} +1 -1
- package/dist/{FeatureSwitch-C1cXc0VS.js → FeatureSwitch-Dt8VXcE6.js} +1 -1
- package/dist/FormField/index.cjs +1 -2
- package/dist/FormField/index.mjs +1 -2
- package/dist/{FormField-C-d0U7Ww.js → FormField-D2Dlrypi.js} +52 -2
- package/dist/{FormField-BBg_JAlJ.js → FormField-hCrwUWca.js} +52 -2
- package/dist/FormatFile/index.cjs +11 -8
- package/dist/FormatFile/index.mjs +11 -8
- package/dist/{FormatFile-BQXjo6EG.js → FormatFile-BEsZX9CU.js} +1 -1
- package/dist/{FormatFile-D-UIdDqE.js → FormatFile-BhY6M5LN.js} +1 -1
- package/dist/Gallery/index.cjs +16 -14
- package/dist/Gallery/index.mjs +16 -14
- package/dist/{Gallery-BMpC_ohB.js → Gallery-BfEW11YL.js} +2 -2
- package/dist/{Gallery-DXXQxrHV.js → Gallery-kWVZNTYq.js} +2 -2
- package/dist/Grid/index.cjs +4 -2
- package/dist/Grid/index.mjs +4 -2
- package/dist/{Grid-ClBkskz-.js → Grid-InsV4yVr.js} +2 -2
- package/dist/{Grid-2KPGnpZI.js → Grid-cuC0E5S-.js} +2 -2
- package/dist/InputAvatar/index.cjs +4 -3
- package/dist/InputAvatar/index.mjs +4 -3
- package/dist/{InputAvatar-DcNJEpM3.js → InputAvatar-B2dB8FZL.js} +1 -1
- package/dist/{InputAvatar-Dp3cCHai.js → InputAvatar-CuzV_xzx.js} +1 -1
- package/dist/InputDate/index.cjs +11 -12
- package/dist/InputDate/index.mjs +11 -12
- package/dist/{InputDate-D5pZraRN.js → InputDate-C9ydz9Nu.js} +2 -2
- package/dist/{InputDate-Brwb3gue.js → InputDate-DEsSVsNk.js} +2 -2
- package/dist/InputEmail/index.cjs +2 -3
- package/dist/InputEmail/index.mjs +2 -3
- package/dist/{InputEmail-nxOzDFb8.js → InputEmail-58nfESu9.js} +1 -1
- package/dist/{InputEmail-DkvNQj63.js → InputEmail-C_90uNvB.js} +1 -1
- package/dist/InputFile/index.cjs +3 -2
- package/dist/InputFile/index.mjs +3 -2
- package/dist/{InputFile-l-Zdbe8r.js → InputFile-TLVjerUe.js} +24 -1207
- package/dist/{InputFile-BBOdV6FH.js → InputFile-cOKwdZIS.js} +1 -1184
- package/dist/InputNumber/index.cjs +2 -3
- package/dist/InputNumber/index.mjs +2 -3
- package/dist/{InputNumber-D2jOwtOi.js → InputNumber-9zWSTnld.js} +1 -1
- package/dist/{InputNumber-B3-6b6mT.js → InputNumber-B0sa7sL7.js} +1 -1
- package/dist/InputPassword/index.cjs +2 -3
- package/dist/InputPassword/index.mjs +2 -3
- package/dist/{InputPassword-mWbDB3Oh.js → InputPassword--RuWqNxH.js} +1 -1
- package/dist/{InputPassword-BwPfewHd.js → InputPassword-D6CEA3YM.js} +1 -1
- package/dist/InputPhoneNumber/index.cjs +2 -3
- package/dist/InputPhoneNumber/index.mjs +2 -3
- package/dist/{InputPhoneNumber-CrkVlyUE.js → InputPhoneNumber-Bv3OG77a.js} +1 -1
- package/dist/{InputPhoneNumber-ynZiTe9j.js → InputPhoneNumber-j8Cr2jkb.js} +1 -1
- package/dist/InputText/index.cjs +3 -4
- package/dist/InputText/index.mjs +3 -4
- package/dist/{InputText-D1KkzO4T.js → InputText--fuxI6yf.js} +3 -3
- package/dist/{InputText-CgykvJl2.js → InputText-CCmzDC9W.js} +3 -3
- package/dist/InputTime/index.cjs +6 -7
- package/dist/InputTime/index.mjs +6 -7
- package/dist/{InputTime-Ce0H2RWH.js → InputTime-BcgwlVsy.js} +2 -2
- package/dist/{InputTime-CVHCWh2x.js → InputTime-DBtpOhbX.js} +2 -2
- package/dist/{InternalChipDismissible-BoAPXU91.js → InternalChipDismissible-BuafNVqR.js} +6 -7
- package/dist/{InternalChipDismissible-Dj-XvjT4.js → InternalChipDismissible-D9MobrPl.js} +6 -7
- package/dist/LightBox/index.cjs +8 -8
- package/dist/LightBox/index.mjs +8 -8
- package/dist/{LightBox-DLJk1m24.js → LightBox-D4a2D7do.js} +9 -9
- package/dist/{LightBox-oRvBzCVE.js → LightBox-D57afhgq.js} +9 -9
- package/dist/List/index.cjs +12 -10
- package/dist/List/index.mjs +12 -10
- package/dist/{List-BLRtWdVA.js → List-Cspxky2V.js} +5 -5
- package/dist/{List-C6AG4_dM.js → List-DJE2WMjK.js} +5 -5
- package/dist/Markdown/index.cjs +5 -2
- package/dist/Markdown/index.mjs +5 -2
- package/dist/Markdown-C-Kz7FGt.js +18983 -0
- package/dist/Markdown-D4Q_2pBV.js +18985 -0
- package/dist/Menu/index.cjs +4 -4
- package/dist/Menu/index.mjs +4 -4
- package/dist/{Menu-BXvyYPow.js → Menu-6YnPYEq0.js} +6 -6
- package/dist/{Menu-DWqTLjQu.js → Menu-D3mhNOYC.js} +6 -6
- package/dist/Modal/index.cjs +4 -4
- package/dist/Modal/index.mjs +4 -4
- package/dist/{Modal-BsCYxzQV.js → Modal-DYsKMdiT.js} +6 -6
- package/dist/{Modal-COtt6AGz.js → Modal-u49JU_yq.js} +6 -6
- package/dist/{Option-DkWd2dv6.js → Option-CK6AzE_2.js} +1 -1
- package/dist/{Option-BmWN4Bgv.js → Option-CbvjqSHC.js} +1 -1
- package/dist/Page/index.cjs +14 -8
- package/dist/Page/index.mjs +14 -8
- package/dist/{Page-CI4G1pxg.js → Page-CNNOg5qF.js} +7 -7
- package/dist/{Page-DdD5O2fP.js → Page-Dj0S56-I.js} +7 -7
- package/dist/Popover/index.cjs +2 -2
- package/dist/Popover/index.mjs +2 -2
- package/dist/{Popover-D2Lc46rN.js → Popover-DYWEx-xf.js} +2 -2
- package/dist/{Popover-MtwM2-M4.js → Popover-EUC6wuNn.js} +2 -2
- package/dist/RecurringSelect/index.cjs +4 -5
- package/dist/RecurringSelect/index.mjs +4 -5
- package/dist/{RecurringSelect-BQuw43z9.js → RecurringSelect-D2F9hWJb.js} +2 -2
- package/dist/{RecurringSelect-DLFrS379.js → RecurringSelect-QdDavgCT.js} +2 -2
- package/dist/Select/index.cjs +2 -3
- package/dist/Select/index.mjs +2 -3
- package/dist/Tooltip/index.cjs +2 -2
- package/dist/Tooltip/index.mjs +2 -2
- package/dist/{Tooltip-DWAVu0yQ.js → Tooltip-BEW-a9OW.js} +2 -2
- package/dist/{Tooltip-DG1mcZlX.js → Tooltip-mn2jRxXD.js} +2 -2
- package/dist/{_baseAssignValue-Cq-EPFBb.js → _baseAssignValue-B6tvMdT2.js} +1 -1
- package/dist/{_baseAssignValue-BDfrxHwl.js → _baseAssignValue-TwbvXiTB.js} +1 -1
- package/dist/{_baseEach-fQjYIaCA.js → _baseEach--p319nr8.js} +4 -4
- package/dist/{_baseEach-C5AdInAP.js → _baseEach-DPBHJoX6.js} +4 -4
- package/dist/_commonjsHelpers-B83fTs8d.js +36 -0
- package/dist/_commonjsHelpers-E-ZsRS8r.js +32 -0
- package/dist/{_defineProperty-DYWOWIJv.js → _defineProperty-Bai9NpfZ.js} +3 -3
- package/dist/{_defineProperty-DVTdBF7D.js → _defineProperty-DjLE4Bk3.js} +3 -3
- package/dist/{_getTag-DYzEQmpZ.js → _getTag-Bcit8gs_.js} +1 -1
- package/dist/{_getTag-CHBhnZgu.js → _getTag-Bd2IuclU.js} +1 -1
- package/dist/{_setToString-Cjq7b1P9.js → _setToString-DwIrtHSk.js} +3 -3
- package/dist/{_setToString-F-wwuS_Y.js → _setToString-QSHar2ai.js} +3 -3
- package/dist/{debounce-B-pQrPa0.js → debounce-CJA36ltI.js} +4 -3
- package/dist/{debounce-asENWBkf.js → debounce-D3te8_TG.js} +4 -4
- package/dist/{helpers-5vvADJkh.js → helpers-B7JgOXZj.js} +1 -1
- package/dist/helpers-y1-dsK59.js +17 -0
- package/dist/index-B88K44gK.js +1186 -0
- package/dist/index-BoP83yS-.js +8 -0
- package/dist/index-CJnrkxgL.js +1189 -0
- package/dist/index-Jb6tGBiW.js +11 -0
- package/dist/index.cjs +91 -92
- package/dist/index.mjs +91 -92
- package/dist/{isObjectLike-CsWGWxp9.js → isObjectLike-BUFV4ggG.js} +1 -1
- package/dist/{isObjectLike-91E0YOes.js → isObjectLike-CkQBn_-v.js} +1 -1
- package/dist/{isSymbol-BEvcpX3s.js → isSymbol-BB8mecpv.js} +1 -1
- package/dist/{isSymbol-CqL-NQwG.js → isSymbol-DS9vlqp3.js} +1 -1
- package/dist/{noop-DXH2P2oE.js → noop-BHeBk22E.js} +1 -1
- package/dist/{noop-D_wzwwIq.js → noop-CJPLieIK.js} +1 -1
- package/dist/{useActiveLayout-BzQghohH.js → useActiveLayout-BjGE_HD9.js} +1 -1
- package/dist/{useActiveLayout-DazMYwxf.js → useActiveLayout-Bvo5EJVa.js} +1 -1
- package/dist/useAssert-DJjF2xRH.js +55 -0
- package/dist/useAssert-Dj-7DdKE.js +57 -0
- package/dist/{useBatchSelect-B7U15920.js → useBatchSelect-D2oSwHTp.js} +1 -1
- package/dist/{useBatchSelect-DMD3JH4P.js → useBatchSelect-DnLpNm6-.js} +1 -1
- package/dist/useFocusTrap-BtnnoHG8.js +104 -0
- package/dist/useFocusTrap-CMLwEDMY.js +106 -0
- package/dist/useInView-Ct13SCWB.js +70 -0
- package/dist/useInView-Yth15M0p.js +68 -0
- package/dist/useOnKeyDown-B9JF2jLZ.js +72 -0
- package/dist/useOnKeyDown-BsUfDste.js +70 -0
- package/dist/useRefocusOnActivator-CMNWUYSe.js +62 -0
- package/dist/useRefocusOnActivator-DOJm9VWz.js +64 -0
- package/dist/useResizeObserver-BwGseyVc.js +1234 -0
- package/dist/useResizeObserver-ZgXMUTij.js +1231 -0
- package/dist/useSafeLayoutEffect-Qir6pm57.js +44 -0
- package/dist/useSafeLayoutEffect-yaw3NyzX.js +42 -0
- package/dist/{useScrollToActive-KSEZO66J.js → useScrollToActive-BkZ3BYNd.js} +84 -11
- package/dist/{useScrollToActive-BB-8euJF.js → useScrollToActive-DMDRmhoI.js} +84 -11
- package/package.json +4 -4
- package/rollup.config.mjs +10 -11
- package/dist/Countdown-DQYi_QSJ.js +0 -63
- package/dist/Countdown-mTio5lCJ.js +0 -65
- package/dist/Markdown-B2B4q1R4.js +0 -57
- package/dist/Markdown-BqNLA1UK.js +0 -55
- package/dist/_commonjsHelpers-BFTU3MAI.js +0 -7
- package/dist/_commonjsHelpers-BJu3ubxk.js +0 -10
- package/dist/helpers-CFWATKJI.js +0 -36
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var temporal = require('@std-proposal/temporal');
|
|
5
|
+
var index = require('./index-CJnrkxgL.js');
|
|
6
|
+
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
|
+
if (!(instance instanceof Constructor)) {
|
|
9
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function _defineProperties(target, props) {
|
|
14
|
+
for (var i = 0; i < props.length; i++) {
|
|
15
|
+
var descriptor = props[i];
|
|
16
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
17
|
+
descriptor.configurable = true;
|
|
18
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
19
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
24
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
25
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
26
|
+
return Constructor;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function _inherits(subClass, superClass) {
|
|
30
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
31
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
35
|
+
constructor: {
|
|
36
|
+
value: subClass,
|
|
37
|
+
writable: true,
|
|
38
|
+
configurable: true
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function _getPrototypeOf(o) {
|
|
45
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
46
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
47
|
+
};
|
|
48
|
+
return _getPrototypeOf(o);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function _setPrototypeOf(o, p) {
|
|
52
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
53
|
+
o.__proto__ = p;
|
|
54
|
+
return o;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return _setPrototypeOf(o, p);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function _isNativeReflectConstruct() {
|
|
61
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
62
|
+
if (Reflect.construct.sham) return false;
|
|
63
|
+
if (typeof Proxy === "function") return true;
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
|
67
|
+
return true;
|
|
68
|
+
} catch (e) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function _assertThisInitialized(self) {
|
|
74
|
+
if (self === void 0) {
|
|
75
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return self;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function _possibleConstructorReturn(self, call) {
|
|
82
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
83
|
+
return call;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return _assertThisInitialized(self);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function _createSuper(Derived) {
|
|
90
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
91
|
+
|
|
92
|
+
return function _createSuperInternal() {
|
|
93
|
+
var Super = _getPrototypeOf(Derived),
|
|
94
|
+
result;
|
|
95
|
+
|
|
96
|
+
if (hasNativeReflectConstruct) {
|
|
97
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
98
|
+
|
|
99
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
100
|
+
} else {
|
|
101
|
+
result = Super.apply(this, arguments);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return _possibleConstructorReturn(this, result);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function _toConsumableArray(arr) {
|
|
109
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function _arrayWithoutHoles(arr) {
|
|
113
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function _iterableToArray(iter) {
|
|
117
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
121
|
+
if (!o) return;
|
|
122
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
123
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
124
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
125
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
126
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function _arrayLikeToArray(arr, len) {
|
|
130
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
131
|
+
|
|
132
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
133
|
+
|
|
134
|
+
return arr2;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function _nonIterableSpread() {
|
|
138
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function zeroPad(value) {
|
|
142
|
+
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
143
|
+
var strValue = String(value);
|
|
144
|
+
if (length === 0) return strValue;
|
|
145
|
+
var match = strValue.match(/(.*?)([0-9]+)(.*)/);
|
|
146
|
+
var prefix = match ? match[1] : '';
|
|
147
|
+
var suffix = match ? match[3] : '';
|
|
148
|
+
var strNo = match ? match[2] : strValue;
|
|
149
|
+
var paddedNo = strNo.length >= length ? strNo : (_toConsumableArray(Array(length)).map(function () {
|
|
150
|
+
return '0';
|
|
151
|
+
}).join('') + strNo).slice(length * -1);
|
|
152
|
+
return "".concat(prefix).concat(paddedNo).concat(suffix);
|
|
153
|
+
}
|
|
154
|
+
var timeDeltaFormatOptionsDefaults = {
|
|
155
|
+
daysInHours: false,
|
|
156
|
+
zeroPadTime: 2
|
|
157
|
+
};
|
|
158
|
+
function calcTimeDelta(date) {
|
|
159
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
160
|
+
var _options$now = options.now,
|
|
161
|
+
now = _options$now === void 0 ? Date.now : _options$now,
|
|
162
|
+
_options$precision = options.precision,
|
|
163
|
+
precision = _options$precision === void 0 ? 0 : _options$precision,
|
|
164
|
+
controlled = options.controlled,
|
|
165
|
+
_options$offsetTime = options.offsetTime,
|
|
166
|
+
offsetTime = _options$offsetTime === void 0 ? 0 : _options$offsetTime,
|
|
167
|
+
overtime = options.overtime;
|
|
168
|
+
var startTimestamp;
|
|
169
|
+
|
|
170
|
+
if (typeof date === 'string') {
|
|
171
|
+
startTimestamp = new Date(date).getTime();
|
|
172
|
+
} else if (date instanceof Date) {
|
|
173
|
+
startTimestamp = date.getTime();
|
|
174
|
+
} else {
|
|
175
|
+
startTimestamp = date;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (!controlled) {
|
|
179
|
+
startTimestamp += offsetTime;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var timeLeft = controlled ? startTimestamp : startTimestamp - now();
|
|
183
|
+
var clampedPrecision = Math.min(20, Math.max(0, precision));
|
|
184
|
+
var total = Math.round(parseFloat(((overtime ? timeLeft : Math.max(0, timeLeft)) / 1000).toFixed(clampedPrecision)) * 1000);
|
|
185
|
+
var seconds = Math.abs(total) / 1000;
|
|
186
|
+
return {
|
|
187
|
+
total: total,
|
|
188
|
+
days: Math.floor(seconds / (3600 * 24)),
|
|
189
|
+
hours: Math.floor(seconds / 3600 % 24),
|
|
190
|
+
minutes: Math.floor(seconds / 60 % 60),
|
|
191
|
+
seconds: Math.floor(seconds % 60),
|
|
192
|
+
milliseconds: Number((seconds % 1 * 1000).toFixed()),
|
|
193
|
+
completed: total <= 0
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function formatTimeDelta(timeDelta, options) {
|
|
197
|
+
var days = timeDelta.days,
|
|
198
|
+
hours = timeDelta.hours,
|
|
199
|
+
minutes = timeDelta.minutes,
|
|
200
|
+
seconds = timeDelta.seconds;
|
|
201
|
+
|
|
202
|
+
var _Object$assign = Object.assign(Object.assign({}, timeDeltaFormatOptionsDefaults), options),
|
|
203
|
+
daysInHours = _Object$assign.daysInHours,
|
|
204
|
+
zeroPadTime = _Object$assign.zeroPadTime,
|
|
205
|
+
_Object$assign$zeroPa = _Object$assign.zeroPadDays,
|
|
206
|
+
zeroPadDays = _Object$assign$zeroPa === void 0 ? zeroPadTime : _Object$assign$zeroPa;
|
|
207
|
+
|
|
208
|
+
var zeroPadTimeLength = Math.min(2, zeroPadTime);
|
|
209
|
+
var formattedHours = daysInHours ? zeroPad(hours + days * 24, zeroPadTime) : zeroPad(hours, zeroPadTimeLength);
|
|
210
|
+
return {
|
|
211
|
+
days: daysInHours ? '' : zeroPad(days, zeroPadDays),
|
|
212
|
+
hours: formattedHours,
|
|
213
|
+
minutes: zeroPad(minutes, zeroPadTimeLength),
|
|
214
|
+
seconds: zeroPad(seconds, zeroPadTimeLength)
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
var Countdown$1 = function (_React$Component) {
|
|
219
|
+
_inherits(Countdown, _React$Component);
|
|
220
|
+
|
|
221
|
+
var _super = _createSuper(Countdown);
|
|
222
|
+
|
|
223
|
+
function Countdown() {
|
|
224
|
+
var _this;
|
|
225
|
+
|
|
226
|
+
_classCallCheck(this, Countdown);
|
|
227
|
+
|
|
228
|
+
_this = _super.apply(this, arguments);
|
|
229
|
+
_this.state = {
|
|
230
|
+
count: _this.props.count || 3
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
_this.startCountdown = function () {
|
|
234
|
+
_this.interval = window.setInterval(function () {
|
|
235
|
+
var count = _this.state.count - 1;
|
|
236
|
+
|
|
237
|
+
if (count === 0) {
|
|
238
|
+
_this.stopCountdown();
|
|
239
|
+
|
|
240
|
+
_this.props.onComplete && _this.props.onComplete();
|
|
241
|
+
} else {
|
|
242
|
+
_this.setState(function (prevState) {
|
|
243
|
+
return {
|
|
244
|
+
count: prevState.count - 1
|
|
245
|
+
};
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}, 1000);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
_this.stopCountdown = function () {
|
|
252
|
+
clearInterval(_this.interval);
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
_this.addTime = function (seconds) {
|
|
256
|
+
_this.stopCountdown();
|
|
257
|
+
|
|
258
|
+
_this.setState(function (prevState) {
|
|
259
|
+
return {
|
|
260
|
+
count: prevState.count + seconds
|
|
261
|
+
};
|
|
262
|
+
}, _this.startCountdown);
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
return _this;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
_createClass(Countdown, [{
|
|
269
|
+
key: "componentDidMount",
|
|
270
|
+
value: function componentDidMount() {
|
|
271
|
+
this.startCountdown();
|
|
272
|
+
}
|
|
273
|
+
}, {
|
|
274
|
+
key: "componentWillUnmount",
|
|
275
|
+
value: function componentWillUnmount() {
|
|
276
|
+
clearInterval(this.interval);
|
|
277
|
+
}
|
|
278
|
+
}, {
|
|
279
|
+
key: "render",
|
|
280
|
+
value: function render() {
|
|
281
|
+
return this.props.children ? React.cloneElement(this.props.children, {
|
|
282
|
+
count: this.state.count
|
|
283
|
+
}) : null;
|
|
284
|
+
}
|
|
285
|
+
}]);
|
|
286
|
+
|
|
287
|
+
return Countdown;
|
|
288
|
+
}(React.Component);
|
|
289
|
+
Countdown$1.propTypes = {
|
|
290
|
+
count: index.propTypesExports.number,
|
|
291
|
+
children: index.propTypesExports.element,
|
|
292
|
+
onComplete: index.propTypesExports.func
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
var Countdown$1$1 = function (_React$Component) {
|
|
296
|
+
_inherits(Countdown$1$1, _React$Component);
|
|
297
|
+
|
|
298
|
+
var _super = _createSuper(Countdown$1$1);
|
|
299
|
+
|
|
300
|
+
function Countdown$1$1(props) {
|
|
301
|
+
var _this;
|
|
302
|
+
|
|
303
|
+
_classCallCheck(this, Countdown$1$1);
|
|
304
|
+
|
|
305
|
+
_this = _super.call(this, props);
|
|
306
|
+
_this.mounted = false;
|
|
307
|
+
_this.initialTimestamp = _this.calcOffsetStartTimestamp();
|
|
308
|
+
_this.offsetStartTimestamp = _this.props.autoStart ? 0 : _this.initialTimestamp;
|
|
309
|
+
_this.offsetTime = 0;
|
|
310
|
+
_this.legacyMode = false;
|
|
311
|
+
_this.legacyCountdownRef = React.createRef();
|
|
312
|
+
|
|
313
|
+
_this.tick = function () {
|
|
314
|
+
var timeDelta = _this.calcTimeDelta();
|
|
315
|
+
|
|
316
|
+
var callback = timeDelta.completed && !_this.props.overtime ? undefined : _this.props.onTick;
|
|
317
|
+
|
|
318
|
+
_this.setTimeDeltaState(timeDelta, undefined, callback);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
_this.start = function () {
|
|
322
|
+
if (_this.isStarted()) return;
|
|
323
|
+
var prevOffsetStartTimestamp = _this.offsetStartTimestamp;
|
|
324
|
+
_this.offsetStartTimestamp = 0;
|
|
325
|
+
_this.offsetTime += prevOffsetStartTimestamp ? _this.calcOffsetStartTimestamp() - prevOffsetStartTimestamp : 0;
|
|
326
|
+
|
|
327
|
+
var timeDelta = _this.calcTimeDelta();
|
|
328
|
+
|
|
329
|
+
_this.setTimeDeltaState(timeDelta, "STARTED", _this.props.onStart);
|
|
330
|
+
|
|
331
|
+
if (!_this.props.controlled && (!timeDelta.completed || _this.props.overtime)) {
|
|
332
|
+
_this.clearTimer();
|
|
333
|
+
|
|
334
|
+
_this.interval = window.setInterval(_this.tick, _this.props.intervalDelay);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
_this.pause = function () {
|
|
339
|
+
if (_this.isPaused()) return;
|
|
340
|
+
|
|
341
|
+
_this.clearTimer();
|
|
342
|
+
|
|
343
|
+
_this.offsetStartTimestamp = _this.calcOffsetStartTimestamp();
|
|
344
|
+
|
|
345
|
+
_this.setTimeDeltaState(_this.state.timeDelta, "PAUSED", _this.props.onPause);
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
_this.stop = function () {
|
|
349
|
+
if (_this.isStopped()) return;
|
|
350
|
+
|
|
351
|
+
_this.clearTimer();
|
|
352
|
+
|
|
353
|
+
_this.offsetStartTimestamp = _this.calcOffsetStartTimestamp();
|
|
354
|
+
_this.offsetTime = _this.offsetStartTimestamp - _this.initialTimestamp;
|
|
355
|
+
|
|
356
|
+
_this.setTimeDeltaState(_this.calcTimeDelta(), "STOPPED", _this.props.onStop);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
_this.isStarted = function () {
|
|
360
|
+
return _this.isStatus("STARTED");
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
_this.isPaused = function () {
|
|
364
|
+
return _this.isStatus("PAUSED");
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
_this.isStopped = function () {
|
|
368
|
+
return _this.isStatus("STOPPED");
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
_this.isCompleted = function () {
|
|
372
|
+
return _this.isStatus("COMPLETED");
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
if (props.date) {
|
|
376
|
+
var timeDelta = _this.calcTimeDelta();
|
|
377
|
+
|
|
378
|
+
_this.state = {
|
|
379
|
+
timeDelta: timeDelta,
|
|
380
|
+
status: timeDelta.completed ? "COMPLETED" : "STOPPED"
|
|
381
|
+
};
|
|
382
|
+
} else {
|
|
383
|
+
_this.legacyMode = true;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return _this;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
_createClass(Countdown$1$1, [{
|
|
390
|
+
key: "componentDidMount",
|
|
391
|
+
value: function componentDidMount() {
|
|
392
|
+
if (this.legacyMode) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
this.mounted = true;
|
|
397
|
+
if (this.props.onMount) this.props.onMount(this.calcTimeDelta());
|
|
398
|
+
if (this.props.autoStart) this.start();
|
|
399
|
+
}
|
|
400
|
+
}, {
|
|
401
|
+
key: "componentDidUpdate",
|
|
402
|
+
value: function componentDidUpdate(prevProps) {
|
|
403
|
+
if (this.legacyMode) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if (this.props.date !== prevProps.date) {
|
|
408
|
+
this.initialTimestamp = this.calcOffsetStartTimestamp();
|
|
409
|
+
this.offsetStartTimestamp = this.initialTimestamp;
|
|
410
|
+
this.offsetTime = 0;
|
|
411
|
+
this.setTimeDeltaState(this.calcTimeDelta());
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}, {
|
|
415
|
+
key: "componentWillUnmount",
|
|
416
|
+
value: function componentWillUnmount() {
|
|
417
|
+
if (this.legacyMode) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
this.mounted = false;
|
|
422
|
+
this.clearTimer();
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
key: "calcTimeDelta",
|
|
426
|
+
value: function calcTimeDelta$1() {
|
|
427
|
+
var _this$props = this.props,
|
|
428
|
+
date = _this$props.date,
|
|
429
|
+
now = _this$props.now,
|
|
430
|
+
precision = _this$props.precision,
|
|
431
|
+
controlled = _this$props.controlled,
|
|
432
|
+
overtime = _this$props.overtime;
|
|
433
|
+
return calcTimeDelta(date, {
|
|
434
|
+
now: now,
|
|
435
|
+
precision: precision,
|
|
436
|
+
controlled: controlled,
|
|
437
|
+
offsetTime: this.offsetTime,
|
|
438
|
+
overtime: overtime
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}, {
|
|
442
|
+
key: "calcOffsetStartTimestamp",
|
|
443
|
+
value: function calcOffsetStartTimestamp() {
|
|
444
|
+
return Date.now();
|
|
445
|
+
}
|
|
446
|
+
}, {
|
|
447
|
+
key: "addTime",
|
|
448
|
+
value: function addTime(seconds) {
|
|
449
|
+
this.legacyCountdownRef.current.addTime(seconds);
|
|
450
|
+
}
|
|
451
|
+
}, {
|
|
452
|
+
key: "clearTimer",
|
|
453
|
+
value: function clearTimer() {
|
|
454
|
+
window.clearInterval(this.interval);
|
|
455
|
+
}
|
|
456
|
+
}, {
|
|
457
|
+
key: "isStatus",
|
|
458
|
+
value: function isStatus(status) {
|
|
459
|
+
return this.state.status === status;
|
|
460
|
+
}
|
|
461
|
+
}, {
|
|
462
|
+
key: "setTimeDeltaState",
|
|
463
|
+
value: function setTimeDeltaState(timeDelta, status, callback) {
|
|
464
|
+
var _this2 = this;
|
|
465
|
+
|
|
466
|
+
if (!this.mounted) return;
|
|
467
|
+
var completing = timeDelta.completed && !this.state.timeDelta.completed;
|
|
468
|
+
var completedOnStart = timeDelta.completed && status === "STARTED";
|
|
469
|
+
|
|
470
|
+
if (completing && !this.props.overtime) {
|
|
471
|
+
this.clearTimer();
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
var onDone = function onDone() {
|
|
475
|
+
if (callback) callback(_this2.state.timeDelta);
|
|
476
|
+
|
|
477
|
+
if (_this2.props.onComplete && (completing || completedOnStart)) {
|
|
478
|
+
_this2.props.onComplete(timeDelta, completedOnStart);
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
return this.setState(function (prevState) {
|
|
483
|
+
var newStatus = status || prevState.status;
|
|
484
|
+
|
|
485
|
+
if (timeDelta.completed && !_this2.props.overtime) {
|
|
486
|
+
newStatus = "COMPLETED";
|
|
487
|
+
} else if (!status && newStatus === "COMPLETED") {
|
|
488
|
+
newStatus = "STOPPED";
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
return {
|
|
492
|
+
timeDelta: timeDelta,
|
|
493
|
+
status: newStatus
|
|
494
|
+
};
|
|
495
|
+
}, onDone);
|
|
496
|
+
}
|
|
497
|
+
}, {
|
|
498
|
+
key: "getApi",
|
|
499
|
+
value: function getApi() {
|
|
500
|
+
return this.api = this.api || {
|
|
501
|
+
start: this.start,
|
|
502
|
+
pause: this.pause,
|
|
503
|
+
stop: this.stop,
|
|
504
|
+
isStarted: this.isStarted,
|
|
505
|
+
isPaused: this.isPaused,
|
|
506
|
+
isStopped: this.isStopped,
|
|
507
|
+
isCompleted: this.isCompleted
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
}, {
|
|
511
|
+
key: "getRenderProps",
|
|
512
|
+
value: function getRenderProps() {
|
|
513
|
+
var _this$props2 = this.props,
|
|
514
|
+
daysInHours = _this$props2.daysInHours,
|
|
515
|
+
zeroPadTime = _this$props2.zeroPadTime,
|
|
516
|
+
zeroPadDays = _this$props2.zeroPadDays;
|
|
517
|
+
var timeDelta = this.state.timeDelta;
|
|
518
|
+
return Object.assign(Object.assign({}, timeDelta), {
|
|
519
|
+
api: this.getApi(),
|
|
520
|
+
props: this.props,
|
|
521
|
+
formatted: formatTimeDelta(timeDelta, {
|
|
522
|
+
daysInHours: daysInHours,
|
|
523
|
+
zeroPadTime: zeroPadTime,
|
|
524
|
+
zeroPadDays: zeroPadDays
|
|
525
|
+
})
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}, {
|
|
529
|
+
key: "render",
|
|
530
|
+
value: function render() {
|
|
531
|
+
if (this.legacyMode) {
|
|
532
|
+
var _this$props3 = this.props,
|
|
533
|
+
count = _this$props3.count,
|
|
534
|
+
_children = _this$props3.children,
|
|
535
|
+
onComplete = _this$props3.onComplete;
|
|
536
|
+
return React.createElement(Countdown$1, {
|
|
537
|
+
ref: this.legacyCountdownRef,
|
|
538
|
+
count: count,
|
|
539
|
+
onComplete: onComplete
|
|
540
|
+
}, _children);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
var _this$props4 = this.props,
|
|
544
|
+
className = _this$props4.className,
|
|
545
|
+
overtime = _this$props4.overtime,
|
|
546
|
+
children = _this$props4.children,
|
|
547
|
+
renderer = _this$props4.renderer;
|
|
548
|
+
var renderProps = this.getRenderProps();
|
|
549
|
+
|
|
550
|
+
if (renderer) {
|
|
551
|
+
return renderer(renderProps);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
if (children && this.state.timeDelta.completed && !overtime) {
|
|
555
|
+
return React.cloneElement(children, {
|
|
556
|
+
countdown: renderProps
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
var _renderProps$formatte = renderProps.formatted,
|
|
561
|
+
days = _renderProps$formatte.days,
|
|
562
|
+
hours = _renderProps$formatte.hours,
|
|
563
|
+
minutes = _renderProps$formatte.minutes,
|
|
564
|
+
seconds = _renderProps$formatte.seconds;
|
|
565
|
+
return React.createElement("span", {
|
|
566
|
+
className: className
|
|
567
|
+
}, renderProps.total < 0 ? '-' : '', days, days ? ':' : '', hours, ":", minutes, ":", seconds);
|
|
568
|
+
}
|
|
569
|
+
}]);
|
|
570
|
+
|
|
571
|
+
return Countdown$1$1;
|
|
572
|
+
}(React.Component);
|
|
573
|
+
Countdown$1$1.defaultProps = Object.assign(Object.assign({}, timeDeltaFormatOptionsDefaults), {
|
|
574
|
+
controlled: false,
|
|
575
|
+
intervalDelay: 1000,
|
|
576
|
+
precision: 0,
|
|
577
|
+
autoStart: true
|
|
578
|
+
});
|
|
579
|
+
Countdown$1$1.propTypes = {
|
|
580
|
+
date: index.propTypesExports.oneOfType([index.propTypesExports.instanceOf(Date), index.propTypesExports.string, index.propTypesExports.number]),
|
|
581
|
+
daysInHours: index.propTypesExports.bool,
|
|
582
|
+
zeroPadTime: index.propTypesExports.number,
|
|
583
|
+
zeroPadDays: index.propTypesExports.number,
|
|
584
|
+
controlled: index.propTypesExports.bool,
|
|
585
|
+
intervalDelay: index.propTypesExports.number,
|
|
586
|
+
precision: index.propTypesExports.number,
|
|
587
|
+
autoStart: index.propTypesExports.bool,
|
|
588
|
+
overtime: index.propTypesExports.bool,
|
|
589
|
+
className: index.propTypesExports.string,
|
|
590
|
+
children: index.propTypesExports.element,
|
|
591
|
+
renderer: index.propTypesExports.func,
|
|
592
|
+
now: index.propTypesExports.func,
|
|
593
|
+
onMount: index.propTypesExports.func,
|
|
594
|
+
onStart: index.propTypesExports.func,
|
|
595
|
+
onPause: index.propTypesExports.func,
|
|
596
|
+
onStop: index.propTypesExports.func,
|
|
597
|
+
onTick: index.propTypesExports.func,
|
|
598
|
+
onComplete: index.propTypesExports.func
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
function computeTimeUnit(remainder, unit) {
|
|
602
|
+
return parseInt(remainder, 10) !== 1 ? `${unit}s` : unit;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function Countdown({ date: inputDate, onComplete, showUnits, granularity = "dhms", }) {
|
|
606
|
+
const date = React.useMemo(() => {
|
|
607
|
+
let initDate;
|
|
608
|
+
if (inputDate instanceof temporal.CivilDate) {
|
|
609
|
+
initDate = new Date(inputDate.year, inputDate.month - 1, inputDate.day);
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
initDate = new Date(inputDate);
|
|
613
|
+
}
|
|
614
|
+
return initDate;
|
|
615
|
+
}, [inputDate]);
|
|
616
|
+
return (React.createElement(Countdown$1$1, { date: date, zeroPadTime: 2, renderer: (props) => (React.createElement(RenderedCountdown, Object.assign({}, props, { granularity: granularity, showUnits: showUnits }))), onComplete: onComplete }));
|
|
617
|
+
}
|
|
618
|
+
function RenderedCountdown({ formatted, granularity = "dhms", showUnits, }) {
|
|
619
|
+
const { days, hours, minutes, seconds } = formatted;
|
|
620
|
+
return React.createElement(React.Fragment, null, buildTime());
|
|
621
|
+
function buildTime() {
|
|
622
|
+
const totalHours = 24 * Number(days) + Number(hours);
|
|
623
|
+
const totalMinutes = 60 * totalHours + Number(minutes);
|
|
624
|
+
const totalSeconds = 60 * totalMinutes + Number(seconds);
|
|
625
|
+
const times = {
|
|
626
|
+
d: { total: days, remainder: days, unit: computeTimeUnit(days, "day") },
|
|
627
|
+
h: {
|
|
628
|
+
total: totalHours,
|
|
629
|
+
remainder: hours,
|
|
630
|
+
unit: computeTimeUnit(hours, "hour"),
|
|
631
|
+
},
|
|
632
|
+
m: {
|
|
633
|
+
total: totalMinutes,
|
|
634
|
+
remainder: minutes,
|
|
635
|
+
unit: computeTimeUnit(minutes, "minute"),
|
|
636
|
+
},
|
|
637
|
+
s: {
|
|
638
|
+
total: totalSeconds,
|
|
639
|
+
remainder: seconds,
|
|
640
|
+
unit: computeTimeUnit(seconds, "second"),
|
|
641
|
+
},
|
|
642
|
+
};
|
|
643
|
+
return timeFormatter(times, granularity, showUnits);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
function timeFormatter(times, granularity, showUnits) {
|
|
647
|
+
let substr = "";
|
|
648
|
+
granularity.split("").forEach((unit, i) => {
|
|
649
|
+
if (i == 0) {
|
|
650
|
+
substr += `${times[unit].total}${showUnits ? ` ${times[unit].unit}` : ""}`;
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
substr += ` : ${times[unit].remainder}${showUnits ? ` ${times[unit].unit}` : ""}`;
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
return substr;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
exports.Countdown = Countdown;
|