@rpcbase/ui 0.280.0 → 0.282.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AddressAutocompleteInput/index.d.ts +1 -1
- package/dist/components/AddressAutocompleteInput/index.d.ts.map +1 -1
- package/dist/components/ApplePayButton/index.d.ts +1 -1
- package/dist/components/ApplePayButton/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/DayPickerField/index.d.ts +2 -2
- package/dist/components/DayPickerField/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.d.ts +9 -9
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/FilesUploadField/index.d.ts +1 -1
- package/dist/components/FilesUploadField/index.d.ts.map +1 -1
- package/dist/components/HourPickerField/index.d.ts +2 -2
- package/dist/components/HourPickerField/index.d.ts.map +1 -1
- package/dist/components/I18nField/index.d.ts +1 -1
- package/dist/components/I18nField/index.d.ts.map +1 -1
- package/dist/components/Image/index.d.ts +1 -1
- package/dist/components/Image/index.d.ts.map +1 -1
- package/dist/components/ImagesField/index.d.ts +1 -1
- package/dist/components/ImagesField/index.d.ts.map +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Notifications/NotificationsButton.d.ts +1 -1
- package/dist/components/Notifications/NotificationsButton.d.ts.map +1 -1
- package/dist/components/Notifications/NotificationsDrawer.d.ts +1 -1
- package/dist/components/Notifications/NotificationsDrawer.d.ts.map +1 -1
- package/dist/components/Notifications/NotificationsSettings.d.ts +1 -1
- package/dist/components/Notifications/NotificationsSettings.d.ts.map +1 -1
- package/dist/components/PhoneNumberInput/suggestions.d.ts +3 -3
- package/dist/components/PhoneNumberInput/suggestions.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/header/MenuPopover/index.d.ts +1 -1
- package/dist/components/header/MenuPopover/index.d.ts.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index10.js +6 -4
- package/dist/index10.js.map +1 -1
- package/dist/index12.js.map +1 -1
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +88 -88
- package/dist/index14.js.map +1 -1
- package/dist/index15.js.map +1 -1
- package/dist/index154.js +19 -7
- package/dist/index154.js.map +1 -1
- package/dist/index16.js +36 -45
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +3 -3
- package/dist/index160.js.map +1 -1
- package/dist/index166.js +5 -5
- package/dist/index166.js.map +1 -1
- package/dist/index172.js +27 -25
- package/dist/index172.js.map +1 -1
- package/dist/index181.js +1 -1
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +145 -162
- package/dist/index182.js.map +1 -1
- package/dist/index184.js +6 -8
- package/dist/index184.js.map +1 -1
- package/dist/index186.js +2 -8
- package/dist/index186.js.map +1 -1
- package/dist/index19.js +1 -1
- package/dist/index19.js.map +1 -1
- package/dist/index195.js +1 -1
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +2 -2
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +1 -1
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +16 -15
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +13 -17
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +3 -2
- package/dist/index200.js.map +1 -1
- package/dist/index207.js +5 -90
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +15 -3
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +102 -22
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +3 -28
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +23 -19
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +27 -6
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +19 -14
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -6
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +14 -26
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +7 -22
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +27 -6
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +23 -5
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +6 -4
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +5 -4
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +4 -24
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +4 -3
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +21 -21
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +3 -23
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +23 -6
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +22 -9
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +5 -17
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +8 -49
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +18 -5
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +50 -19
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +20 -28
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +27 -104
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +98 -33
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +28 -113
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +117 -11
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +12 -4
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +4 -15
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +13 -62
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +64 -9
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +10 -106
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +107 -13
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +16 -13
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +13 -5
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +4 -316
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +315 -58
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +58 -223
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +215 -318
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +250 -306
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +308 -173
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +178 -7
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +8 -15
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +41 -5
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +46 -38
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +7 -50
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +49 -6
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +48 -46
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +6 -51
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +10 -9
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +60 -8
- package/dist/index259.js.map +1 -1
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +41 -60
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +88 -34
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +47 -94
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +36 -49
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +45 -32
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +47 -46
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +18 -48
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +174 -15
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +47 -169
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +17 -34
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +59 -10
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +10 -66
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +4 -4
- package/dist/index273.js +71 -69
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +158 -152
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +7 -13
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +12 -5
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +12 -6
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +11 -12
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +65 -9
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +6 -74
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +25 -6
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +24 -24
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +125 -24
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +52 -115
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +59 -55
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +48 -61
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +5 -48
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +14 -8
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +18 -14
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +10 -17
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +23 -11
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +52 -25
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +6 -52
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +137 -5
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +59 -149
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +90 -49
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +11 -117
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +863 -11
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +21 -865
- package/dist/index299.js.map +1 -1
- package/dist/index3.js.map +1 -1
- package/dist/index300.js +417 -27
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +774 -483
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +7436 -803
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +7 -7429
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +12 -6
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +5 -12
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +3 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +469 -5
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +32 -464
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +18 -36
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +28 -17
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +4 -30
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +59 -4
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +11 -59
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +5 -9
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +9 -5
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +12 -9
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +3 -13
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +17 -3
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +23 -14
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +39 -23
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +5 -41
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +25 -5
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +18 -24
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +32 -17
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +5 -34
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +9 -5
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +7 -8
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +9 -8
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +10 -9
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +7 -10
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +75 -7
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +153 -66
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +99 -147
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +13 -113
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +78 -12
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +23 -57
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +12 -45
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +16 -13
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +100 -15
- package/dist/index339.js.map +1 -1
- package/dist/index340.js +50 -95
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +57 -5
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +41 -78
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +100 -58
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +46 -104
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +39 -51
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +143 -42
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +122 -123
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +224 -108
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +158 -174
- package/dist/index349.js.map +1 -1
- package/dist/index350.js +213 -144
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +5 -309
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +6 -5
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +7 -6
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +4 -5
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +4 -4
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +21 -6
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +10 -21
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +128 -10
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +36 -122
- package/dist/index359.js.map +1 -1
- package/dist/index360.js +64 -38
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +115 -66
- package/dist/index361.js.map +1 -1
- package/dist/index362.js +485 -112
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +7 -490
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +1 -1
- package/dist/index364.js.map +1 -1
- package/dist/index367.js +2 -9
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +26 -5
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +43 -27
- package/dist/index369.js.map +1 -1
- package/dist/index370.js +35 -46
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +16 -27
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +41 -16
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +11 -42
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +10 -14
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +51 -9
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +40 -53
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +17 -43
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +4 -15
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +4 -4
- package/dist/index379.js.map +1 -1
- package/dist/index380.js +9 -4
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +304 -9
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +4 -339
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +21 -5
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +106 -16
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +19 -109
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +18 -18
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +14 -19
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +12 -4
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +113 -20
- package/dist/index389.js.map +1 -1
- package/dist/index390.js +5 -11
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +28 -85
- package/dist/index391.js.map +1 -1
- package/dist/index392.js +9 -9
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +6 -29
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +254 -10
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +12 -6
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +11 -252
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +6 -11
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +22 -10
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +22 -6
- package/dist/index399.js.map +1 -1
- package/dist/index4.js.map +1 -1
- package/dist/index400.js +103 -21
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +15 -23
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +11 -108
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +10 -15
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +237 -10
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +27 -9
- package/dist/index405.js.map +1 -1
- package/dist/index406.js +33 -238
- package/dist/index406.js.map +1 -1
- package/dist/index407.js +11 -30
- package/dist/index407.js.map +1 -1
- package/dist/index408.js +118 -48
- package/dist/index408.js.map +1 -1
- package/dist/index409.js +39 -11
- package/dist/index409.js.map +1 -1
- package/dist/index410.js +18 -121
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +11 -39
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +21 -24
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +17 -11
- package/dist/index413.js.map +1 -1
- package/dist/index414.js +10 -20
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +4 -17
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +300 -14
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +61 -323
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +4 -63
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +28 -4
- package/dist/index419.js.map +1 -1
- package/dist/index420.js +468 -25
- package/dist/index420.js.map +1 -1
- package/dist/index421.js +250 -452
- package/dist/index421.js.map +1 -1
- package/dist/index6.js.map +1 -1
- package/dist/index7.js +91 -133
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +2 -2
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +11 -4
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +1 -3
- package/dist/index72.js.map +1 -1
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +16 -19
- package/dist/index9.js.map +1 -1
- package/dist/test-only/TestCoverageTestBadge/index.d.ts +1 -1
- package/dist/test-only/TestCoverageTestBadge/index.d.ts.map +1 -1
- package/package.json +15 -15
- package/dist/index422.js +0 -272
- package/dist/index422.js.map +0 -1
package/dist/index182.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index182.js","names":["ChevronLeft","ChevronRight","CalendarDays","React","createPortal","DayPicker","ReactDayPicker","dateMatchModifiers","IMaskInput","IMask","InputMask","useIsTouchDevice","cn","imaskAny","DayPickerProps","ComponentProps","t0","$","_c","className","classNames","components","props","t1","showOutsideDays","undefined","t2","t3","month","months","month_caption","month_grid","caption_label","nav","button_previous","button_next","weeks","weekdays","weekday","week","day","day_button","range_start","range_end","range_middle","selected","today","outside","disabled","hidden","t4","Chevron","_temp","t5","chevronProps","orientation","displayName","pad2","value","String","padStart","startOfDay","date","Date","next","setHours","startOfMonth","getFullYear","getMonth","formatDayInput","getDate","buildDate","year","Number","isFinite","parseDayInput","now","trimmed","trim","full","exec","shortYear","noYear","DayPickerInputProps","Omit","onChange","onValueUpdate","inputClassName","open","onOpenChange","dayPickerComponent","ComponentType","dayPickerProps","DayPickerInput","forwardRef","HTMLInputElement","placeholder","readOnly","openProp","onFocus","onBlur","onKeyDown","onPointerDown","onMouseDown","rest","forwardedRef","rootRef","useRef","HTMLDivElement","popoverRef","inputRef","isFocusedRef","openRef","pointerDownOnInputRef","inputWasFocusedOnPointerDownRef","pointerDownInPopoverRef","ignoreNextMaskCompleteValueRef","uncontrolledOpen","setUncontrolledOpen","useState","setOpen","current","draft","setDraft","draftSelection","useMemo","setMonth","popoverPosition","setPopoverPosition","left","top","updateValue","useCallback","commitValue","useEffect","ownerDocument","document","ownerWindow","defaultView","window","handlePointerDown","event","PointerEvent","target","Node","contains","handleKeyDown","KeyboardEvent","key","preventDefault","stopPropagation","addEventListener","removeEventListener","root","isActive","observer","IntersectionObserver","entries","entry","isIntersecting","observe","disconnect","setRefs","node","closePopover","DayPickerComponent","updatePopoverPosition","popover","rect","getBoundingClientRect","popoverWidth","offsetWidth","popoverHeight","offsetHeight","viewportWidth","innerWidth","viewportHeight","innerHeight","padding","Math","max","bottom","overflowBottom","aboveTop","useLayoutEffect","rafId","requestAnimationFrame","cancelAnimationFrame","mask","lazy","appended","dynamicMasked","digits","replace","length","compiledMasks","nextValue","previousDigitsLength","completedValue","parsed","getTime","activeElement","currentTarget","shouldSelectAll","element","select","wasDefaultPrevented","defaultPrevented","isoDay","dayButton","querySelector","HTMLButtonElement","focus","base","setDate","formatted","shouldReopen","ctrlKey","metaKey","altKey","blurFromPopoverPointerDown","relatedTarget","preventScroll","selectedDay","normalized","body","DayPickerFieldProps","id","triggerTestId","isHydrated","DayPickerButtonField","DayPickerField","isTouchDevice"],"sources":["../src/components/DayPickerField/index.tsx"],"sourcesContent":["import { ChevronLeft, ChevronRight, CalendarDays } from \"lucide-react\"\nimport * as React from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { DayPicker as ReactDayPicker, dateMatchModifiers } from \"react-day-picker\"\nimport { IMaskInput } from \"react-imask\"\nimport IMask, { InputMask } from \"imask\"\n\nimport { useIsTouchDevice } from \"@/helpers/useIsTouchDevice\"\nimport { cn } from \"@/lib/utils\"\n\n\n// WARNING: used to preserve input mask even with tree shaking\n// DO NOT REMOVE THIS CODE OR THIS COMMENT\nconst imaskAny = IMask as any\nif (typeof imaskAny.InputMask !== \"function\") {\n imaskAny.InputMask = InputMask\n}\n\n\nexport type DayPickerProps = React.ComponentProps<typeof ReactDayPicker>\n\nexport function DayPicker({\n className,\n classNames,\n components,\n showOutsideDays = true,\n ...props\n}: DayPickerProps) {\n return (\n <ReactDayPicker\n weekStartsOn={1}\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n month: \"space-y-4\",\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-y-0 relative gap-2\",\n month_caption: \"flex justify-center pt-1 relative items-center\",\n month_grid: \"w-full border-collapse space-y-1\",\n caption_label: \"text-sm font-medium\",\n nav: \"flex items-center justify-between absolute inset-x-0 z-10\",\n button_previous:\n \"inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent p-0 opacity-50 shadow-sm transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 z-10\",\n button_next:\n \"inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent p-0 opacity-50 shadow-sm transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 z-10\",\n weeks: \"w-full border-collapse\",\n weekdays: \"flex\",\n weekday: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n week: \"flex w-full mt-2\",\n day: \"h-9 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md first:aria-selected:rounded-l-md last:aria-selected:rounded-r-md\",\n day_button:\n \"inline-flex h-9 w-9 items-center justify-center rounded-md p-0 text-center text-sm font-normal transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n range_start:\n \"day-range-start !bg-accent rounded-l-md [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground\",\n range_end:\n \"day-range-end !bg-accent rounded-r-md [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground\",\n range_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground !rounded-none\",\n selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n today: \"bg-gray-50 text-accent-foreground !rounded-md\",\n outside:\n \"day-outside text-muted-foreground opacity-50 !aria-selected:bg-accent/50 !aria-selected:text-muted-foreground !aria-selected:opacity-30\",\n disabled: \"text-muted-foreground opacity-50\",\n hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: (chevronProps) =>\n chevronProps.orientation === \"left\" ? (\n <ChevronLeft {...chevronProps} className=\"h-4 w-4\" />\n ) : (\n <ChevronRight {...chevronProps} className=\"h-4 w-4\" />\n ),\n ...components,\n }}\n {...props}\n />\n )\n}\n\nDayPicker.displayName = \"DayPicker\"\n\nfunction pad2(value: number) {\n return String(value).padStart(2, \"0\")\n}\n\nfunction startOfDay(date: Date) {\n const next = new Date(date)\n next.setHours(0, 0, 0, 0)\n return next\n}\n\nfunction startOfMonth(date: Date) {\n return startOfDay(new Date(date.getFullYear(), date.getMonth(), 1))\n}\n\nfunction formatDayInput(date: Date) {\n return `${pad2(date.getDate())}/${pad2(date.getMonth() + 1)}/${date.getFullYear()}`\n}\n\nfunction buildDate({ day, month, year }: { day: number; month: number; year: number }): Date | null {\n if (!Number.isFinite(day) || !Number.isFinite(month) || !Number.isFinite(year)) return null\n\n const date = new Date(year, month - 1, day)\n if (\n date.getFullYear() !== year ||\n date.getMonth() !== month - 1 ||\n date.getDate() !== day\n ) {\n return null\n }\n\n return startOfDay(date)\n}\n\nfunction parseDayInput(value: string, now: Date): Date | null {\n const trimmed = value.trim()\n if (!trimmed) return null\n\n const full = /^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/.exec(trimmed)\n if (full) {\n return buildDate({ day: Number(full[1]), month: Number(full[2]), year: Number(full[3]) })\n }\n\n const shortYear = /^(\\d{2})\\/(\\d{2})\\/(\\d{2})$/.exec(trimmed)\n if (shortYear) {\n const year = Number(shortYear[3])\n if (!Number.isFinite(year)) return null\n return buildDate({ day: Number(shortYear[1]), month: Number(shortYear[2]), year: 2000 + year })\n }\n\n const noYear = /^(\\d{2})\\/(\\d{2})$/.exec(trimmed)\n if (noYear) {\n return buildDate({ day: Number(noYear[1]), month: Number(noYear[2]), year: now.getFullYear() })\n }\n\n return null\n}\n\nexport type DayPickerInputProps = Omit<\n React.ComponentProps<\"input\">,\n \"value\" | \"defaultValue\" | \"onChange\" | \"type\"\n> & {\n value: Date | null\n onChange: (value: Date | null) => void\n onValueUpdate?: (value: Date | null) => void\n inputClassName?: string\n open?: boolean\n onOpenChange?: (open: boolean) => void\n dayPickerComponent?: React.ComponentType<DayPickerProps>\n dayPickerProps?: Omit<DayPickerProps, \"mode\" | \"selected\" | \"onSelect\" | \"month\" | \"onMonthChange\">\n}\n\nexport const DayPickerInput = React.forwardRef<HTMLInputElement, DayPickerInputProps>(\n function DayPickerInput(\n {\n value,\n onChange,\n onValueUpdate,\n className,\n inputClassName,\n placeholder = \"DD/MM/YYYY\",\n disabled,\n readOnly,\n open: openProp,\n onOpenChange,\n dayPickerComponent,\n dayPickerProps,\n onFocus,\n onBlur,\n onKeyDown,\n onPointerDown,\n onMouseDown,\n ...rest\n },\n forwardedRef,\n ) {\n const rootRef = React.useRef<HTMLDivElement | null>(null)\n const popoverRef = React.useRef<HTMLDivElement | null>(null)\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n const isFocusedRef = React.useRef(false)\n const openRef = React.useRef(false)\n const pointerDownOnInputRef = React.useRef(false)\n const inputWasFocusedOnPointerDownRef = React.useRef(false)\n const pointerDownInPopoverRef = React.useRef(false)\n const ignoreNextMaskCompleteValueRef = React.useRef<string | null>(null)\n\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false)\n const open = openProp ?? uncontrolledOpen\n const setOpen = onOpenChange ?? setUncontrolledOpen\n openRef.current = open\n const [draft, setDraft] = React.useState(() => (value ? formatDayInput(value) : \"\"))\n const draftSelection = React.useMemo(() => parseDayInput(draft, new Date()), [draft])\n const [month, setMonth] = React.useState(() => startOfMonth(value ?? new Date()))\n const [popoverPosition, setPopoverPosition] = React.useState(() => ({\n left: 0,\n top: 0,\n }))\n\n const updateValue = React.useCallback(\n (next: Date | null) => {\n if (onValueUpdate) {\n onValueUpdate(next)\n }\n },\n [onValueUpdate],\n )\n\n const commitValue = React.useCallback(\n (next: Date | null) => {\n if (onValueUpdate) {\n onValueUpdate(next)\n }\n onChange(next)\n },\n [onChange, onValueUpdate],\n )\n\n React.useEffect(() => {\n if (isFocusedRef.current) return\n setDraft(value ? formatDayInput(value) : \"\")\n }, [value])\n\n React.useEffect(() => {\n if (!open) return\n setMonth(startOfMonth(value ?? new Date()))\n }, [open, value])\n\n React.useEffect(() => {\n if (!open) return\n if (!draftSelection) return\n setMonth(startOfMonth(draftSelection))\n }, [draftSelection, open])\n\n React.useEffect(() => {\n if (!open) return\n\n const ownerDocument = rootRef.current?.ownerDocument ?? document\n const ownerWindow = ownerDocument.defaultView ?? window\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = event.target\n if (!(target instanceof Node)) return\n if (rootRef.current?.contains(target)) return\n if (popoverRef.current?.contains(target)) return\n setOpen(false)\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return\n if (!openRef.current) return\n const target = event.target\n if (!(target instanceof Node)) return\n if (!rootRef.current?.contains(target) && !popoverRef.current?.contains(target)) return\n event.preventDefault()\n event.stopPropagation()\n setOpen(false)\n }\n\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown, true)\n ownerWindow.addEventListener(\"keydown\", handleKeyDown, true)\n return () => {\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown, true)\n ownerWindow.removeEventListener(\"keydown\", handleKeyDown, true)\n }\n }, [open])\n\n React.useEffect(() => {\n if (!open) {\n return\n }\n if (typeof window === \"undefined\") {\n return\n }\n if (!(\"IntersectionObserver\" in window)) {\n return\n }\n\n const root = rootRef.current\n if (!root) {\n return\n }\n\n let isActive = true\n const observer = new IntersectionObserver(entries => {\n if (!isActive) {\n return\n }\n const entry = entries[0]\n if (entry && !entry.isIntersecting) {\n setOpen(false)\n }\n })\n observer.observe(root)\n return () => {\n isActive = false\n observer.disconnect()\n }\n }, [open])\n\n const setRefs = React.useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n if (typeof forwardedRef === \"function\") {\n forwardedRef(node)\n } else if (forwardedRef) {\n forwardedRef.current = node\n }\n },\n [forwardedRef],\n )\n\n const closePopover = () => setOpen(false)\n\n const DayPickerComponent = dayPickerComponent ?? DayPicker\n\n const updatePopoverPosition = React.useCallback(() => {\n if (typeof window === \"undefined\") return\n const root = rootRef.current\n const popover = popoverRef.current\n if (!root || !popover) return\n\n const rect = root.getBoundingClientRect()\n const popoverWidth = popover.offsetWidth\n const popoverHeight = popover.offsetHeight\n const viewportWidth = window.innerWidth ?? 0\n const viewportHeight = window.innerHeight ?? 0\n const padding = 8\n\n let left = rect.left\n if (left + popoverWidth > viewportWidth - padding) {\n left = Math.max(padding, viewportWidth - popoverWidth - padding)\n }\n if (left < padding) {\n left = padding\n }\n\n let top = rect.bottom + padding\n const overflowBottom = top + popoverHeight > viewportHeight - padding\n const aboveTop = rect.top - popoverHeight - padding\n if (overflowBottom && aboveTop >= padding) {\n top = aboveTop\n }\n\n if (top < padding) {\n top = padding\n }\n if (top + popoverHeight > viewportHeight - padding) {\n top = Math.max(padding, viewportHeight - popoverHeight - padding)\n }\n\n setPopoverPosition({ left, top })\n }, [])\n\n // React Compiler rejects hook aliasing (useIsomorphicLayoutEffect pattern), so we\n // call useLayoutEffect directly and keep the SSR guard inside the effect.\n React.useLayoutEffect(() => {\n if (!open || disabled) return\n if (typeof window === \"undefined\") return\n\n updatePopoverPosition()\n const rafId = window.requestAnimationFrame(updatePopoverPosition)\n\n window.addEventListener(\"scroll\", updatePopoverPosition, true)\n window.addEventListener(\"resize\", updatePopoverPosition)\n return () => {\n window.cancelAnimationFrame(rafId)\n window.removeEventListener(\"scroll\", updatePopoverPosition, true)\n window.removeEventListener(\"resize\", updatePopoverPosition)\n }\n }, [disabled, open, updatePopoverPosition])\n\n return (\n <div ref={rootRef} data-slot=\"day-picker-input\" className={cn(\"relative group\", className)}>\n <IMaskInput\n {...rest}\n data-slot=\"day-picker-input-input\"\n disabled={disabled}\n readOnly={readOnly}\n autoComplete=\"off\"\n inputRef={setRefs}\n mask={[\n { mask: \"00/00\", lazy: true },\n { mask: \"00/00/00\", lazy: true },\n { mask: \"00/00/0000\", lazy: true },\n ]}\n dispatch={(appended, dynamicMasked) => {\n const digits = (dynamicMasked.value + appended).replace(/\\D/g, \"\")\n if (digits.length <= 4) return dynamicMasked.compiledMasks[0]\n if (digits.length <= 6) return dynamicMasked.compiledMasks[1]\n return dynamicMasked.compiledMasks[2]\n }}\n placeholder={placeholder}\n value={draft}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background py-2 pr-3 pl-[37px] text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"transition-colors group-hover:bg-accent group-hover:text-accent-foreground\",\n inputClassName\n )}\n onAccept={(nextValue) => {\n const next = typeof nextValue === \"string\" ? nextValue : String(nextValue ?? \"\")\n const previousDigitsLength = draft.replace(/\\D/g, \"\").length\n setDraft(next)\n if (next.replace(/\\D/g, \"\").length === 0) {\n if (open) {\n setMonth(startOfMonth(new Date()))\n }\n if (previousDigitsLength !== 0) {\n updateValue(null)\n }\n }\n }}\n onComplete={(completedValue) => {\n const next = typeof completedValue === \"string\"\n ? completedValue\n : String(completedValue ?? \"\")\n if (ignoreNextMaskCompleteValueRef.current === next) {\n ignoreNextMaskCompleteValueRef.current = null\n return\n }\n const parsed = parseDayInput(next, new Date())\n if (!parsed) return\n if (value && parsed.getTime() === startOfDay(value).getTime()) {\n return\n }\n updateValue(parsed)\n }}\n onPointerDown={(event) => {\n pointerDownOnInputRef.current = true\n inputWasFocusedOnPointerDownRef.current =\n typeof document !== \"undefined\" && document.activeElement === event.currentTarget\n onPointerDown?.(event)\n }}\n onMouseDown={(event) => {\n pointerDownOnInputRef.current = true\n inputWasFocusedOnPointerDownRef.current =\n typeof document !== \"undefined\" && document.activeElement === event.currentTarget\n onMouseDown?.(event)\n }}\n onFocus={(event) => {\n const shouldSelectAll =\n !pointerDownOnInputRef.current || !inputWasFocusedOnPointerDownRef.current\n pointerDownOnInputRef.current = false\n inputWasFocusedOnPointerDownRef.current = false\n isFocusedRef.current = true\n onFocus?.(event)\n if (shouldSelectAll) {\n const element = event.currentTarget\n requestAnimationFrame(() => element.select())\n }\n if (!disabled) {\n setOpen(true)\n }\n }}\n onKeyDown={(event) => {\n const wasDefaultPrevented = event.defaultPrevented\n onKeyDown?.(event)\n if (!wasDefaultPrevented && event.defaultPrevented) {\n return\n }\n\n if (event.key === \"Enter\") {\n if (!draftSelection) {\n return\n }\n event.preventDefault()\n if (open) {\n const isoDay = `${draftSelection.getFullYear()}-${pad2(draftSelection.getMonth() + 1)}-${pad2(draftSelection.getDate())}`\n const dayButton = popoverRef.current?.querySelector(\n `[data-day='${isoDay}']:not([data-outside]) button`,\n )\n if (dayButton instanceof HTMLButtonElement) {\n if (dayButton.disabled) {\n return\n }\n dayButton.focus()\n }\n }\n setDraft(formatDayInput(draftSelection))\n commitValue(draftSelection)\n setOpen(false)\n return\n }\n\n if (event.key === \"ArrowUp\" || event.key === \"ArrowDown\") {\n const base = draftSelection ?? value\n if (!base) {\n return\n }\n\n const next = startOfDay(new Date(base))\n next.setDate(next.getDate() + (event.key === \"ArrowUp\" ? 1 : -1))\n\n if (dayPickerProps?.disabled && dateMatchModifiers(next, dayPickerProps.disabled)) {\n return\n }\n\n event.preventDefault()\n const formatted = formatDayInput(next)\n ignoreNextMaskCompleteValueRef.current = formatted\n setDraft(formatted)\n updateValue(next)\n }\n\n if (!open) {\n const shouldReopen =\n (event.key.length === 1 ||\n event.key === \"Backspace\" ||\n event.key === \"Delete\" ||\n event.key === \"ArrowUp\" ||\n event.key === \"ArrowDown\") &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n\n if (shouldReopen) {\n setOpen(true)\n }\n }\n\n if (event.key === \"Tab\" && !event.defaultPrevented) {\n setOpen(false)\n }\n }}\n onBlur={(event) => {\n isFocusedRef.current = false\n onBlur?.(event)\n const blurFromPopoverPointerDown = pointerDownInPopoverRef.current\n pointerDownInPopoverRef.current = false\n if (blurFromPopoverPointerDown) {\n return\n }\n\n const relatedTarget = event.relatedTarget\n if (relatedTarget instanceof Node) {\n const root = rootRef.current\n if (!root) {\n return\n }\n\n if (root.contains(relatedTarget) || popoverRef.current?.contains(relatedTarget)) {\n return\n }\n }\n\n if (open && typeof window !== \"undefined\") {\n requestAnimationFrame(() => {\n const root = rootRef.current\n if (!root) {\n return\n }\n const activeElement = document.activeElement\n if (\n activeElement &&\n (root.contains(activeElement) || popoverRef.current?.contains(activeElement))\n ) {\n return\n }\n setOpen(false)\n })\n }\n const trimmed = draft.trim()\n if (trimmed === \"\") {\n if (value) {\n setDraft(\"\")\n commitValue(null)\n }\n return\n }\n const parsed = parseDayInput(trimmed, new Date())\n if (parsed) {\n setDraft(formatDayInput(parsed))\n if (!value || parsed.getTime() !== startOfDay(value).getTime()) {\n commitValue(parsed)\n }\n return\n }\n setDraft(value ? formatDayInput(value) : \"\")\n }}\n />\n\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={disabled}\n aria-label=\"Open calendar\"\n data-slot=\"day-picker-input-trigger\"\n className=\"absolute left-[13px] top-1/2 -translate-y-1/2 text-muted-foreground transition-colors group-hover:text-accent-foreground\"\n onPointerDown={(event) => {\n event.preventDefault()\n if (disabled) {\n return\n }\n inputRef.current?.focus({ preventScroll: true })\n }}\n onMouseDown={(event) => {\n event.preventDefault()\n if (disabled) {\n return\n }\n inputRef.current?.focus({ preventScroll: true })\n }}\n onClick={() => {\n if (disabled) {\n return\n }\n inputRef.current?.focus({ preventScroll: true })\n setOpen(true)\n }}\n >\n <CalendarDays aria-hidden className=\"size-4\" />\n </button>\n\n {open && !disabled && (() => {\n const selectedDay = draft.trim() === \"\"\n ? undefined\n : draftSelection ?? value ?? undefined\n\n const popover = (\n <>\n <div\n ref={popoverRef}\n data-slot=\"day-picker-input-popover\"\n className=\"pointer-events-auto fixed z-[60] w-max rounded-md border bg-popover text-popover-foreground shadow-md\"\n style={{ left: popoverPosition.left, top: popoverPosition.top }}\n onPointerDownCapture={() => {\n pointerDownInPopoverRef.current = true\n }}\n onMouseDownCapture={() => {\n pointerDownInPopoverRef.current = true\n }}\n >\n <DayPickerComponent\n mode=\"single\"\n month={month}\n onMonthChange={setMonth}\n selected={selectedDay}\n onSelect={(date) => {\n if (!date) {\n if (value) {\n commitValue(null)\n }\n setDraft(\"\")\n closePopover()\n return\n }\n\n const normalized = startOfDay(date)\n if (!value || normalized.getTime() !== startOfDay(value).getTime()) {\n commitValue(normalized)\n }\n setDraft(formatDayInput(normalized))\n closePopover()\n }}\n {...dayPickerProps}\n />\n </div>\n </>\n )\n\n if (typeof document === \"undefined\") return popover\n return createPortal(popover, document.body)\n })()}\n </div>\n )\n }\n)\n\nDayPickerInput.displayName = \"DayPickerInput\"\n\nexport type DayPickerFieldProps = {\n id?: string\n value: Date | null\n onChange: (value: Date | null) => void\n onValueUpdate?: (value: Date | null) => void\n className?: string\n inputClassName?: string\n placeholder?: string\n disabled?: boolean\n readOnly?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n dayPickerComponent?: React.ComponentType<DayPickerProps>\n dayPickerProps?: Omit<DayPickerProps, \"mode\" | \"selected\" | \"onSelect\" | \"month\" | \"onMonthChange\">\n triggerTestId?: string\n isHydrated?: boolean\n}\n\nfunction DayPickerButtonField({\n id,\n value,\n onChange,\n onValueUpdate,\n className,\n inputClassName,\n placeholder = \"DD/MM/YYYY\",\n disabled,\n open: openProp,\n onOpenChange,\n dayPickerComponent,\n dayPickerProps,\n triggerTestId,\n isHydrated,\n}: DayPickerFieldProps) {\n const rootRef = React.useRef<HTMLDivElement | null>(null)\n const popoverRef = React.useRef<HTMLDivElement | null>(null)\n const openRef = React.useRef(false)\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false)\n const open = openProp ?? uncontrolledOpen\n const setOpen = onOpenChange ?? setUncontrolledOpen\n openRef.current = open\n const [month, setMonth] = React.useState(() => startOfMonth(value ?? new Date()))\n const [popoverPosition, setPopoverPosition] = React.useState(() => ({\n left: 0,\n top: 0,\n }))\n\n React.useEffect(() => {\n if (!open) return\n setMonth(startOfMonth(value ?? new Date()))\n }, [open, value])\n\n React.useEffect(() => {\n if (!open) return\n\n const ownerDocument = rootRef.current?.ownerDocument ?? document\n const ownerWindow = ownerDocument.defaultView ?? window\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = event.target\n if (!(target instanceof Node)) return\n if (rootRef.current?.contains(target)) return\n if (popoverRef.current?.contains(target)) return\n setOpen(false)\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return\n if (!openRef.current) return\n const target = event.target\n if (!(target instanceof Node)) return\n if (!rootRef.current?.contains(target) && !popoverRef.current?.contains(target)) return\n event.preventDefault()\n event.stopPropagation()\n setOpen(false)\n }\n\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown, true)\n ownerWindow.addEventListener(\"keydown\", handleKeyDown, true)\n return () => {\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown, true)\n ownerWindow.removeEventListener(\"keydown\", handleKeyDown, true)\n }\n }, [open])\n\n React.useEffect(() => {\n if (!open) {\n return\n }\n if (typeof window === \"undefined\") {\n return\n }\n if (!(\"IntersectionObserver\" in window)) {\n return\n }\n\n const root = rootRef.current\n if (!root) {\n return\n }\n\n let isActive = true\n const observer = new IntersectionObserver(entries => {\n if (!isActive) {\n return\n }\n const entry = entries[0]\n if (entry && !entry.isIntersecting) {\n setOpen(false)\n }\n })\n observer.observe(root)\n return () => {\n isActive = false\n observer.disconnect()\n }\n }, [open])\n\n const DayPickerComponent = dayPickerComponent ?? DayPicker\n\n const updatePopoverPosition = React.useCallback(() => {\n if (typeof window === \"undefined\") return\n const root = rootRef.current\n const popover = popoverRef.current\n if (!root || !popover) return\n\n const rect = root.getBoundingClientRect()\n const popoverWidth = popover.offsetWidth\n const popoverHeight = popover.offsetHeight\n const viewportWidth = window.innerWidth ?? 0\n const viewportHeight = window.innerHeight ?? 0\n const padding = 8\n\n let left = rect.left\n if (left + popoverWidth > viewportWidth - padding) {\n left = Math.max(padding, viewportWidth - popoverWidth - padding)\n }\n if (left < padding) {\n left = padding\n }\n\n let top = rect.bottom + padding\n const overflowBottom = top + popoverHeight > viewportHeight - padding\n const aboveTop = rect.top - popoverHeight - padding\n if (overflowBottom && aboveTop >= padding) {\n top = aboveTop\n }\n\n if (top < padding) {\n top = padding\n }\n if (top + popoverHeight > viewportHeight - padding) {\n top = Math.max(padding, viewportHeight - popoverHeight - padding)\n }\n\n setPopoverPosition({ left, top })\n }, [])\n\n // React Compiler rejects hook aliasing (useIsomorphicLayoutEffect pattern), so we\n // call useLayoutEffect directly and keep the SSR guard inside the effect.\n React.useLayoutEffect(() => {\n if (!open || disabled) return\n if (typeof window === \"undefined\") return\n\n updatePopoverPosition()\n const rafId = window.requestAnimationFrame(updatePopoverPosition)\n\n window.addEventListener(\"scroll\", updatePopoverPosition, true)\n window.addEventListener(\"resize\", updatePopoverPosition)\n return () => {\n window.cancelAnimationFrame(rafId)\n window.removeEventListener(\"scroll\", updatePopoverPosition, true)\n window.removeEventListener(\"resize\", updatePopoverPosition)\n }\n }, [disabled, open, updatePopoverPosition])\n\n const commitValue = React.useCallback(\n (next: Date | null) => {\n if (onValueUpdate) {\n onValueUpdate(next)\n }\n onChange(next)\n },\n [onChange, onValueUpdate],\n )\n\n return (\n <div ref={rootRef} data-slot=\"day-picker-input\" className={cn(\"relative group\", className)}>\n <button\n id={id}\n type=\"button\"\n disabled={disabled}\n data-testid={triggerTestId}\n data-hydrated={isHydrated ? \"true\" : undefined}\n data-slot=\"day-picker-input-input\"\n className={cn(\n \"flex h-10 w-full items-center rounded-md border border-input bg-background px-3 py-2 text-left text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"transition-colors group-hover:bg-accent group-hover:text-accent-foreground\",\n !value && \"text-muted-foreground\",\n open && \"ring-2 ring-primary ring-offset-2\",\n inputClassName,\n )}\n onClick={() => {\n if (disabled) return\n setOpen(!open)\n }}\n >\n <CalendarDays\n aria-hidden\n className=\"mr-2 size-4 text-muted-foreground transition-colors group-hover:text-accent-foreground\"\n />\n {value ? formatDayInput(value) : placeholder}\n </button>\n\n {open && !disabled && (() => {\n const popover = (\n <>\n <div\n ref={popoverRef}\n data-slot=\"day-picker-input-popover\"\n className=\"pointer-events-auto fixed z-[60] w-max rounded-md border bg-popover text-popover-foreground shadow-md\"\n style={{ left: popoverPosition.left, top: popoverPosition.top }}\n >\n <DayPickerComponent\n mode=\"single\"\n month={month}\n onMonthChange={setMonth}\n selected={value ?? undefined}\n onSelect={(date) => {\n if (!date) {\n commitValue(null)\n setOpen(false)\n return\n }\n\n const normalized = startOfDay(date)\n if (!value || normalized.getTime() !== startOfDay(value).getTime()) {\n commitValue(normalized)\n }\n setOpen(false)\n }}\n {...dayPickerProps}\n />\n </div>\n </>\n )\n\n if (typeof document === \"undefined\") return popover\n return createPortal(popover, document.body)\n })()}\n </div>\n )\n}\n\nexport function DayPickerField(props: DayPickerFieldProps) {\n const isTouchDevice = useIsTouchDevice()\n\n if (isTouchDevice) {\n return <DayPickerButtonField {...props} />\n }\n\n const {\n id,\n value,\n onChange,\n onValueUpdate,\n className,\n inputClassName,\n placeholder = \"DD/MM/YYYY\",\n disabled,\n readOnly,\n dayPickerComponent,\n dayPickerProps,\n triggerTestId,\n isHydrated,\n open,\n onOpenChange,\n } = props\n\n return (\n <DayPickerInput\n id={id}\n value={value}\n onChange={onChange}\n onValueUpdate={onValueUpdate}\n className={className}\n inputClassName={inputClassName}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n open={open}\n onOpenChange={onOpenChange}\n dayPickerComponent={dayPickerComponent}\n dayPickerProps={dayPickerProps}\n data-testid={triggerTestId}\n data-hydrated={isHydrated ? \"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A,OAAA2E,KAAA3E,EAAA,OAAA+B,KAAA/B,EAAA,OAAAkN,KAAAlN,EAAA,OAAAsE,KAAAtE,EAAA,OAAAoE,KAAApE,EAAA,OAAAwE,KAAAxE,EAAA,QAAAqE,KAAArE,EAAA,QAAAuE,KAAAvE,EAAA,QAAA+E,KAAA/E,EAAA,QAAAgF,KAAAhF,EAAA,QAAAM,KAAAN,EAAA,QAAAmN,KAAAnN,EAAA,QAAAyC,KAfhDhC,IAAA,kBAAC,GAAD;EACMyM;EACGzK;EACG2B;EACKC;EACJnE;EACKoE;EACHS;EACHhD;EACAiD;EACJT;EACQC;EACMC;EACJE;EACHwI,eAAAA;EACE,iBAAA7M;CAA+B,CAAA,GAC9CN,EAAA,KAAAE,GAAAF,EAAA,KAAAyE,GAAAzE,EAAA,KAAA2E,GAAA3E,EAAA,KAAA+B,GAAA/B,EAAA,KAAAkN,GAAAlN,EAAA,KAAAsE,GAAAtE,EAAA,KAAAoE,GAAApE,EAAA,KAAAwE,GAAAxE,EAAA,MAAAqE,GAAArE,EAAA,MAAAuE,GAAAvE,EAAA,MAAA+E,GAAA/E,EAAA,MAAAgF,GAAAhF,EAAA,MAAAM,GAAAN,EAAA,MAAAmN,GAAAnN,EAAA,MAAAyC,GAAAzC,EAAA,MAAAS,KAAAA,IAAAT,EAAA,KAhBFS;AAgBE"}
|
|
1
|
+
{"version":3,"file":"index182.js","names":["next","event","target","root","parsed","popover"],"sources":["../src/components/DayPickerField/index.tsx"],"sourcesContent":["import { ChevronLeft, ChevronRight, CalendarDays } from \"lucide-react\"\nimport * as React from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { DayPicker as ReactDayPicker, dateMatchModifiers } from \"react-day-picker\"\nimport { IMaskInput } from \"react-imask\"\nimport IMask, { InputMask } from \"imask\"\n\nimport { useIsTouchDevice } from \"@/helpers/useIsTouchDevice\"\nimport { cn } from \"@/lib/utils\"\n\n\n// WARNING: used to preserve input mask even with tree shaking\n// DO NOT REMOVE THIS CODE OR THIS COMMENT\nconst imaskAny = IMask as any\nif (typeof imaskAny.InputMask !== \"function\") {\n imaskAny.InputMask = InputMask\n}\n\n\nexport type DayPickerProps = React.ComponentProps<typeof ReactDayPicker>\n\nexport function DayPicker({\n className,\n classNames,\n components,\n showOutsideDays = true,\n ...props\n}: DayPickerProps) {\n return (\n <ReactDayPicker\n weekStartsOn={1}\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n month: \"space-y-4\",\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-y-0 relative gap-2\",\n month_caption: \"flex justify-center pt-1 relative items-center\",\n month_grid: \"w-full border-collapse space-y-1\",\n caption_label: \"text-sm font-medium\",\n nav: \"flex items-center justify-between absolute inset-x-0 z-10\",\n button_previous:\n \"inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent p-0 opacity-50 shadow-sm transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 z-10\",\n button_next:\n \"inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent p-0 opacity-50 shadow-sm transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 z-10\",\n weeks: \"w-full border-collapse\",\n weekdays: \"flex\",\n weekday: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n week: \"flex w-full mt-2\",\n day: \"h-9 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md first:aria-selected:rounded-l-md last:aria-selected:rounded-r-md\",\n day_button:\n \"inline-flex h-9 w-9 items-center justify-center rounded-md p-0 text-center text-sm font-normal transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n range_start:\n \"day-range-start !bg-accent rounded-l-md [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground\",\n range_end:\n \"day-range-end !bg-accent rounded-r-md [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground\",\n range_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground !rounded-none\",\n selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n today: \"bg-gray-50 text-accent-foreground !rounded-md\",\n outside:\n \"day-outside text-muted-foreground opacity-50 !aria-selected:bg-accent/50 !aria-selected:text-muted-foreground !aria-selected:opacity-30\",\n disabled: \"text-muted-foreground opacity-50\",\n hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: (chevronProps) =>\n chevronProps.orientation === \"left\" ? (\n <ChevronLeft {...chevronProps} className=\"h-4 w-4\" />\n ) : (\n <ChevronRight {...chevronProps} className=\"h-4 w-4\" />\n ),\n ...components,\n }}\n {...props}\n />\n )\n}\n\nDayPicker.displayName = \"DayPicker\"\n\nfunction pad2(value: number) {\n return String(value).padStart(2, \"0\")\n}\n\nfunction startOfDay(date: Date) {\n const next = new Date(date)\n next.setHours(0, 0, 0, 0)\n return next\n}\n\nfunction startOfMonth(date: Date) {\n return startOfDay(new Date(date.getFullYear(), date.getMonth(), 1))\n}\n\nfunction formatDayInput(date: Date) {\n return `${pad2(date.getDate())}/${pad2(date.getMonth() + 1)}/${date.getFullYear()}`\n}\n\nfunction buildDate({ day, month, year }: { day: number; month: number; year: number }): Date | null {\n if (!Number.isFinite(day) || !Number.isFinite(month) || !Number.isFinite(year)) return null\n\n const date = new Date(year, month - 1, day)\n if (\n date.getFullYear() !== year ||\n date.getMonth() !== month - 1 ||\n date.getDate() !== day\n ) {\n return null\n }\n\n return startOfDay(date)\n}\n\nfunction parseDayInput(value: string, now: Date): Date | null {\n const trimmed = value.trim()\n if (!trimmed) return null\n\n const full = /^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/.exec(trimmed)\n if (full) {\n return buildDate({ day: Number(full[1]), month: Number(full[2]), year: Number(full[3]) })\n }\n\n const shortYear = /^(\\d{2})\\/(\\d{2})\\/(\\d{2})$/.exec(trimmed)\n if (shortYear) {\n const year = Number(shortYear[3])\n if (!Number.isFinite(year)) return null\n return buildDate({ day: Number(shortYear[1]), month: Number(shortYear[2]), year: 2000 + year })\n }\n\n const noYear = /^(\\d{2})\\/(\\d{2})$/.exec(trimmed)\n if (noYear) {\n return buildDate({ day: Number(noYear[1]), month: Number(noYear[2]), year: now.getFullYear() })\n }\n\n return null\n}\n\nexport type DayPickerInputProps = Omit<\n React.ComponentProps<\"input\">,\n \"value\" | \"defaultValue\" | \"onChange\" | \"type\"\n> & {\n value: Date | null\n onChange: (value: Date | null) => void\n onValueUpdate?: (value: Date | null) => void\n inputClassName?: string\n open?: boolean\n onOpenChange?: (open: boolean) => void\n dayPickerComponent?: React.ComponentType<DayPickerProps>\n dayPickerProps?: Omit<DayPickerProps, \"mode\" | \"selected\" | \"onSelect\" | \"month\" | \"onMonthChange\">\n}\n\nexport const DayPickerInput = React.forwardRef<HTMLInputElement, DayPickerInputProps>(\n function DayPickerInput(\n {\n value,\n onChange,\n onValueUpdate,\n className,\n inputClassName,\n placeholder = \"DD/MM/YYYY\",\n disabled,\n readOnly,\n open: openProp,\n onOpenChange,\n dayPickerComponent,\n dayPickerProps,\n onFocus,\n onBlur,\n onKeyDown,\n onPointerDown,\n onMouseDown,\n ...rest\n },\n forwardedRef,\n ) {\n const rootRef = React.useRef<HTMLDivElement | null>(null)\n const popoverRef = React.useRef<HTMLDivElement | null>(null)\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n const isFocusedRef = React.useRef(false)\n const openRef = React.useRef(false)\n const pointerDownOnInputRef = React.useRef(false)\n const inputWasFocusedOnPointerDownRef = React.useRef(false)\n const pointerDownInPopoverRef = React.useRef(false)\n const ignoreNextMaskCompleteValueRef = React.useRef<string | null>(null)\n\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false)\n const open = openProp ?? uncontrolledOpen\n const setOpen = onOpenChange ?? setUncontrolledOpen\n openRef.current = open\n const [draft, setDraft] = React.useState(() => (value ? formatDayInput(value) : \"\"))\n const draftSelection = React.useMemo(() => parseDayInput(draft, new Date()), [draft])\n const [month, setMonth] = React.useState(() => startOfMonth(value ?? new Date()))\n const [popoverPosition, setPopoverPosition] = React.useState(() => ({\n left: 0,\n top: 0,\n }))\n\n const updateValue = React.useCallback(\n (next: Date | null) => {\n if (onValueUpdate) {\n onValueUpdate(next)\n }\n },\n [onValueUpdate],\n )\n\n const commitValue = React.useCallback(\n (next: Date | null) => {\n if (onValueUpdate) {\n onValueUpdate(next)\n }\n onChange(next)\n },\n [onChange, onValueUpdate],\n )\n\n React.useEffect(() => {\n if (isFocusedRef.current) return\n setDraft(value ? formatDayInput(value) : \"\")\n }, [value])\n\n React.useEffect(() => {\n if (!open) return\n setMonth(startOfMonth(value ?? new Date()))\n }, [open, value])\n\n React.useEffect(() => {\n if (!open) return\n if (!draftSelection) return\n setMonth(startOfMonth(draftSelection))\n }, [draftSelection, open])\n\n React.useEffect(() => {\n if (!open) return\n\n const ownerDocument = rootRef.current?.ownerDocument ?? document\n const ownerWindow = ownerDocument.defaultView ?? window\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = event.target\n if (!(target instanceof Node)) return\n if (rootRef.current?.contains(target)) return\n if (popoverRef.current?.contains(target)) return\n setOpen(false)\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return\n if (!openRef.current) return\n const target = event.target\n if (!(target instanceof Node)) return\n if (!rootRef.current?.contains(target) && !popoverRef.current?.contains(target)) return\n event.preventDefault()\n event.stopPropagation()\n setOpen(false)\n }\n\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown, true)\n ownerWindow.addEventListener(\"keydown\", handleKeyDown, true)\n return () => {\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown, true)\n ownerWindow.removeEventListener(\"keydown\", handleKeyDown, true)\n }\n }, [open])\n\n React.useEffect(() => {\n if (!open) {\n return\n }\n if (typeof window === \"undefined\") {\n return\n }\n if (!(\"IntersectionObserver\" in window)) {\n return\n }\n\n const root = rootRef.current\n if (!root) {\n return\n }\n\n let isActive = true\n const observer = new IntersectionObserver(entries => {\n if (!isActive) {\n return\n }\n const entry = entries[0]\n if (entry && !entry.isIntersecting) {\n setOpen(false)\n }\n })\n observer.observe(root)\n return () => {\n isActive = false\n observer.disconnect()\n }\n }, [open])\n\n const setRefs = React.useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n if (typeof forwardedRef === \"function\") {\n forwardedRef(node)\n } else if (forwardedRef) {\n forwardedRef.current = node\n }\n },\n [forwardedRef],\n )\n\n const closePopover = () => setOpen(false)\n\n const DayPickerComponent = dayPickerComponent ?? DayPicker\n\n const updatePopoverPosition = React.useCallback(() => {\n if (typeof window === \"undefined\") return\n const root = rootRef.current\n const popover = popoverRef.current\n if (!root || !popover) return\n\n const rect = root.getBoundingClientRect()\n const popoverWidth = popover.offsetWidth\n const popoverHeight = popover.offsetHeight\n const viewportWidth = window.innerWidth ?? 0\n const viewportHeight = window.innerHeight ?? 0\n const padding = 8\n\n let left = rect.left\n if (left + popoverWidth > viewportWidth - padding) {\n left = Math.max(padding, viewportWidth - popoverWidth - padding)\n }\n if (left < padding) {\n left = padding\n }\n\n let top = rect.bottom + padding\n const overflowBottom = top + popoverHeight > viewportHeight - padding\n const aboveTop = rect.top - popoverHeight - padding\n if (overflowBottom && aboveTop >= padding) {\n top = aboveTop\n }\n\n if (top < padding) {\n top = padding\n }\n if (top + popoverHeight > viewportHeight - padding) {\n top = Math.max(padding, viewportHeight - popoverHeight - padding)\n }\n\n setPopoverPosition({ left, top })\n }, [])\n\n // React Compiler rejects hook aliasing (useIsomorphicLayoutEffect pattern), so we\n // call useLayoutEffect directly and keep the SSR guard inside the effect.\n React.useLayoutEffect(() => {\n if (!open || disabled) return\n if (typeof window === \"undefined\") return\n\n updatePopoverPosition()\n const rafId = window.requestAnimationFrame(updatePopoverPosition)\n\n window.addEventListener(\"scroll\", updatePopoverPosition, true)\n window.addEventListener(\"resize\", updatePopoverPosition)\n return () => {\n window.cancelAnimationFrame(rafId)\n window.removeEventListener(\"scroll\", updatePopoverPosition, true)\n window.removeEventListener(\"resize\", updatePopoverPosition)\n }\n }, [disabled, open, updatePopoverPosition])\n\n return (\n <div ref={rootRef} data-slot=\"day-picker-input\" className={cn(\"relative group\", className)}>\n <IMaskInput\n {...rest}\n data-slot=\"day-picker-input-input\"\n disabled={disabled}\n readOnly={readOnly}\n autoComplete=\"off\"\n inputRef={setRefs}\n mask={[\n { mask: \"00/00\", lazy: true },\n { mask: \"00/00/00\", lazy: true },\n { mask: \"00/00/0000\", lazy: true },\n ]}\n dispatch={(appended, dynamicMasked) => {\n const digits = (dynamicMasked.value + appended).replace(/\\D/g, \"\")\n if (digits.length <= 4) return dynamicMasked.compiledMasks[0]\n if (digits.length <= 6) return dynamicMasked.compiledMasks[1]\n return dynamicMasked.compiledMasks[2]\n }}\n placeholder={placeholder}\n value={draft}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background py-2 pr-3 pl-[37px] text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"transition-colors group-hover:bg-accent group-hover:text-accent-foreground\",\n inputClassName\n )}\n onAccept={(nextValue) => {\n const next = typeof nextValue === \"string\" ? nextValue : String(nextValue ?? \"\")\n const previousDigitsLength = draft.replace(/\\D/g, \"\").length\n setDraft(next)\n if (next.replace(/\\D/g, \"\").length === 0) {\n if (open) {\n setMonth(startOfMonth(new Date()))\n }\n if (previousDigitsLength !== 0) {\n updateValue(null)\n }\n }\n }}\n onComplete={(completedValue) => {\n const next = typeof completedValue === \"string\"\n ? completedValue\n : String(completedValue ?? \"\")\n if (ignoreNextMaskCompleteValueRef.current === next) {\n ignoreNextMaskCompleteValueRef.current = null\n return\n }\n const parsed = parseDayInput(next, new Date())\n if (!parsed) return\n if (value && parsed.getTime() === startOfDay(value).getTime()) {\n return\n }\n updateValue(parsed)\n }}\n onPointerDown={(event) => {\n pointerDownOnInputRef.current = true\n inputWasFocusedOnPointerDownRef.current =\n typeof document !== \"undefined\" && document.activeElement === event.currentTarget\n onPointerDown?.(event)\n }}\n onMouseDown={(event) => {\n pointerDownOnInputRef.current = true\n inputWasFocusedOnPointerDownRef.current =\n typeof document !== \"undefined\" && document.activeElement === event.currentTarget\n onMouseDown?.(event)\n }}\n onFocus={(event) => {\n const shouldSelectAll =\n !pointerDownOnInputRef.current || !inputWasFocusedOnPointerDownRef.current\n pointerDownOnInputRef.current = false\n inputWasFocusedOnPointerDownRef.current = false\n isFocusedRef.current = true\n onFocus?.(event)\n if (shouldSelectAll) {\n const element = event.currentTarget\n requestAnimationFrame(() => element.select())\n }\n if (!disabled) {\n setOpen(true)\n }\n }}\n onKeyDown={(event) => {\n const wasDefaultPrevented = event.defaultPrevented\n onKeyDown?.(event)\n if (!wasDefaultPrevented && event.defaultPrevented) {\n return\n }\n\n if (event.key === \"Enter\") {\n if (!draftSelection) {\n return\n }\n event.preventDefault()\n if (open) {\n const isoDay = `${draftSelection.getFullYear()}-${pad2(draftSelection.getMonth() + 1)}-${pad2(draftSelection.getDate())}`\n const dayButton = popoverRef.current?.querySelector(\n `[data-day='${isoDay}']:not([data-outside]) button`,\n )\n if (dayButton instanceof HTMLButtonElement) {\n if (dayButton.disabled) {\n return\n }\n dayButton.focus()\n }\n }\n setDraft(formatDayInput(draftSelection))\n commitValue(draftSelection)\n setOpen(false)\n return\n }\n\n if (event.key === \"ArrowUp\" || event.key === \"ArrowDown\") {\n const base = draftSelection ?? value\n if (!base) {\n return\n }\n\n const next = startOfDay(new Date(base))\n next.setDate(next.getDate() + (event.key === \"ArrowUp\" ? 1 : -1))\n\n if (dayPickerProps?.disabled && dateMatchModifiers(next, dayPickerProps.disabled)) {\n return\n }\n\n event.preventDefault()\n const formatted = formatDayInput(next)\n ignoreNextMaskCompleteValueRef.current = formatted\n setDraft(formatted)\n updateValue(next)\n }\n\n if (!open) {\n const shouldReopen =\n (event.key.length === 1 ||\n event.key === \"Backspace\" ||\n event.key === \"Delete\" ||\n event.key === \"ArrowUp\" ||\n event.key === \"ArrowDown\") &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n\n if (shouldReopen) {\n setOpen(true)\n }\n }\n\n if (event.key === \"Tab\" && !event.defaultPrevented) {\n setOpen(false)\n }\n }}\n onBlur={(event) => {\n isFocusedRef.current = false\n onBlur?.(event)\n const blurFromPopoverPointerDown = pointerDownInPopoverRef.current\n pointerDownInPopoverRef.current = false\n if (blurFromPopoverPointerDown) {\n return\n }\n\n const relatedTarget = event.relatedTarget\n if (relatedTarget instanceof Node) {\n const root = rootRef.current\n if (!root) {\n return\n }\n\n if (root.contains(relatedTarget) || popoverRef.current?.contains(relatedTarget)) {\n return\n }\n }\n\n if (open && typeof window !== \"undefined\") {\n requestAnimationFrame(() => {\n const root = rootRef.current\n if (!root) {\n return\n }\n const activeElement = document.activeElement\n if (\n activeElement &&\n (root.contains(activeElement) || popoverRef.current?.contains(activeElement))\n ) {\n return\n }\n setOpen(false)\n })\n }\n const trimmed = draft.trim()\n if (trimmed === \"\") {\n if (value) {\n setDraft(\"\")\n commitValue(null)\n }\n return\n }\n const parsed = parseDayInput(trimmed, new Date())\n if (parsed) {\n setDraft(formatDayInput(parsed))\n if (!value || parsed.getTime() !== startOfDay(value).getTime()) {\n commitValue(parsed)\n }\n return\n }\n setDraft(value ? formatDayInput(value) : \"\")\n }}\n />\n\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={disabled}\n aria-label=\"Open calendar\"\n data-slot=\"day-picker-input-trigger\"\n className=\"absolute left-[13px] top-1/2 -translate-y-1/2 text-muted-foreground transition-colors group-hover:text-accent-foreground\"\n onPointerDown={(event) => {\n event.preventDefault()\n if (disabled) {\n return\n }\n inputRef.current?.focus({ preventScroll: true })\n }}\n onMouseDown={(event) => {\n event.preventDefault()\n if (disabled) {\n return\n }\n inputRef.current?.focus({ preventScroll: true })\n }}\n onClick={() => {\n if (disabled) {\n return\n }\n inputRef.current?.focus({ preventScroll: true })\n setOpen(true)\n }}\n >\n <CalendarDays aria-hidden className=\"size-4\" />\n </button>\n\n {open && !disabled && (() => {\n const selectedDay = draft.trim() === \"\"\n ? undefined\n : draftSelection ?? value ?? undefined\n\n const popover = (\n <>\n <div\n ref={popoverRef}\n data-slot=\"day-picker-input-popover\"\n className=\"pointer-events-auto fixed z-[60] w-max rounded-md border bg-popover text-popover-foreground shadow-md\"\n style={{ left: popoverPosition.left, top: popoverPosition.top }}\n onPointerDownCapture={() => {\n pointerDownInPopoverRef.current = true\n }}\n onMouseDownCapture={() => {\n pointerDownInPopoverRef.current = true\n }}\n >\n <DayPickerComponent\n mode=\"single\"\n month={month}\n onMonthChange={setMonth}\n selected={selectedDay}\n onSelect={(date) => {\n if (!date) {\n if (value) {\n commitValue(null)\n }\n setDraft(\"\")\n closePopover()\n return\n }\n\n const normalized = startOfDay(date)\n if (!value || normalized.getTime() !== startOfDay(value).getTime()) {\n commitValue(normalized)\n }\n setDraft(formatDayInput(normalized))\n closePopover()\n }}\n {...dayPickerProps}\n />\n </div>\n </>\n )\n\n if (typeof document === \"undefined\") return popover\n return createPortal(popover, document.body)\n })()}\n </div>\n )\n }\n)\n\nDayPickerInput.displayName = \"DayPickerInput\"\n\nexport type DayPickerFieldProps = {\n id?: string\n value: Date | null\n onChange: (value: Date | null) => void\n onValueUpdate?: (value: Date | null) => void\n className?: string\n inputClassName?: string\n placeholder?: string\n disabled?: boolean\n readOnly?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n dayPickerComponent?: React.ComponentType<DayPickerProps>\n dayPickerProps?: Omit<DayPickerProps, \"mode\" | \"selected\" | \"onSelect\" | \"month\" | \"onMonthChange\">\n triggerTestId?: string\n isHydrated?: boolean\n}\n\nfunction DayPickerButtonField({\n id,\n value,\n onChange,\n onValueUpdate,\n className,\n inputClassName,\n placeholder = \"DD/MM/YYYY\",\n disabled,\n open: openProp,\n onOpenChange,\n dayPickerComponent,\n dayPickerProps,\n triggerTestId,\n isHydrated,\n}: DayPickerFieldProps) {\n const rootRef = React.useRef<HTMLDivElement | null>(null)\n const popoverRef = React.useRef<HTMLDivElement | null>(null)\n const openRef = React.useRef(false)\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false)\n const open = openProp ?? uncontrolledOpen\n const setOpen = onOpenChange ?? setUncontrolledOpen\n openRef.current = open\n const [month, setMonth] = React.useState(() => startOfMonth(value ?? new Date()))\n const [popoverPosition, setPopoverPosition] = React.useState(() => ({\n left: 0,\n top: 0,\n }))\n\n React.useEffect(() => {\n if (!open) return\n setMonth(startOfMonth(value ?? new Date()))\n }, [open, value])\n\n React.useEffect(() => {\n if (!open) return\n\n const ownerDocument = rootRef.current?.ownerDocument ?? document\n const ownerWindow = ownerDocument.defaultView ?? window\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = event.target\n if (!(target instanceof Node)) return\n if (rootRef.current?.contains(target)) return\n if (popoverRef.current?.contains(target)) return\n setOpen(false)\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return\n if (!openRef.current) return\n const target = event.target\n if (!(target instanceof Node)) return\n if (!rootRef.current?.contains(target) && !popoverRef.current?.contains(target)) return\n event.preventDefault()\n event.stopPropagation()\n setOpen(false)\n }\n\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown, true)\n ownerWindow.addEventListener(\"keydown\", handleKeyDown, true)\n return () => {\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown, true)\n ownerWindow.removeEventListener(\"keydown\", handleKeyDown, true)\n }\n }, [open])\n\n React.useEffect(() => {\n if (!open) {\n return\n }\n if (typeof window === \"undefined\") {\n return\n }\n if (!(\"IntersectionObserver\" in window)) {\n return\n }\n\n const root = rootRef.current\n if (!root) {\n return\n }\n\n let isActive = true\n const observer = new IntersectionObserver(entries => {\n if (!isActive) {\n return\n }\n const entry = entries[0]\n if (entry && !entry.isIntersecting) {\n setOpen(false)\n }\n })\n observer.observe(root)\n return () => {\n isActive = false\n observer.disconnect()\n }\n }, [open])\n\n const DayPickerComponent = dayPickerComponent ?? DayPicker\n\n const updatePopoverPosition = React.useCallback(() => {\n if (typeof window === \"undefined\") return\n const root = rootRef.current\n const popover = popoverRef.current\n if (!root || !popover) return\n\n const rect = root.getBoundingClientRect()\n const popoverWidth = popover.offsetWidth\n const popoverHeight = popover.offsetHeight\n const viewportWidth = window.innerWidth ?? 0\n const viewportHeight = window.innerHeight ?? 0\n const padding = 8\n\n let left = rect.left\n if (left + popoverWidth > viewportWidth - padding) {\n left = Math.max(padding, viewportWidth - popoverWidth - padding)\n }\n if (left < padding) {\n left = padding\n }\n\n let top = rect.bottom + padding\n const overflowBottom = top + popoverHeight > viewportHeight - padding\n const aboveTop = rect.top - popoverHeight - padding\n if (overflowBottom && aboveTop >= padding) {\n top = aboveTop\n }\n\n if (top < padding) {\n top = padding\n }\n if (top + popoverHeight > viewportHeight - padding) {\n top = Math.max(padding, viewportHeight - popoverHeight - padding)\n }\n\n setPopoverPosition({ left, top })\n }, [])\n\n // React Compiler rejects hook aliasing (useIsomorphicLayoutEffect pattern), so we\n // call useLayoutEffect directly and keep the SSR guard inside the effect.\n React.useLayoutEffect(() => {\n if (!open || disabled) return\n if (typeof window === \"undefined\") return\n\n updatePopoverPosition()\n const rafId = window.requestAnimationFrame(updatePopoverPosition)\n\n window.addEventListener(\"scroll\", updatePopoverPosition, true)\n window.addEventListener(\"resize\", updatePopoverPosition)\n return () => {\n window.cancelAnimationFrame(rafId)\n window.removeEventListener(\"scroll\", updatePopoverPosition, true)\n window.removeEventListener(\"resize\", updatePopoverPosition)\n }\n }, [disabled, open, updatePopoverPosition])\n\n const commitValue = React.useCallback(\n (next: Date | null) => {\n if (onValueUpdate) {\n onValueUpdate(next)\n }\n onChange(next)\n },\n [onChange, onValueUpdate],\n )\n\n return (\n <div ref={rootRef} data-slot=\"day-picker-input\" className={cn(\"relative group\", className)}>\n <button\n id={id}\n type=\"button\"\n disabled={disabled}\n data-testid={triggerTestId}\n data-hydrated={isHydrated ? \"true\" : undefined}\n data-slot=\"day-picker-input-input\"\n className={cn(\n \"flex h-10 w-full items-center rounded-md border border-input bg-background px-3 py-2 text-left text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"transition-colors group-hover:bg-accent group-hover:text-accent-foreground\",\n !value && \"text-muted-foreground\",\n open && \"ring-2 ring-primary ring-offset-2\",\n inputClassName,\n )}\n onClick={() => {\n if (disabled) return\n setOpen(!open)\n }}\n >\n <CalendarDays\n aria-hidden\n className=\"mr-2 size-4 text-muted-foreground transition-colors group-hover:text-accent-foreground\"\n />\n {value ? formatDayInput(value) : placeholder}\n </button>\n\n {open && !disabled && (() => {\n const popover = (\n <>\n <div\n ref={popoverRef}\n data-slot=\"day-picker-input-popover\"\n className=\"pointer-events-auto fixed z-[60] w-max rounded-md border bg-popover text-popover-foreground shadow-md\"\n style={{ left: popoverPosition.left, top: popoverPosition.top }}\n >\n <DayPickerComponent\n mode=\"single\"\n month={month}\n onMonthChange={setMonth}\n selected={value ?? undefined}\n onSelect={(date) => {\n if (!date) {\n commitValue(null)\n setOpen(false)\n return\n }\n\n const normalized = startOfDay(date)\n if (!value || normalized.getTime() !== startOfDay(value).getTime()) {\n commitValue(normalized)\n }\n setOpen(false)\n }}\n {...dayPickerProps}\n />\n </div>\n </>\n )\n\n if (typeof document === \"undefined\") return popover\n return createPortal(popover, document.body)\n })()}\n </div>\n )\n}\n\nexport function DayPickerField(props: DayPickerFieldProps) {\n const isTouchDevice = useIsTouchDevice()\n\n if (isTouchDevice) {\n return <DayPickerButtonField {...props} />\n }\n\n const {\n id,\n value,\n onChange,\n onValueUpdate,\n className,\n inputClassName,\n placeholder = \"DD/MM/YYYY\",\n disabled,\n readOnly,\n dayPickerComponent,\n dayPickerProps,\n triggerTestId,\n isHydrated,\n open,\n onOpenChange,\n } = props\n\n return (\n <DayPickerInput\n id={id}\n value={value}\n onChange={onChange}\n onValueUpdate={onValueUpdate}\n className={className}\n inputClassName={inputClassName}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n open={open}\n onOpenChange={onOpenChange}\n dayPickerComponent={dayPickerComponent}\n dayPickerProps={dayPickerProps}\n data-testid={triggerTestId}\n data-hydrated={isHydrated ? \"true\" : undefined}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;AAaA,IAAM,IAAW;AACb,OAAO,EAAS,aAAc,eAChC,EAAS,YAAY;AAMvB,SAAgB,EAAU,EACxB,cACA,eACA,eACA,qBAAkB,IAClB,GAAG,KACc;CACjB,OACE,kBAAC,GAAD;EACE,cAAc;EACG;EACjB,WAAW,EAAG,OAAO,CAAS;EAC9B,YAAY;GACV,OAAO;GACP,QAAQ;GACR,eAAe;GACf,YAAY;GACZ,eAAe;GACf,KAAK;GACL,iBACE;GACF,aACE;GACF,OAAO;GACP,UAAU;GACV,SAAS;GACT,MAAM;GACN,KAAK;GACL,YACE;GACF,aACE;GACF,WACE;GACF,cAAc;GACd,UACE;GACF,OAAO;GACP,SACE;GACF,UAAU;GACV,QAAQ;GACR,GAAG;EACL;EACA,YAAY;GACV,UAAU,MACR,EAAa,gBAAgB,SAC3B,kBAAC,GAAD;IAAa,GAAI;IAAc,WAAU;GAAS,CAAA,IAElD,kBAAC,GAAD;IAAc,GAAI;IAAc,WAAU;GAAS,CAAA;GAEvD,GAAG;EACL;EACA,GAAI;CAAM,CAAA;AAGhB;AAEA,EAAU,cAAc;AAExB,SAAS,EAAK,GAAe;CAC3B,OAAO,OAAO,CAAK,CAAC,CAAC,SAAS,GAAG,GAAG;AACtC;AAEA,SAAS,EAAW,GAAY;CAC9B,IAAM,IA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AK,EAAgB;IAAI;IAE9D,UAAA,kBAAC,GAAD;KACE,MAAK;KACE;KACP,eAAe;KACf,UAAU,KAAS,KAAA;KACnB,WAAW,MAAS;MAClB,IAAI,CAAC,GAAM;OAET,AADA,EAAY,IAAI,GAChB,EAAQ,EAAK;OACb;MACF;MAEA,IAAM,IAAa,EAAW,CAAI;MAIlC,CAHI,CAAC,KAAS,EAAW,QAAQ,MAAM,EAAW,CAAK,CAAC,CAAC,QAAQ,MAC/D,EAAY,CAAU,GAExB,EAAQ,EAAK;KACf;KACA,GAAI;IAAe,CAAA;GAElB,CAAA,EACP,CAAA;GAIF,OADI,OAAO,WAAa,MAAoBA,IACrC,EAAaA,GAAS,SAAS,IAAI;EAC5C,EAAA,CAAG,CACA;;AAET;AAEA,SAAgB,EAAe,GAA4B;CAGzD,IAFsB,EAElB,GACF,OAAO,kBAAC,GAAD,EAAsB,GAAI,EAAM,CAAA;CAGzC,IAAM,EACJ,OACA,UACA,aACA,kBACA,cACA,mBACA,iBAAc,cACd,aACA,aACA,uBACA,mBACA,kBACA,eACA,SACA,oBACE;CAEJ,OACE,kBAAC,GAAD;EACM;EACG;EACG;EACK;EACJ;EACK;EACH;EACH;EACA;EACJ;EACQ;EACM;EACJ;EAChB,eAAa;EACb,iBAAe,IAAa,SAAS,KAAA;CAAU,CAAA;AAGrD"}
|
package/dist/index184.js
CHANGED
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
import e from "./index183.js";
|
|
3
3
|
import * as t from "react";
|
|
4
4
|
//#region ../../node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs
|
|
5
|
-
var n = /*#__PURE__*/ t.createContext(
|
|
6
|
-
process.env.NODE_ENV !== "production" && (n.displayName = "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let i = t.useContext(r);
|
|
11
|
-
if (n === !1 && i === void 0) throw Error(process.env.NODE_ENV === "production" ? e(27) : "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");
|
|
5
|
+
var n = /*#__PURE__*/ t.createContext(void 0);
|
|
6
|
+
process.env.NODE_ENV !== "production" && (n.displayName = "DialogRootContext");
|
|
7
|
+
function r(r) {
|
|
8
|
+
let i = t.useContext(n);
|
|
9
|
+
if (!r && i === void 0) throw Error(process.env.NODE_ENV === "production" ? e(27) : "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");
|
|
12
10
|
return i;
|
|
13
11
|
}
|
|
14
12
|
//#endregion
|
|
15
|
-
export {
|
|
13
|
+
export { n as DialogRootContext, r as useDialogRootContext };
|
|
16
14
|
|
|
17
15
|
//# sourceMappingURL=index184.js.map
|
package/dist/index184.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index184.js","names":["React","_formatErrorMessage"],"sources":["../../../node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const
|
|
1
|
+
{"version":3,"file":"index184.js","names":["React","_formatErrorMessage"],"sources":["../../../node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogRootContext.displayName = \"DialogRootContext\";\nexport function useDialogRootContext(optional) {\n const store = React.useContext(DialogRootContext);\n if (!optional && store === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.' : _formatErrorMessage(27));\n }\n return store;\n}"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,IAAa,IAAiC,gBAAM,cAAc,KAAA,CAAS;AAC3E,QAAA,IAAA,aAA6B,iBAAc,EAAkB,cAAc;AAC3E,SAAgB,EAAqB,GAAU;CAC7C,IAAM,IAAQA,EAAM,WAAW,CAAiB;CAChD,IAAI,CAAC,KAAY,MAAU,KAAA,GACzB,MAAU,MAAA,QAAA,IAAA,aAA+B,eAA4GC,EAAoB,EAAE,IAAnH,0FAAoH;CAE9K,OAAO;AACT"}
|
package/dist/index186.js
CHANGED
|
@@ -42,10 +42,7 @@ function o(e, t) {
|
|
|
42
42
|
typeof t == "function" && (r[e] = t);
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
|
-
case "object":
|
|
46
|
-
i.current = n;
|
|
47
|
-
break;
|
|
48
|
-
default:
|
|
45
|
+
case "object": i.current = n;
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
e.cleanup = () => {
|
|
@@ -57,10 +54,7 @@ function o(e, t) {
|
|
|
57
54
|
typeof t == "function" ? t() : n(null);
|
|
58
55
|
break;
|
|
59
56
|
}
|
|
60
|
-
case "object":
|
|
61
|
-
n.current = null;
|
|
62
|
-
break;
|
|
63
|
-
default:
|
|
57
|
+
case "object": n.current = null;
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
};
|
package/dist/index186.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index186.js","names":[],"sources":["../../../node_modules/@base-ui/utils/useMergedRefs.mjs"],"sourcesContent":["import { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}"],"x_google_ignoreList":[0],"mappings":";;AAUA,SAAgB,EAAc,GAAG,GAAG,GAAG,GAAG;CACxC,IAAM,IAAU,EAAe,CAAa,CAAC,CAAC;CAI9C,OAHI,EAAU,GAAS,GAAG,GAAG,GAAG,CAAC,KAC/B,EAAO,GAAS;EAAC;EAAG;EAAG;EAAG;CAAC,CAAC,GAEvB,EAAQ;AACjB;AAOA,SAAgB,EAAe,GAAM;CACnC,IAAM,IAAU,EAAe,CAAa,CAAC,CAAC;CAI9C,OAHI,EAAW,GAAS,CAAI,KAC1B,EAAO,GAAS,CAAI,GAEf,EAAQ;AACjB;AACA,SAAS,IAAgB;CACvB,OAAO;EACL,UAAU;EACV,SAAS;EACT,MAAM,CAAC;CACT;AACF;AACA,SAAS,EAAU,GAAS,GAAG,GAAG,GAAG,GAAG;CAEtC,OAAO,EAAQ,KAAK,OAAO,KAAK,EAAQ,KAAK,OAAO,KAAK,EAAQ,KAAK,OAAO,KAAK,EAAQ,KAAK,OAAO;AACxG;AACA,SAAS,EAAW,GAAS,GAAS;CACpC,OAAO,EAAQ,KAAK,WAAW,EAAQ,UAAU,EAAQ,KAAK,MAAM,GAAK,MAAU,MAAQ,EAAQ,EAAM;AAC3G;AACA,SAAS,EAAO,GAAS,GAAM;CAE7B,IADA,EAAQ,OAAO,GACX,EAAK,OAAM,MAAO,KAAO,IAAI,GAAG;EAClC,EAAQ,WAAW;EACnB;CACF;CACA,EAAQ,YAAW,MAAY;EAK7B,IAJA,AAEE,EAAQ,aADR,EAAQ,QAAQ,GACE,OAEhB,KAAY,MAAM;GACpB,IAAM,IAAmB,MAAM,EAAK,MAAM,CAAC,CAAC,KAAK,IAAI;GACrD,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAAK,GAAG;IACvC,IAAM,IAAM,EAAK;IACb,SAAO,MAGX,QAAQ,OAAO,GAAf;KACE,KAAK,YACH;MACE,IAAM,IAAa,EAAI,CAAQ;MAC/B,AAAI,OAAO,KAAe,eACxB,EAAiB,KAAK;MAExB;KACF;KACF,KAAK
|
|
1
|
+
{"version":3,"file":"index186.js","names":[],"sources":["../../../node_modules/@base-ui/utils/useMergedRefs.mjs"],"sourcesContent":["import { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n // Legacy ref with no attach-time cleanup: detach by calling it with `null`.\n // It returns nothing; React 19 cleanups are handled in the branch above.\n void ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}"],"x_google_ignoreList":[0],"mappings":";;AAUA,SAAgB,EAAc,GAAG,GAAG,GAAG,GAAG;CACxC,IAAM,IAAU,EAAe,CAAa,CAAC,CAAC;CAI9C,OAHI,EAAU,GAAS,GAAG,GAAG,GAAG,CAAC,KAC/B,EAAO,GAAS;EAAC;EAAG;EAAG;EAAG;CAAC,CAAC,GAEvB,EAAQ;AACjB;AAOA,SAAgB,EAAe,GAAM;CACnC,IAAM,IAAU,EAAe,CAAa,CAAC,CAAC;CAI9C,OAHI,EAAW,GAAS,CAAI,KAC1B,EAAO,GAAS,CAAI,GAEf,EAAQ;AACjB;AACA,SAAS,IAAgB;CACvB,OAAO;EACL,UAAU;EACV,SAAS;EACT,MAAM,CAAC;CACT;AACF;AACA,SAAS,EAAU,GAAS,GAAG,GAAG,GAAG,GAAG;CAEtC,OAAO,EAAQ,KAAK,OAAO,KAAK,EAAQ,KAAK,OAAO,KAAK,EAAQ,KAAK,OAAO,KAAK,EAAQ,KAAK,OAAO;AACxG;AACA,SAAS,EAAW,GAAS,GAAS;CACpC,OAAO,EAAQ,KAAK,WAAW,EAAQ,UAAU,EAAQ,KAAK,MAAM,GAAK,MAAU,MAAQ,EAAQ,EAAM;AAC3G;AACA,SAAS,EAAO,GAAS,GAAM;CAE7B,IADA,EAAQ,OAAO,GACX,EAAK,OAAM,MAAO,KAAO,IAAI,GAAG;EAClC,EAAQ,WAAW;EACnB;CACF;CACA,EAAQ,YAAW,MAAY;EAK7B,IAJA,AAEE,EAAQ,aADR,EAAQ,QAAQ,GACE,OAEhB,KAAY,MAAM;GACpB,IAAM,IAAmB,MAAM,EAAK,MAAM,CAAC,CAAC,KAAK,IAAI;GACrD,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAAK,GAAG;IACvC,IAAM,IAAM,EAAK;IACb,SAAO,MAGX,QAAQ,OAAO,GAAf;KACE,KAAK,YACH;MACE,IAAM,IAAa,EAAI,CAAQ;MAC/B,AAAI,OAAO,KAAe,eACxB,EAAiB,KAAK;MAExB;KACF;KACF,KAAK,UAED,EAAI,UAAU;IAIpB;GACF;GACA,EAAQ,gBAAgB;IACtB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAAK,GAAG;KACvC,IAAM,IAAM,EAAK;KACb,SAAO,MAGX,QAAQ,OAAO,GAAf;MACE,KAAK,YACH;OACE,IAAM,IAAkB,EAAiB;OACzC,AAAI,OAAO,KAAoB,aAC7B,EAAgB,IAIhB,EAAS,IAAI;OAEf;MACF;MACF,KAAK,UAED,EAAI,UAAU;KAIpB;IACF;GACF;EACF;CACF;AACF"}
|
package/dist/index19.js
CHANGED
|
@@ -62,7 +62,7 @@ function a(t, n) {
|
|
|
62
62
|
}
|
|
63
63
|
r(t);
|
|
64
64
|
let E = (n ? i : i + _ * 1e3) - +t.internal;
|
|
65
|
-
E && Math.abs(E) <
|
|
65
|
+
E && Math.abs(E) < 18e5 && (Date.prototype.setTime.call(t, +t + E), r(t));
|
|
66
66
|
}
|
|
67
67
|
function o(e) {
|
|
68
68
|
return Date.UTC(e[0], e.length > 1 ? e[1] : 0, e.length > 2 ? e[2] : 1, ...e.slice(3));
|
package/dist/index19.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index19.js","names":[],"sources":["../../../node_modules/@date-fns/tz/date/mini.js"],"sourcesContent":["import { tzOffset } from \"../tzOffset/index.js\";\n\n// TZDate stores time in two `Date` objects because native `Date` can only\n// expose local fields in the system time zone.\n//\n// The external date (`this`) stores the real timestamp. It is the value used by\n// `getTime()`, `valueOf()`, UTC getters/setters, comparisons, and arithmetic.\n// Its local getters are not used for target-zone fields because they would read\n// the timestamp through the system time zone.\n//\n// The internal date (`this.internal`) stores the target-zone wall-clock fields.\n// We read and write those fields through UTC getters/setters so the host system\n// time zone cannot reinterpret them. For example, `getHours()` returns\n// `internal.getUTCHours()`, and `setHours()` writes `internal.setUTCHours(...)`.\n//\n// Syncing moves data between the two representations:\n//\n// - `syncToInternal` starts from the external timestamp and rebuilds internal\n// wall-clock fields using `this.timeZone` offset.\n//\n// - `syncFromInternal` starts from internal wall-clock fields, writes them into\n// the external date, then adjusts that timestamp for the system/target offset\n// difference and DST edge cases.\n//\n// The public TZDate value is the combination of both: external is the instant,\n// internal is the wall-clock view of that instant in `this.timeZone`.\n\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n\n // Time zone string is always the last string argument unless date string\n // is passed (as a single argument).\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n\n // Validate the time zone by checking its offset.\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n // No arguments passed: use current time\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n // Timestamp passed: use it as is\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n // `Date` string passed: parse it as external date\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n // `Date` passed: use its timestamp\n this.setTime(+args[0]);\n } else {\n // `Date` values passed:\n\n // Set it as external date.\n this.setTime(+new Date(...args));\n\n // Adjust internal and external dates considering that we might have\n // landed on the DST hour.\n adjustToSystemTZ(this, args);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n const offset = -tzOffset(this.timeZone, this);\n // Remove the seconds offset using `Math.floor` for negative UTC time zones\n // and `Math.ceil` for positive UTC time zones.\n return offset > 0 ? Math.floor(offset) : Math.ceil(offset);\n }\n\n //#endregion\n\n //#region time\n\n setTime(_time) {\n // Use the native `setTime` to the external date time.\n Date.prototype.setTime.apply(this, arguments);\n\n // Then apply it to the internal date adjusting to the timezone offset.\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * @internal\n * Function syncs time to internal date, applying the current time zone offset.\n *\n * @param {Date} date - `Date` to sync\n */\nfunction syncToInternal(date) {\n // Start internal from the same real timestamp as external.\n date.internal.setTime(+date);\n\n // Shift internal by the target offset so its UTC fields become the target-zone\n // wall-clock fields for the external timestamp.\n //\n // o internal UTC fields: 2024-02-11 00:00\n // |\n // | + Asia/Singapore offset (+08:00)\n // v\n // x internal UTC fields: 2024-02-11 08:00\n //\n date.internal.setUTCSeconds(date.internal.getUTCSeconds() -\n // Round after converting minutes to seconds to avoid fractional offset\n // precision errors from historical offsets.\n Math.round(-tzOffset(date.timeZone, date) * 60));\n}\n\n/**\n * @internal\n * Function syncs internal wall-clock fields into the external date.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // Copy target-zone wall-clock fields from internal into external using native\n // local setters. At this point external holds the right field values but they\n // are interpreted in the system time zone; `adjustToSystemTZ` fixes that.\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * @internal\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * We use it when constructing `TZDate` and syncing the external date from\n * the internal one.\n *\n * @param {TZDate} date - `TZDate` to adjust.\n */\nfunction adjustToSystemTZ(date, constructorArgs) {\n // Keep the intended target-zone wall-clock value before native Date/system\n // time zone normalization can move it. Later corrections compare against this\n // value to distinguish intended DST normalization from accidental drift.\n const expectedInternalTime = Array.isArray(constructorArgs) ? constructorArgsToInternalTime(constructorArgs) : +date.internal;\n //#region Initial offset calculation\n\n // Current target time zone offset at the native timestamp. It may include\n // historical offset seconds, which we preserve for the seconds adjustment.\n const offsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset used by minute-based timestamp adjustments.\n // Historical offsets can contain seconds, so we strip the fractional minute\n // here and handle remaining seconds in the seconds adjustment below.\n const offset = offsetWithSeconds > 0 ? Math.floor(offsetWithSeconds) : Math.ceil(offsetWithSeconds);\n\n //#endregion\n\n //#region System DST adjustment\n\n // Native `Date` may normalize the requested wall time when the system time\n // zone skips that hour for DST.\n //\n // We compare the system wall-clock hour represented by the external date with\n // the wall-clock hour stored in the internal date. If they differ, the next\n // offset-diff calculation may need the previous system offset, because the\n // current external timestamp is already after the system DST jump.\n\n // Previous-hour reference used to detect whether the system offset changed\n // immediately before the current native timestamp.\n const prevHour = new Date(+date);\n\n // Use UTC math so subtracting one hour cannot be normalized back into the\n // same missing local DST hour.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Current system offset at the native timestamp.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n\n // System offset one real hour before the native timestamp.\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n\n // Non-zero when the system offset changed between `prevHour` and `date`.\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n\n // System offset to use in the later system-target offset difference.\n // Defaults to the current system offset and switches to the previous offset\n // only when native `Date` normalized a missing system wall time.\n let systemOffsetForDiff = systemOffset;\n if (systemDSTChange && systemOffset !== offset) {\n // System wall-clock hour represented by the current external timestamp.\n const systemHour = Date.prototype.getHours.apply(date);\n\n // Target wall-clock hour currently stored in internal fields. Constructors\n // get it from arguments because internal may have already been synced from\n // the normalized external timestamp; setters get it directly from internal.\n const expectedHour = Array.isArray(constructorArgs) ? constructorArgs[3] || 0 : date.internal.getUTCHours();\n if (systemHour !== expectedHour) {\n // Check whether using the current system offset would keep the target\n // offset unchanged. If so, the only DST jump we crossed is the system\n // one, so the diff should use the pre-DST system offset.\n const testDate = new Date(+date);\n\n // Difference that the later offset-diff step would apply with the\n // current system offset.\n const testOffsetDiff = systemOffset - offset;\n if (testOffsetDiff) testDate.setUTCMinutes(testDate.getUTCMinutes() + testOffsetDiff);\n\n // Target offset after applying the current system offset difference.\n const testOffsetWithSeconds = tzOffset(date.timeZone, testDate);\n\n // Target offset without historical seconds, matching `offset`.\n const testOffset = testOffsetWithSeconds > 0 ? Math.floor(testOffsetWithSeconds) : Math.ceil(testOffsetWithSeconds);\n if (testOffset === offset) systemOffsetForDiff = prevHourSystemOffset;\n }\n }\n\n //#endregion\n\n //#region System diff adjustment\n\n // Move external from the system-zone interpretation of internal fields toward\n // the timestamp that represents those fields in the target time zone.\n //\n // At this point native `Date` has treated the internal wall-clock fields as if\n // they belonged to the system zone. The system-target offset difference moves\n // external by the distance between that system interpretation and the target\n // interpretation.\n\n // Difference between the system offset selected above and the minute-precision\n // target offset. Positive values move external forward; negative values move\n // it backward.\n const offsetDiff = systemOffsetForDiff - offset;\n if (offsetDiff)\n // Apply the system-target minute difference to external. Internal is\n // rebuilt from the final external timestamp after all adjustments are\n // complete.\n //\n // o external as target: 2023-01-31 23:00\n // |\n // | add `offsetDiff`\n // v\n // x external as target: 2023-02-01 12:00\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Seconds system diff adjustment\n\n // Historical time zone offsets can include seconds, but the minute-based\n // offset adjustment above intentionally used minute precision.\n //\n // This adjustment applies the remaining seconds difference to external. For\n // example, historical Singapore used UTC+06:55:25, while ISO formatting shows\n // only `+06:55`; without the seconds correction, setter paths keep the wrong\n // wall-clock seconds.\n\n // Clone external as a native `Date` so we can inspect how the system time zone\n // represents the same timestamp.\n const systemDate = new Date(+date);\n\n // Zero UTC seconds before reading system seconds. Any remaining local seconds\n // then come from the system time zone offset rather than from the timestamp's\n // own seconds value.\n systemDate.setUTCSeconds(0);\n\n // Seconds part contributed by the system time zone offset. Negative offsets\n // need wrapping because `Date#getSeconds()` returns values in the 0..59 range.\n const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;\n\n // Seconds part contributed by the target time zone offset.\n const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;\n if (secondsOffset || systemSecondsOffset)\n // Apply the remaining second-level system-target difference to external.\n //\n // o external as Asia/Singapore: 1900-01-01 00:00:56\n // |\n // | + `secondsOffset`\n // | + `systemSecondsOffset`\n // v\n // x external as Asia/Singapore: 1900-01-01 00:00:31\n //\n Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n // The first system-target offset move can cross a target-zone DST boundary.\n //\n // When that happens, the target offset at the new external timestamp differs\n // from the target offset used for `offsetDiff`. We compare the original move\n // with the move that would be calculated at the new timestamp, then apply the\n // difference to external.\n\n // Target offset at the current external timestamp, including historical\n // seconds for the later seconds adjustment.\n const postOffsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset at the current external timestamp.\n const postOffset = postOffsetWithSeconds > 0 ? Math.floor(postOffsetWithSeconds) : Math.ceil(postOffsetWithSeconds);\n\n // System offset at the current external timestamp.\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n\n // System-target offset difference at the current external timestamp.\n const postOffsetDiff = postSystemOffset - postOffset;\n\n // Whether the target offset changed after the first offset move.\n const offsetChanged = postOffset !== offset;\n\n // Difference between the current offset move and the move already applied.\n const postDiff = postOffsetDiff - offsetDiff;\n\n // If the first offset move already normalized a target DST gap forward, the\n // generic post-DST correction below would undo that valid normalization. This\n // happens, for example, with America/New_York 02:00 during spring-forward when\n // the system zone also changes offset around the same instant.\n const targetDSTShift = postOffset - offset;\n\n // Candidate timestamp that would represent the requested wall-clock time with\n // the post-transition target offset. If it still does not round-trip to the\n // requested wall-clock fields, the requested time is inside a target DST gap.\n const postOffsetCandidate = expectedInternalTime - postOffset * 60 * 1000;\n\n // Only positive target offset shifts are spring-forward gaps. Negative shifts\n // are fall-back overlaps and still need the regular post-adjustment path.\n const normalizedTargetDSTGap = targetDSTShift > 0 && targetInternalTime(date) - expectedInternalTime === targetDSTShift * 60 * 1000 && targetInternalTime(date, postOffsetCandidate) !== expectedInternalTime;\n if (offsetChanged && postDiff && !normalizedTargetDSTGap) {\n // Apply the target-DST correction to external. In the backward-crossing case\n // shown here, this lands on an intermediate value that needs `offsetChange`\n // below.\n //\n // o external as America/New_York: 2023-03-12 03:00 EDT\n // |\n // | + `postDiff`\n // v\n // x external as America/New_York: 2023-03-12 01:00 EST\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Target offset after applying `postDiff`. It may change again if the\n // correction itself crosses a target-zone DST boundary.\n const newOffsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset after applying `postDiff`.\n const newOffset = newOffsetWithSeconds > 0 ? Math.floor(newOffsetWithSeconds) : Math.ceil(newOffsetWithSeconds);\n\n // Offset change caused by the `postDiff` move itself.\n const offsetChange = postOffset - newOffset;\n\n // If the correction moved external backward across the target DST boundary,\n // apply the boundary change so external lands on the valid target-zone\n // timestamp. Forward crossings are already normalized by native Date, and\n // applying this correction there would undo the valid post-DST result.\n if (offsetChange && postDiff < 0) {\n // Apply the second target-DST correction to external.\n //\n // o external as America/New_York: 2023-03-12 01:00 EST\n // |\n // | + `offsetChange`\n // v\n // x external as America/New_York: 2023-03-12 03:00 EDT\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n\n // Rebuild internal wall-clock fields from the final external timestamp.\n syncToInternal(date);\n\n // Native Date can normalize historical system offsets with minute and second\n // precision before we adjust to the target time zone. Correct only small\n // historical drift so DST gap normalization (usually one hour) remains intact.\n const expectedTime = constructorArgs ? expectedInternalTime : expectedInternalTime + secondsOffset * 1000;\n const drift = expectedTime - +date.internal;\n if (drift && Math.abs(drift) < 30 * 60 * 1000) {\n Date.prototype.setTime.call(date, +date + drift);\n syncToInternal(date);\n }\n}\nfunction constructorArgsToInternalTime(args) {\n // Mirror Date's date-value constructor defaults while preserving explicit\n // `undefined` behavior. Missing month/day default, but passed `undefined`\n // should remain invalid just like `Date.UTC(year, undefined, ...)`.\n return Date.UTC(args[0], args.length > 1 ? args[1] : 0, args.length > 2 ? args[2] : 1, ...args.slice(3));\n}\nfunction targetInternalTime(date, time) {\n // Compute the target-zone wall-clock representation for a timestamp without\n // mutating the TZDate. This mirrors syncToInternal for temporary checks.\n const internal = new Date(time ?? +date);\n internal.setUTCSeconds(internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, internal) * 60));\n return +internal;\n}"],"x_google_ignoreList":[0],"mappings":";;AA2BA,IAAa,IAAb,MAAa,UAAmB,KAAK;CAGnC,YAAY,GAAG,GAAM;EAWnB,AAVA,MAAM,GAIF,EAAK,SAAS,KAAK,OAAO,EAAK,EAAK,SAAS,MAAO,aACtD,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AAsB,IAAuB,IAAa,KAAK,KAI/D,IAAyB,IAAiB,KAAK,EAAmB,CAAI,IAAI,MAAyB,IAAiB,KAAK,OAAQ,EAAmB,GAAM,CAAmB,MAAM;CACzL,IAAI,KAAiB,KAAY,CAAC,GAAwB;EAWxD,KAAK,UAAU,cAAc,KAAK,GAAM,KAAK,UAAU,cAAc,KAAK,CAAI,IAAI,CAAQ;EAI1F,IAAM,IAAuB,EAAS,EAAK,UAAU,CAAI,GAMnD,IAAe,KAHH,IAAuB,IAAI,KAAK,MAAM,CAAoB,IAAI,KAAK,KAAK,CAAoB;EAS9G,AAAI,KAAgB,IAAW,KAS7B,KAAK,UAAU,cAAc,KAAK,GAAM,KAAK,UAAU,cAAc,KAAK,CAAI,IAAI,CAAY;CAElG;CAKA,EAAe,CAAI;CAMnB,IAAM,KADe,IAAkB,IAAuB,IAAuB,IAAgB,OACxE,CAAC,EAAK;CACnC,AAAI,KAAS,KAAK,IAAI,CAAK,IAAI,OAAU,QACvC,KAAK,UAAU,QAAQ,KAAK,GAAM,CAAC,IAAO,CAAK,GAC/C,EAAe,CAAI;AAEvB;AACA,SAAS,EAA8B,GAAM;CAI3C,OAAO,KAAK,IAAI,EAAK,IAAI,EAAK,SAAS,IAAI,EAAK,KAAK,GAAG,EAAK,SAAS,IAAI,EAAK,KAAK,GAAG,GAAG,EAAK,MAAM,CAAC,CAAC;AACzG;AACA,SAAS,EAAmB,GAAM,GAAM;CAGtC,IAAM,IAAW,IAAI,KAAK,KAAQ,CAAC,CAAI;CAEvC,OADA,EAAS,cAAc,EAAS,cAAc,IAAI,KAAK,MAAM,CAAC,EAAS,EAAK,UAAU,CAAQ,IAAI,EAAE,CAAC,GAC9F,CAAC;AACV"}
|
|
1
|
+
{"version":3,"file":"index19.js","names":[],"sources":["../../../node_modules/@date-fns/tz/date/mini.js"],"sourcesContent":["import { tzOffset } from \"../tzOffset/index.js\";\n\n// TZDate stores time in two `Date` objects because native `Date` can only\n// expose local fields in the system time zone.\n//\n// The external date (`this`) stores the real timestamp. It is the value used by\n// `getTime()`, `valueOf()`, UTC getters/setters, comparisons, and arithmetic.\n// Its local getters are not used for target-zone fields because they would read\n// the timestamp through the system time zone.\n//\n// The internal date (`this.internal`) stores the target-zone wall-clock fields.\n// We read and write those fields through UTC getters/setters so the host system\n// time zone cannot reinterpret them. For example, `getHours()` returns\n// `internal.getUTCHours()`, and `setHours()` writes `internal.setUTCHours(...)`.\n//\n// Syncing moves data between the two representations:\n//\n// - `syncToInternal` starts from the external timestamp and rebuilds internal\n// wall-clock fields using `this.timeZone` offset.\n//\n// - `syncFromInternal` starts from internal wall-clock fields, writes them into\n// the external date, then adjusts that timestamp for the system/target offset\n// difference and DST edge cases.\n//\n// The public TZDate value is the combination of both: external is the instant,\n// internal is the wall-clock view of that instant in `this.timeZone`.\n\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n\n // Time zone string is always the last string argument unless date string\n // is passed (as a single argument).\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n\n // Validate the time zone by checking its offset.\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n // No arguments passed: use current time\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n // Timestamp passed: use it as is\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n // `Date` string passed: parse it as external date\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n // `Date` passed: use its timestamp\n this.setTime(+args[0]);\n } else {\n // `Date` values passed:\n\n // Set it as external date.\n this.setTime(+new Date(...args));\n\n // Adjust internal and external dates considering that we might have\n // landed on the DST hour.\n adjustToSystemTZ(this, args);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n const offset = -tzOffset(this.timeZone, this);\n // Remove the seconds offset using `Math.floor` for negative UTC time zones\n // and `Math.ceil` for positive UTC time zones.\n return offset > 0 ? Math.floor(offset) : Math.ceil(offset);\n }\n\n //#endregion\n\n //#region time\n\n setTime(_time) {\n // Use the native `setTime` to the external date time.\n Date.prototype.setTime.apply(this, arguments);\n\n // Then apply it to the internal date adjusting to the timezone offset.\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * @internal\n * Function syncs time to internal date, applying the current time zone offset.\n *\n * @param {Date} date - `Date` to sync\n */\nfunction syncToInternal(date) {\n // Start internal from the same real timestamp as external.\n date.internal.setTime(+date);\n\n // Shift internal by the target offset so its UTC fields become the target-zone\n // wall-clock fields for the external timestamp.\n //\n // o internal UTC fields: 2024-02-11 00:00\n // |\n // | + Asia/Singapore offset (+08:00)\n // v\n // x internal UTC fields: 2024-02-11 08:00\n //\n date.internal.setUTCSeconds(date.internal.getUTCSeconds() -\n // Round after converting minutes to seconds to avoid fractional offset\n // precision errors from historical offsets.\n Math.round(-tzOffset(date.timeZone, date) * 60));\n}\n\n/**\n * @internal\n * Function syncs internal wall-clock fields into the external date.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // Copy target-zone wall-clock fields from internal into external using native\n // local setters. At this point external holds the right field values but they\n // are interpreted in the system time zone; `adjustToSystemTZ` fixes that.\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * @internal\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * We use it when constructing `TZDate` and syncing the external date from\n * the internal one.\n *\n * @param {TZDate} date - `TZDate` to adjust.\n */\nfunction adjustToSystemTZ(date, constructorArgs) {\n // Keep the intended target-zone wall-clock value before native Date/system\n // time zone normalization can move it. Later corrections compare against this\n // value to distinguish intended DST normalization from accidental drift.\n const expectedInternalTime = Array.isArray(constructorArgs) ? constructorArgsToInternalTime(constructorArgs) : +date.internal;\n //#region Initial offset calculation\n\n // Current target time zone offset at the native timestamp. It may include\n // historical offset seconds, which we preserve for the seconds adjustment.\n const offsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset used by minute-based timestamp adjustments.\n // Historical offsets can contain seconds, so we strip the fractional minute\n // here and handle remaining seconds in the seconds adjustment below.\n const offset = offsetWithSeconds > 0 ? Math.floor(offsetWithSeconds) : Math.ceil(offsetWithSeconds);\n\n //#endregion\n\n //#region System DST adjustment\n\n // Native `Date` may normalize the requested wall time when the system time\n // zone skips that hour for DST.\n //\n // We compare the system wall-clock hour represented by the external date with\n // the wall-clock hour stored in the internal date. If they differ, the next\n // offset-diff calculation may need the previous system offset, because the\n // current external timestamp is already after the system DST jump.\n\n // Previous-hour reference used to detect whether the system offset changed\n // immediately before the current native timestamp.\n const prevHour = new Date(+date);\n\n // Use UTC math so subtracting one hour cannot be normalized back into the\n // same missing local DST hour.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Current system offset at the native timestamp.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n\n // System offset one real hour before the native timestamp.\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n\n // Non-zero when the system offset changed between `prevHour` and `date`.\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n\n // System offset to use in the later system-target offset difference.\n // Defaults to the current system offset and switches to the previous offset\n // only when native `Date` normalized a missing system wall time.\n let systemOffsetForDiff = systemOffset;\n if (systemDSTChange && systemOffset !== offset) {\n // System wall-clock hour represented by the current external timestamp.\n const systemHour = Date.prototype.getHours.apply(date);\n\n // Target wall-clock hour currently stored in internal fields. Constructors\n // get it from arguments because internal may have already been synced from\n // the normalized external timestamp; setters get it directly from internal.\n const expectedHour = Array.isArray(constructorArgs) ? constructorArgs[3] || 0 : date.internal.getUTCHours();\n if (systemHour !== expectedHour) {\n // Check whether using the current system offset would keep the target\n // offset unchanged. If so, the only DST jump we crossed is the system\n // one, so the diff should use the pre-DST system offset.\n const testDate = new Date(+date);\n\n // Difference that the later offset-diff step would apply with the\n // current system offset.\n const testOffsetDiff = systemOffset - offset;\n if (testOffsetDiff) testDate.setUTCMinutes(testDate.getUTCMinutes() + testOffsetDiff);\n\n // Target offset after applying the current system offset difference.\n const testOffsetWithSeconds = tzOffset(date.timeZone, testDate);\n\n // Target offset without historical seconds, matching `offset`.\n const testOffset = testOffsetWithSeconds > 0 ? Math.floor(testOffsetWithSeconds) : Math.ceil(testOffsetWithSeconds);\n if (testOffset === offset) systemOffsetForDiff = prevHourSystemOffset;\n }\n }\n\n //#endregion\n\n //#region System diff adjustment\n\n // Move external from the system-zone interpretation of internal fields toward\n // the timestamp that represents those fields in the target time zone.\n //\n // At this point native `Date` has treated the internal wall-clock fields as if\n // they belonged to the system zone. The system-target offset difference moves\n // external by the distance between that system interpretation and the target\n // interpretation.\n\n // Difference between the system offset selected above and the minute-precision\n // target offset. Positive values move external forward; negative values move\n // it backward.\n const offsetDiff = systemOffsetForDiff - offset;\n if (offsetDiff)\n // Apply the system-target minute difference to external. Internal is\n // rebuilt from the final external timestamp after all adjustments are\n // complete.\n //\n // o external as target: 2023-01-31 23:00\n // |\n // | add `offsetDiff`\n // v\n // x external as target: 2023-02-01 12:00\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Seconds system diff adjustment\n\n // Historical time zone offsets can include seconds, but the minute-based\n // offset adjustment above intentionally used minute precision.\n //\n // This adjustment applies the remaining seconds difference to external. For\n // example, historical Singapore used UTC+06:55:25, while ISO formatting shows\n // only `+06:55`; without the seconds correction, setter paths keep the wrong\n // wall-clock seconds.\n\n // Clone external as a native `Date` so we can inspect how the system time zone\n // represents the same timestamp.\n const systemDate = new Date(+date);\n\n // Zero UTC seconds before reading system seconds. Any remaining local seconds\n // then come from the system time zone offset rather than from the timestamp's\n // own seconds value.\n systemDate.setUTCSeconds(0);\n\n // Seconds part contributed by the system time zone offset. Negative offsets\n // need wrapping because `Date#getSeconds()` returns values in the 0..59 range.\n const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;\n\n // Seconds part contributed by the target time zone offset.\n const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;\n if (secondsOffset || systemSecondsOffset)\n // Apply the remaining second-level system-target difference to external.\n //\n // o external as Asia/Singapore: 1900-01-01 00:00:56\n // |\n // | + `secondsOffset`\n // | + `systemSecondsOffset`\n // v\n // x external as Asia/Singapore: 1900-01-01 00:00:31\n //\n Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n // The first system-target offset move can cross a target-zone DST boundary.\n //\n // When that happens, the target offset at the new external timestamp differs\n // from the target offset used for `offsetDiff`. We compare the original move\n // with the move that would be calculated at the new timestamp, then apply the\n // difference to external.\n\n // Target offset at the current external timestamp, including historical\n // seconds for the later seconds adjustment.\n const postOffsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset at the current external timestamp.\n const postOffset = postOffsetWithSeconds > 0 ? Math.floor(postOffsetWithSeconds) : Math.ceil(postOffsetWithSeconds);\n\n // System offset at the current external timestamp.\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n\n // System-target offset difference at the current external timestamp.\n const postOffsetDiff = postSystemOffset - postOffset;\n\n // Whether the target offset changed after the first offset move.\n const offsetChanged = postOffset !== offset;\n\n // Difference between the current offset move and the move already applied.\n const postDiff = postOffsetDiff - offsetDiff;\n\n // If the first offset move already normalized a target DST gap forward, the\n // generic post-DST correction below would undo that valid normalization. This\n // happens, for example, with America/New_York 02:00 during spring-forward when\n // the system zone also changes offset around the same instant.\n const targetDSTShift = postOffset - offset;\n\n // Candidate timestamp that would represent the requested wall-clock time with\n // the post-transition target offset. If it still does not round-trip to the\n // requested wall-clock fields, the requested time is inside a target DST gap.\n const postOffsetCandidate = expectedInternalTime - postOffset * 60 * 1000;\n\n // Only positive target offset shifts are spring-forward gaps. Negative shifts\n // are fall-back overlaps and still need the regular post-adjustment path.\n const normalizedTargetDSTGap = targetDSTShift > 0 && targetInternalTime(date) - expectedInternalTime === targetDSTShift * 60 * 1000 && targetInternalTime(date, postOffsetCandidate) !== expectedInternalTime;\n if (offsetChanged && postDiff && !normalizedTargetDSTGap) {\n // Apply the target-DST correction to external. In the backward-crossing case\n // shown here, this lands on an intermediate value that needs `offsetChange`\n // below.\n //\n // o external as America/New_York: 2023-03-12 03:00 EDT\n // |\n // | + `postDiff`\n // v\n // x external as America/New_York: 2023-03-12 01:00 EST\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Target offset after applying `postDiff`. It may change again if the\n // correction itself crosses a target-zone DST boundary.\n const newOffsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset after applying `postDiff`.\n const newOffset = newOffsetWithSeconds > 0 ? Math.floor(newOffsetWithSeconds) : Math.ceil(newOffsetWithSeconds);\n\n // Offset change caused by the `postDiff` move itself.\n const offsetChange = postOffset - newOffset;\n\n // If the correction moved external backward across the target DST boundary,\n // apply the boundary change so external lands on the valid target-zone\n // timestamp. Forward crossings are already normalized by native Date, and\n // applying this correction there would undo the valid post-DST result.\n if (offsetChange && postDiff < 0) {\n // Apply the second target-DST correction to external.\n //\n // o external as America/New_York: 2023-03-12 01:00 EST\n // |\n // | + `offsetChange`\n // v\n // x external as America/New_York: 2023-03-12 03:00 EDT\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n\n // Rebuild internal wall-clock fields from the final external timestamp.\n syncToInternal(date);\n\n // Native Date can normalize historical system offsets with minute and second\n // precision before we adjust to the target time zone. Correct only small\n // historical drift so DST gap normalization (usually one hour) remains intact.\n const expectedTime = constructorArgs ? expectedInternalTime : expectedInternalTime + secondsOffset * 1000;\n const drift = expectedTime - +date.internal;\n if (drift && Math.abs(drift) < 30 * 60 * 1000) {\n Date.prototype.setTime.call(date, +date + drift);\n syncToInternal(date);\n }\n}\nfunction constructorArgsToInternalTime(args) {\n // Mirror Date's date-value constructor defaults while preserving explicit\n // `undefined` behavior. Missing month/day default, but passed `undefined`\n // should remain invalid just like `Date.UTC(year, undefined, ...)`.\n return Date.UTC(args[0], args.length > 1 ? args[1] : 0, args.length > 2 ? args[2] : 1, ...args.slice(3));\n}\nfunction targetInternalTime(date, time) {\n // Compute the target-zone wall-clock representation for a timestamp without\n // mutating the TZDate. This mirrors syncToInternal for temporary checks.\n const internal = new Date(time ?? +date);\n internal.setUTCSeconds(internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, internal) *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F,CAAC;AACV"}
|
package/dist/index195.js
CHANGED
package/dist/index195.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index195.js","names":[],"sources":["../../../node_modules/@base-ui/react/merge-props/mergeProps.mjs"],"sourcesContent":["import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n if (!c && !d && !e && !a) {\n return createInitialMergedProps(b);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(a);\n if (b) {\n merged = mergeInto(merged, b);\n }\n if (c) {\n merged = mergeInto(merged, c);\n }\n if (d) {\n merged = mergeInto(merged, d);\n }\n if (e) {\n merged = mergeInto(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return createInitialMergedProps(props[0]);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(props[0]);\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeInto(merged, props[i]);\n }\n return merged;\n}\nfunction createInitialMergedProps(inputProps) {\n if (isPropsGetter(inputProps)) {\n // Getter-returned handlers intentionally keep their existing semantics.\n return {\n ...resolvePropsGetter(inputProps, EMPTY_PROPS)\n };\n }\n return copyInitialProps(inputProps);\n}\nfunction mergeInto(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return resolvePropsGetter(inputProps, merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\nfunction copyInitialProps(inputProps) {\n const copiedProps = {\n ...inputProps\n };\n\n // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.\n // eslint-disable-next-line guard-for-in\n for (const propName in copiedProps) {\n const propValue = copiedProps[propName];\n if (isEventHandler(propName, propValue)) {\n copiedProps[propName] = wrapEventHandler(propValue);\n }\n }\n return copiedProps;\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction resolvePropsGetter(inputProps, previousProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(previousProps);\n }\n return inputProps ?? EMPTY_PROPS;\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return wrapEventHandler(theirHandler);\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(...args);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(...args);\n }\n return result;\n }\n const result = theirHandler(...args);\n ourHandler?.(...args);\n return result;\n };\n}\nfunction wrapEventHandler(handler) {\n if (!handler) {\n return handler;\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n makeEventPreventable(event);\n }\n return handler(...args);\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}"],"x_google_ignoreList":[0],"mappings":";;AACA,IAAM,IAAc,CAAC;AAiCrB,SAAgB,EAAW,GAAG,GAAG,GAAG,GAAG,GAAG;CACxC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GACrB,OAAO,EAAyB,CAAC;CAInC,IAAI,IAAS,EAAyB,CAAC;CAavC,OAZI,MACF,IAAS,EAAU,GAAQ,CAAC,IAE1B,MACF,IAAS,EAAU,GAAQ,CAAC,IAE1B,MACF,IAAS,EAAU,GAAQ,CAAC,IAE1B,MACF,IAAS,EAAU,GAAQ,CAAC,IAEvB;AACT;AAgBA,SAAgB,EAAY,GAAO;CACjC,IAAI,EAAM,WAAW,GACnB,OAAO;CAET,IAAI,EAAM,WAAW,GACnB,OAAO,EAAyB,EAAM,EAAE;CAI1C,IAAI,IAAS,EAAyB,EAAM,EAAE;CAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,EAAM,QAAQ,KAAK,GACrC,IAAS,EAAU,GAAQ,EAAM,EAAE;CAErC,OAAO;AACT;AACA,SAAS,EAAyB,GAAY;CAO5C,OANI,EAAc,CAAU,IAEnB,EACL,GAAG,EAAmB,GAAY,CAAW,EAC/C,IAEK,EAAiB,CAAU;AACpC;AACA,SAAS,EAAU,GAAQ,GAAY;CAIrC,OAHI,EAAc,CAAU,IACnB,EAAmB,GAAY,CAAM,IAEvC,EAAiB,GAAQ,CAAU;AAC5C;AACA,SAAS,EAAiB,GAAY;CACpC,IAAM,IAAc,EAClB,GAAG,EACL;CAIA,KAAK,IAAM,KAAY,GAAa;EAClC,IAAM,IAAY,EAAY;EAC9B,AAAI,EAAe,GAAU,CAAS,MACpC,EAAY,KAAY,EAAiB,CAAS;CAEtD;CACA,OAAO;AACT;AAKA,SAAS,EAAiB,GAAa,GAAe;CACpD,IAAI,CAAC,GACH,OAAO;CAIT,KAAK,IAAM,KAAY,GAAe;EACpC,IAAM,IAAoB,EAAc;EACxC,QAAQ,GAAR;GACE,KAAK;IAED,EAAY,KAAY,EAAa,EAAY,OAAO,CAAiB;IACzE;GAEJ,KAAK;IAED,EAAY,KAAY,EAAgB,EAAY,WAAW,CAAiB;IAChF;GAEJ,SAEI,
|
|
1
|
+
{"version":3,"file":"index195.js","names":[],"sources":["../../../node_modules/@base-ui/react/merge-props/mergeProps.mjs"],"sourcesContent":["import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n if (!c && !d && !e && !a) {\n return createInitialMergedProps(b);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(a);\n if (b) {\n merged = mergeInto(merged, b);\n }\n if (c) {\n merged = mergeInto(merged, c);\n }\n if (d) {\n merged = mergeInto(merged, d);\n }\n if (e) {\n merged = mergeInto(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return createInitialMergedProps(props[0]);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(props[0]);\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeInto(merged, props[i]);\n }\n return merged;\n}\nfunction createInitialMergedProps(inputProps) {\n if (isPropsGetter(inputProps)) {\n // Getter-returned handlers intentionally keep their existing semantics.\n return {\n ...resolvePropsGetter(inputProps, EMPTY_PROPS)\n };\n }\n return copyInitialProps(inputProps);\n}\nfunction mergeInto(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return resolvePropsGetter(inputProps, merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\nfunction copyInitialProps(inputProps) {\n const copiedProps = {\n ...inputProps\n };\n\n // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.\n // eslint-disable-next-line guard-for-in\n for (const propName in copiedProps) {\n const propValue = copiedProps[propName];\n if (isEventHandler(propName, propValue)) {\n copiedProps[propName] = wrapEventHandler(propValue);\n }\n }\n return copiedProps;\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction resolvePropsGetter(inputProps, previousProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(previousProps);\n }\n return inputProps ?? EMPTY_PROPS;\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return wrapEventHandler(theirHandler);\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(...args);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(...args);\n }\n return result;\n }\n const result = theirHandler(...args);\n ourHandler?.(...args);\n return result;\n };\n}\nfunction wrapEventHandler(handler) {\n if (!handler) {\n return handler;\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n makeEventPreventable(event);\n }\n return handler(...args);\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}"],"x_google_ignoreList":[0],"mappings":";;AACA,IAAM,IAAc,CAAC;AAiCrB,SAAgB,EAAW,GAAG,GAAG,GAAG,GAAG,GAAG;CACxC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GACrB,OAAO,EAAyB,CAAC;CAInC,IAAI,IAAS,EAAyB,CAAC;CAavC,OAZI,MACF,IAAS,EAAU,GAAQ,CAAC,IAE1B,MACF,IAAS,EAAU,GAAQ,CAAC,IAE1B,MACF,IAAS,EAAU,GAAQ,CAAC,IAE1B,MACF,IAAS,EAAU,GAAQ,CAAC,IAEvB;AACT;AAgBA,SAAgB,EAAY,GAAO;CACjC,IAAI,EAAM,WAAW,GACnB,OAAO;CAET,IAAI,EAAM,WAAW,GACnB,OAAO,EAAyB,EAAM,EAAE;CAI1C,IAAI,IAAS,EAAyB,EAAM,EAAE;CAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,EAAM,QAAQ,KAAK,GACrC,IAAS,EAAU,GAAQ,EAAM,EAAE;CAErC,OAAO;AACT;AACA,SAAS,EAAyB,GAAY;CAO5C,OANI,EAAc,CAAU,IAEnB,EACL,GAAG,EAAmB,GAAY,CAAW,EAC/C,IAEK,EAAiB,CAAU;AACpC;AACA,SAAS,EAAU,GAAQ,GAAY;CAIrC,OAHI,EAAc,CAAU,IACnB,EAAmB,GAAY,CAAM,IAEvC,EAAiB,GAAQ,CAAU;AAC5C;AACA,SAAS,EAAiB,GAAY;CACpC,IAAM,IAAc,EAClB,GAAG,EACL;CAIA,KAAK,IAAM,KAAY,GAAa;EAClC,IAAM,IAAY,EAAY;EAC9B,AAAI,EAAe,GAAU,CAAS,MACpC,EAAY,KAAY,EAAiB,CAAS;CAEtD;CACA,OAAO;AACT;AAKA,SAAS,EAAiB,GAAa,GAA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ACF;AACA,SAAgB,EAAqB,GAAO;CAI1C,OAHA,EAAM,6BAA6B;EACjC,EAAM,yBAAyB;CACjC,GACO;AACT;AACA,SAAgB,EAAgB,GAAc,GAAgB;CAQ5D,OAPI,IACE,IAEK,IAAiB,MAAM,IAEzB,IAEF;AACT;AACA,SAAS,EAAiB,GAAO;CAC/B,OAAwB,OAAO,KAAU,cAAlC,KAA8C,iBAAiB;AACxE"}
|
package/dist/index196.js
CHANGED
|
@@ -17,11 +17,11 @@ function h(e, t, n = {}) {
|
|
|
17
17
|
}
|
|
18
18
|
function g(e, a = {}) {
|
|
19
19
|
let { className: d, style: f, render: p } = e, { state: m = o, ref: h, props: g, stateAttributesMapping: v, enabled: y = !0 } = a, b = y ? c(d, m) : void 0, x = y ? l(f, m) : void 0, S = y ? s(m, v) : o, C = y && g ? _(g) : void 0, w = y ? i(S, C) ?? {} : o;
|
|
20
|
-
return typeof document < "u" && (y ? Array.isArray(h) ?
|
|
20
|
+
return typeof document < "u" && (y ? w.ref = Array.isArray(h) ? n([
|
|
21
21
|
w.ref,
|
|
22
22
|
r(p),
|
|
23
23
|
...h
|
|
24
|
-
]) :
|
|
24
|
+
]) : t(w.ref, r(p), h) : t(null, null)), y ? (b !== void 0 && (w.className = u(w.className, b)), x !== void 0 && (w.style = i(w.style, x)), w) : o;
|
|
25
25
|
}
|
|
26
26
|
function _(e) {
|
|
27
27
|
return Array.isArray(e) ? f(e) : d(void 0, e);
|