@rpcbase/ui 0.166.0 → 0.167.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/index100.js +318 -8
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +126 -38
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +20 -4
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +76 -52
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +18 -4
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +101 -4
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +5 -16
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +14 -5
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +2 -8
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +7 -16
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +13 -4
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +326 -4
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +49 -4
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +52 -6
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +4 -5
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +4 -4
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +14 -3
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +5 -6
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +7 -24
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +16 -6
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +4 -4
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +4 -6
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +5 -5
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +5 -4
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +4 -5
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +4 -4
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +5 -7
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +24 -5
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +6 -4
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +4 -4
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +6 -6
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +1 -1
- package/dist/index130.js +5 -145
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +4 -39
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +5 -4
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +4 -7
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +8 -13
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +5 -13
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +4 -7
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +4 -31
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +6 -10
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +145 -10
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +3 -3
- package/dist/index140.js +38 -7
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +4 -13
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +5 -99
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +14 -20
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +13 -53
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +6 -71
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +31 -9
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +10 -20
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +10 -16
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +8 -23
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +13 -6
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +101 -5
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +20 -24
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +53 -34
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +73 -16
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +9 -6
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +20 -4
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +16 -4
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +23 -4
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +6 -4
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +5 -3
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +23 -6
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +35 -24
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +16 -8
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +5 -5
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +4 -5
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +4 -3
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +4 -3
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +4 -4
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +3 -3
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +6 -4
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +24 -4
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +7 -3
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +6 -3
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +5 -24
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +4 -29
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +4 -5
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +4 -67
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +3 -180
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +4 -46
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +10 -1
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +3 -13
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +3 -154
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +3 -30
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +3 -9
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +2 -48
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +67 -11
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +83 -43
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +41 -90
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +7 -86
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +4 -105
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +6 -6
- package/dist/index190.js +49 -50
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +24 -11
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +29 -38
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +5 -9
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +5 -116
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +67 -16
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +2 -16
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +363 -3
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +259 -34
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +59 -19
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +1 -1
- package/dist/index200.js +46 -9
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +169 -8
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +108 -18
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +24 -28
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +8 -17
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +4 -58
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +5 -8
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +4 -66
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +464 -17
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +183 -14
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +1 -1
- package/dist/index210.js +106 -4
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +261 -4
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +9 -6
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +42 -4
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +4 -7
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +64 -17
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +47 -4
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +67 -5
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +180 -13
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +46 -10
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +39 -14
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +100 -14
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +97 -5
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +99 -6
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +58 -7
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +8 -6
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +66 -9
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +19 -5
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +16 -5
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +5 -9
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +1 -1
- package/dist/index230.js +5 -5
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +6 -5
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +4 -4
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +7 -11
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +16 -9
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +5 -10
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +5 -11
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +13 -11
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +10 -10
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +13 -6
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +14 -6
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +4 -4
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +6 -6
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +6 -6
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -5
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +9 -55
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +5 -23
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +5 -16
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +9 -7
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +5 -10
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +5 -10
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +4 -21
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +11 -10
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +10 -9
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +10 -9
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +11 -4
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +11 -5
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +10 -16
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +7 -9
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +6 -18
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +5 -15
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +6 -12
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +7 -29
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +6 -12
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +54 -24
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +23 -5
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +17 -5
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +8 -3
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +10 -23
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +10 -112
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +21 -15
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +10 -524
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +9 -127
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +9 -133
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +4 -20
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +5 -4
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +16 -18
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +9 -12
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +19 -69
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +15 -8
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +1 -1
- package/dist/index280.js +13 -14
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +30 -66
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +12 -64
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +25 -5
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +5 -5
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +2 -4
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +2 -16
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +5 -9
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +3 -6
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +23 -4
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +5 -5
- package/dist/index290.js +111 -544
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +15 -46
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +521 -14
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +127 -6
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +133 -8
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +13 -7
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +154 -8
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +30 -12
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +9 -9
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +47 -13
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +47 -231
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +11 -3
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +43 -21
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +95 -4
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +85 -54
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +105 -67
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +53 -31
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +12 -9
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +36 -151
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +9 -108
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +4 -23
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +218 -49
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +10 -13
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +113 -24
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +18 -5
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +15 -15
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +33 -25
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +20 -12
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +8 -6
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +23 -0
- package/dist/index317.js.map +1 -0
- package/dist/index318.js +32 -0
- package/dist/index318.js.map +1 -0
- package/dist/index319.js +20 -0
- package/dist/index319.js.map +1 -0
- package/dist/index32.js +36 -2633
- package/dist/index32.js.map +1 -1
- package/dist/index320.js +8 -0
- package/dist/index320.js.map +1 -0
- package/dist/index321.js +22 -0
- package/dist/index321.js.map +1 -0
- package/dist/index322.js +16 -0
- package/dist/index322.js.map +1 -0
- package/dist/index323.js +72 -0
- package/dist/index323.js.map +1 -0
- package/dist/index324.js +12 -0
- package/dist/index324.js.map +1 -0
- package/dist/index325.js +17 -0
- package/dist/index325.js.map +1 -0
- package/dist/index326.js +69 -0
- package/dist/index326.js.map +1 -0
- package/dist/index327.js +68 -0
- package/dist/index327.js.map +1 -0
- package/dist/index328.js +24 -0
- package/dist/index328.js.map +1 -0
- package/dist/index329.js +9 -0
- package/dist/index329.js.map +1 -0
- package/dist/index33.js +35 -388
- package/dist/index33.js.map +1 -1
- package/dist/index330.js +9 -0
- package/dist/index330.js.map +1 -0
- package/dist/index331.js +7 -0
- package/dist/index331.js.map +1 -0
- package/dist/index332.js +19 -0
- package/dist/index332.js.map +1 -0
- package/dist/index333.js +12 -0
- package/dist/index333.js.map +1 -0
- package/dist/index334.js +9 -0
- package/dist/index334.js.map +1 -0
- package/dist/index335.js +8 -0
- package/dist/index335.js.map +1 -0
- package/dist/index336.js +549 -0
- package/dist/index336.js.map +1 -0
- package/dist/index337.js +50 -0
- package/dist/index337.js.map +1 -0
- package/dist/index338.js +21 -0
- package/dist/index338.js.map +1 -0
- package/dist/index339.js +10 -0
- package/dist/index339.js.map +1 -0
- package/dist/index34.js +26 -230
- package/dist/index34.js.map +1 -1
- package/dist/index340.js +12 -0
- package/dist/index340.js.map +1 -0
- package/dist/index341.js +11 -0
- package/dist/index341.js.map +1 -0
- package/dist/index342.js +12 -0
- package/dist/index342.js.map +1 -0
- package/dist/index343.js +16 -0
- package/dist/index343.js.map +1 -0
- package/dist/index344.js +13 -0
- package/dist/index344.js.map +1 -0
- package/dist/index345.js +17 -0
- package/dist/index345.js.map +1 -0
- package/dist/index346.js +7 -0
- package/dist/index346.js.map +1 -0
- package/dist/index347.js +26 -0
- package/dist/index347.js.map +1 -0
- package/dist/index348.js +8 -0
- package/dist/index348.js.map +1 -0
- package/dist/index349.js +59 -0
- package/dist/index349.js.map +1 -0
- package/dist/index35.js +44 -20
- package/dist/index35.js.map +1 -1
- package/dist/index350.js +71 -0
- package/dist/index350.js.map +1 -0
- package/dist/index351.js +34 -0
- package/dist/index351.js.map +1 -0
- package/dist/index352.js +12 -0
- package/dist/index352.js.map +1 -0
- package/dist/index353.js +156 -0
- package/dist/index353.js.map +1 -0
- package/dist/index354.js +111 -0
- package/dist/index354.js.map +1 -0
- package/dist/index355.js +26 -0
- package/dist/index355.js.map +1 -0
- package/dist/index356.js +16 -0
- package/dist/index356.js.map +1 -0
- package/dist/index357.js +31 -0
- package/dist/index357.js.map +1 -0
- package/dist/index358.js +8 -0
- package/dist/index358.js.map +1 -0
- package/dist/index359.js +19 -0
- package/dist/index359.js.map +1 -0
- package/dist/index36.js +27 -137
- package/dist/index36.js.map +1 -1
- package/dist/index360.js +32 -0
- package/dist/index360.js.map +1 -0
- package/dist/index361.js +16 -0
- package/dist/index361.js.map +1 -0
- package/dist/index362.js +10 -0
- package/dist/index362.js.map +1 -0
- package/dist/index37.js +22 -181
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +23 -77
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +127 -89
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +231 -5
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +51 -844
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +2636 -61
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +393 -7
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +233 -2
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +20 -22
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +140 -232
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +180 -198
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +76 -3
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +89 -5
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +5 -47
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +840 -23
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +65 -50
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +7 -7
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +2 -15
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +22 -132
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +233 -10
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +191 -203
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +4 -13
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +6 -33
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +44 -43
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +26 -7
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +48 -47
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +7 -3
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +14 -5
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +133 -27
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +11 -50
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +216 -8
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +13 -2
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +34 -2
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +46 -11
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +7 -53
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +49 -5
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +4 -8
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +5 -5
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +27 -46
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +48 -204
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +8 -21
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +11 -24
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +2 -400
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +2 -47
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +52 -604
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +46 -5
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +199 -62
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +22 -2
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +24 -363
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +381 -243
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +41 -55
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +5 -46
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +7 -169
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +5 -109
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +605 -24
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +4 -8
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +33 -4
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +249 -5
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +114 -4
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +214 -461
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +60 -179
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +18 -105
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +197 -250
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index47.js
CHANGED
|
@@ -1,208 +1,190 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
scope: n,
|
|
32
|
-
triggerId: g(),
|
|
33
|
-
triggerRef: M,
|
|
34
|
-
contentId: g(),
|
|
35
|
-
open: l,
|
|
36
|
-
onOpenChange: w,
|
|
37
|
-
onOpenToggle: p.useCallback(() => w((A) => !A), [w]),
|
|
38
|
-
modal: d,
|
|
39
|
-
children: /* @__PURE__ */ a.jsx(y, { ...c, open: l, onOpenChange: w, dir: e, modal: d, children: r })
|
|
40
|
-
}
|
|
41
|
-
);
|
|
1
|
+
import { MAX_DIAL_CODE_LENGTH as W, COMMON_IDD_PREFIXES as $, DEFAULT_COUNTRY as x, COUNTRY_DIAL_CODES as C } from "./index46.js";
|
|
2
|
+
import { getCountryCallingCode as p } from "./index50.js";
|
|
3
|
+
import { AsYouType as I } from "./index89.js";
|
|
4
|
+
import { validatePhoneNumberLength as D } from "./index90.js";
|
|
5
|
+
function g(t) {
|
|
6
|
+
return t.replace(/\D/g, "");
|
|
7
|
+
}
|
|
8
|
+
function P(t) {
|
|
9
|
+
return t ? t.length > W ? !1 : C.some((e) => e.startsWith(t)) : !0;
|
|
10
|
+
}
|
|
11
|
+
const N = /[\u061C\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;
|
|
12
|
+
function T(t) {
|
|
13
|
+
return t.replace(N, "");
|
|
14
|
+
}
|
|
15
|
+
function q(t, e, s = {}) {
|
|
16
|
+
const { force: u = !1 } = s, o = `+${e}`;
|
|
17
|
+
if (!t.startsWith(o) || !u)
|
|
18
|
+
return t;
|
|
19
|
+
const i = t.slice(o.length).trimStart();
|
|
20
|
+
if (i.startsWith("0"))
|
|
21
|
+
return t;
|
|
22
|
+
if (!i)
|
|
23
|
+
return `${o} 0`;
|
|
24
|
+
const [n, ...r] = i.split(" "), f = `0${n ?? ""}`, l = r.length > 0 ? ` ${r.join(" ")}` : "";
|
|
25
|
+
return `${o} ${f}${l}`.replace(/\s\s+/g, " ").trimEnd();
|
|
26
|
+
}
|
|
27
|
+
const O = {
|
|
28
|
+
GG: "GB",
|
|
29
|
+
JE: "GB",
|
|
30
|
+
IM: "GB"
|
|
42
31
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onPointerDown: m(o.onPointerDown, (d) => {
|
|
61
|
-
!e && d.button === 0 && d.ctrlKey === !1 && (i.onOpenToggle(), i.open || d.preventDefault());
|
|
62
|
-
}),
|
|
63
|
-
onKeyDown: m(o.onKeyDown, (d) => {
|
|
64
|
-
e || (["Enter", " "].includes(d.key) && i.onOpenToggle(), d.key === "ArrowDown" && i.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault());
|
|
65
|
-
})
|
|
66
|
-
}
|
|
67
|
-
) });
|
|
32
|
+
function y(t) {
|
|
33
|
+
if (t)
|
|
34
|
+
return O[t] ?? t;
|
|
35
|
+
}
|
|
36
|
+
function _(t, e, s) {
|
|
37
|
+
if (!t || !s || (t.nationalNumber ?? "").length < 4)
|
|
38
|
+
return;
|
|
39
|
+
const o = t.countryCallingCode;
|
|
40
|
+
if (!o)
|
|
41
|
+
return;
|
|
42
|
+
const i = t.getMetadata, n = (typeof i == "function" ? i() : null)?.country_calling_codes?.[o];
|
|
43
|
+
if (!n || n.length === 0)
|
|
44
|
+
return;
|
|
45
|
+
const r = [];
|
|
46
|
+
for (const f of n) {
|
|
47
|
+
const l = y(f);
|
|
48
|
+
l && !r.includes(l) && r.push(l);
|
|
68
49
|
}
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
50
|
+
if (r.length !== 0)
|
|
51
|
+
return e && r.includes(e) ? e : r.includes(x) ? x : r[0];
|
|
52
|
+
}
|
|
53
|
+
function B(t, e, s, u) {
|
|
54
|
+
if (!t)
|
|
55
|
+
return !1;
|
|
56
|
+
if (!u)
|
|
57
|
+
return t.startsWith("0");
|
|
58
|
+
if (!s || !t.startsWith(s) || !t.slice(s.length).startsWith("0"))
|
|
59
|
+
return !1;
|
|
60
|
+
const o = t.slice(s.length + 1), i = e.startsWith(s) ? e.slice(s.length) : e;
|
|
61
|
+
return o === i;
|
|
62
|
+
}
|
|
63
|
+
function S(t) {
|
|
64
|
+
for (const e of $)
|
|
65
|
+
if (t.startsWith(e))
|
|
66
|
+
return t.slice(e.length);
|
|
67
|
+
return t;
|
|
68
|
+
}
|
|
69
|
+
function M(t, e, s = {}) {
|
|
70
|
+
const { allowJustPlus: u = !1, removeNationalPrefix: o = !0, previousValue: i } = s, n = T(t).trim();
|
|
71
|
+
if (!n)
|
|
72
|
+
return "";
|
|
73
|
+
if (n === "+")
|
|
74
|
+
return u ? "+" : "";
|
|
75
|
+
if (n.startsWith("+")) {
|
|
76
|
+
const a = g(n);
|
|
77
|
+
if (!a)
|
|
78
|
+
return u ? "+" : "";
|
|
79
|
+
const d = S(a);
|
|
80
|
+
if (d !== a)
|
|
81
|
+
return d ? `+${d}` : u ? "+" : "";
|
|
82
|
+
if (o && e) {
|
|
83
|
+
const h = p(e);
|
|
84
|
+
if (a.startsWith(h) && a.slice(h.length).startsWith("0")) {
|
|
85
|
+
const E = a.slice(h.length + 1);
|
|
86
|
+
return E ? `+${h}${E}` : `+${h}`;
|
|
102
87
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
);
|
|
106
|
-
N.displayName = I;
|
|
107
|
-
var Q = "DropdownMenuGroup", V = p.forwardRef(
|
|
108
|
-
(o, n) => {
|
|
109
|
-
const { __scopeDropdownMenu: r, ...e } = o, t = s(r);
|
|
110
|
-
return /* @__PURE__ */ a.jsx(k, { ...t, ...e, ref: n });
|
|
88
|
+
}
|
|
89
|
+
return `+${a}`;
|
|
111
90
|
}
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return
|
|
91
|
+
const r = g(n);
|
|
92
|
+
if (!r)
|
|
93
|
+
return "";
|
|
94
|
+
const f = S(r);
|
|
95
|
+
if (f !== r)
|
|
96
|
+
return f ? `+${f}` : u ? "+" : "";
|
|
97
|
+
const l = typeof i == "string" ? i : "", m = l && l.startsWith("+") ? g(l) : "";
|
|
98
|
+
if (m && m.length > r.length && m.endsWith(r) && m.length - r.length <= W)
|
|
99
|
+
return `+${r}`;
|
|
100
|
+
if (r === "0")
|
|
101
|
+
return "0";
|
|
102
|
+
if (o && e && r.length > 1 && r.startsWith("0") && !r.startsWith("00")) {
|
|
103
|
+
const a = p(e), d = r.slice(1);
|
|
104
|
+
return d ? `+${a}${d}` : `+${a}`;
|
|
118
105
|
}
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
(
|
|
123
|
-
|
|
124
|
-
|
|
106
|
+
return e ? r.length <= 4 ? `+${r}` : `+${p(e)}${r}` : r;
|
|
107
|
+
}
|
|
108
|
+
function Y(t, e) {
|
|
109
|
+
if (t === "+")
|
|
110
|
+
return {
|
|
111
|
+
international: "+",
|
|
112
|
+
national: "",
|
|
113
|
+
formatted: "+",
|
|
114
|
+
phoneNumber: null,
|
|
115
|
+
detectedCountry: void 0,
|
|
116
|
+
inferredCountry: void 0,
|
|
117
|
+
hasExplicitInternationalPrefix: !0
|
|
118
|
+
};
|
|
119
|
+
const s = /^\s*\+/.test(t), u = e ? new I(e) : new I(), o = u.input(t), i = u.getNumber(), c = g(t), n = y(
|
|
120
|
+
i?.country ?? u.country ?? void 0
|
|
121
|
+
), r = n ?? !i ? void 0 : y(
|
|
122
|
+
_(i, e, c)
|
|
123
|
+
), f = i?.formatInternational() ?? o, l = i?.formatNational() ?? g(f);
|
|
124
|
+
return {
|
|
125
|
+
international: f,
|
|
126
|
+
national: l,
|
|
127
|
+
formatted: o,
|
|
128
|
+
phoneNumber: i,
|
|
129
|
+
detectedCountry: n,
|
|
130
|
+
inferredCountry: r,
|
|
131
|
+
hasExplicitInternationalPrefix: s
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function v(t, e) {
|
|
135
|
+
return t.startsWith(e) ? t.slice(e.length) : t;
|
|
136
|
+
}
|
|
137
|
+
function H(t, e) {
|
|
138
|
+
if (!e || !t)
|
|
139
|
+
return null;
|
|
140
|
+
try {
|
|
141
|
+
return D(t, e) === "TOO_LONG" ? "TOO_LONG" : null;
|
|
142
|
+
} catch {
|
|
143
|
+
return null;
|
|
125
144
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
});
|
|
152
|
-
co.displayName = uo;
|
|
153
|
-
var lo = "DropdownMenuArrow", wo = p.forwardRef(
|
|
154
|
-
(o, n) => {
|
|
155
|
-
const { __scopeDropdownMenu: r, ...e } = o, t = s(r);
|
|
156
|
-
return /* @__PURE__ */ a.jsx(W, { ...t, ...e, ref: n });
|
|
145
|
+
}
|
|
146
|
+
function U(t, e, s, u = {}) {
|
|
147
|
+
const {
|
|
148
|
+
hasRemovedNationalPrefix: o = !1,
|
|
149
|
+
detectedCountry: i,
|
|
150
|
+
hasExplicitInternationalPrefix: c = !1
|
|
151
|
+
} = u;
|
|
152
|
+
if (!t)
|
|
153
|
+
return { shouldSuggest: !1, query: "" };
|
|
154
|
+
if (t === "+")
|
|
155
|
+
return { shouldSuggest: !0, query: "" };
|
|
156
|
+
const n = g(t);
|
|
157
|
+
if (!n)
|
|
158
|
+
return { shouldSuggest: !0, query: "" };
|
|
159
|
+
if (o)
|
|
160
|
+
return { shouldSuggest: !1, query: "" };
|
|
161
|
+
if (c && !i)
|
|
162
|
+
return P(n) ? { shouldSuggest: !0, query: n } : { shouldSuggest: !1, query: "" };
|
|
163
|
+
let r = s?.countryCallingCode ?? null;
|
|
164
|
+
if (!r) {
|
|
165
|
+
if (e) {
|
|
166
|
+
const l = p(e);
|
|
167
|
+
n.startsWith(l) && (r = l);
|
|
168
|
+
} else if (!c)
|
|
169
|
+
return { shouldSuggest: !1, query: "" };
|
|
157
170
|
}
|
|
158
|
-
);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const { __scopeDropdownMenu: r, ...e } = o, t = s(r);
|
|
167
|
-
return /* @__PURE__ */ a.jsx(
|
|
168
|
-
X,
|
|
169
|
-
{
|
|
170
|
-
...t,
|
|
171
|
-
...e,
|
|
172
|
-
ref: n,
|
|
173
|
-
style: {
|
|
174
|
-
...o.style,
|
|
175
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
176
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
177
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
178
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
179
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
});
|
|
184
|
-
go.displayName = Mo;
|
|
185
|
-
var bo = _, Ao = R, Co = h, Eo = N, So = b;
|
|
171
|
+
return r ? v(n, r).length === 0 ? { shouldSuggest: !0, query: n } : { shouldSuggest: !1, query: "" } : { shouldSuggest: !0, query: n };
|
|
172
|
+
}
|
|
173
|
+
function V(t, e) {
|
|
174
|
+
if (t.shouldSuggest)
|
|
175
|
+
return !1;
|
|
176
|
+
const { hasExplicitInternationalPrefix: s = !1, detectedCountry: u } = e;
|
|
177
|
+
return s ? !!u : !0;
|
|
178
|
+
}
|
|
186
179
|
export {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
h as DropdownMenuPortal,
|
|
197
|
-
to as DropdownMenuRadioGroup,
|
|
198
|
-
po as DropdownMenuRadioItem,
|
|
199
|
-
co as DropdownMenuSeparator,
|
|
200
|
-
go as DropdownMenuSubContent,
|
|
201
|
-
fo as DropdownMenuSubTrigger,
|
|
202
|
-
R as DropdownMenuTrigger,
|
|
203
|
-
So as Item,
|
|
204
|
-
Co as Portal,
|
|
205
|
-
bo as Root,
|
|
206
|
-
Ao as Trigger
|
|
180
|
+
B as detectNationalPrefixForDisplay,
|
|
181
|
+
Y as formatWithAsYouType,
|
|
182
|
+
H as getLengthIssue,
|
|
183
|
+
U as getSuggestionState,
|
|
184
|
+
q as injectNationalPrefixDisplay,
|
|
185
|
+
M as normalizeInputValue,
|
|
186
|
+
g as sanitizeDigits,
|
|
187
|
+
V as shouldDisplayExplicitCountrySelection,
|
|
188
|
+
v as stripPrefix
|
|
207
189
|
};
|
|
208
190
|
//# sourceMappingURL=index47.js.map
|
package/dist/index47.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index47.js","sources":["../../../node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dropdown-menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as MenuPrimitive from \"@radix-ui/react-menu\";\nimport { createMenuScope } from \"@radix-ui/react-menu\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DROPDOWN_MENU_NAME = \"DropdownMenu\";\nvar [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nvar useMenuScope = createMenuScope();\nvar [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);\nvar DropdownMenu = (props) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DROPDOWN_MENU_NAME\n });\n return /* @__PURE__ */ jsx(\n DropdownMenuProvider,\n {\n scope: __scopeDropdownMenu,\n triggerId: useId(),\n triggerRef,\n contentId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children: /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })\n }\n );\n};\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\nvar TRIGGER_NAME = \"DropdownMenuTrigger\";\nvar DropdownMenuTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n id: context.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"data-state\": context.open ? \"open\" : \"closed\",\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n ...triggerProps,\n ref: composeRefs(forwardedRef, context.triggerRef),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n if (!context.open) event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if ([\"Enter\", \" \"].includes(event.key)) context.onOpenToggle();\n if (event.key === \"ArrowDown\") context.onOpenChange(true);\n if ([\"Enter\", \" \", \"ArrowDown\"].includes(event.key)) event.preventDefault();\n })\n }\n ) });\n }\n);\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DropdownMenuPortal\";\nvar DropdownMenuPortal = (props) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps });\n};\nDropdownMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"DropdownMenuContent\";\nvar DropdownMenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.Content,\n {\n id: context.contentId,\n \"aria-labelledby\": context.triggerId,\n ...menuScope,\n ...contentProps,\n ref: forwardedRef,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n event.preventDefault();\n }),\n onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n }),\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n }\n);\nDropdownMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"DropdownMenuGroup\";\nvar DropdownMenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });\n }\n);\nDropdownMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"DropdownMenuLabel\";\nvar DropdownMenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });\n }\n);\nDropdownMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"DropdownMenuItem\";\nvar DropdownMenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });\n }\n);\nDropdownMenuItem.displayName = ITEM_NAME;\nvar CHECKBOX_ITEM_NAME = \"DropdownMenuCheckboxItem\";\nvar DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });\n});\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"DropdownMenuRadioGroup\";\nvar DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });\n});\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"DropdownMenuRadioItem\";\nvar DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });\n});\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar INDICATOR_NAME = \"DropdownMenuItemIndicator\";\nvar DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });\n});\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\nvar SEPARATOR_NAME = \"DropdownMenuSeparator\";\nvar DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });\n});\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"DropdownMenuArrow\";\nvar DropdownMenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });\n }\n);\nDropdownMenuArrow.displayName = ARROW_NAME;\nvar DropdownMenuSub = (props) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: \"DropdownMenuSub\"\n });\n return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });\n};\nvar SUB_TRIGGER_NAME = \"DropdownMenuSubTrigger\";\nvar DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });\n});\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"DropdownMenuSubContent\";\nvar DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.SubContent,\n {\n ...menuScope,\n ...subContentProps,\n ref: forwardedRef,\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\nvar Root2 = DropdownMenu;\nvar Trigger = DropdownMenuTrigger;\nvar Portal2 = DropdownMenuPortal;\nvar Content2 = DropdownMenuContent;\nvar Group2 = DropdownMenuGroup;\nvar Label2 = DropdownMenuLabel;\nvar Item2 = DropdownMenuItem;\nvar CheckboxItem2 = DropdownMenuCheckboxItem;\nvar RadioGroup2 = DropdownMenuRadioGroup;\nvar RadioItem2 = DropdownMenuRadioItem;\nvar ItemIndicator2 = DropdownMenuItemIndicator;\nvar Separator2 = DropdownMenuSeparator;\nvar Arrow2 = DropdownMenuArrow;\nvar Sub2 = DropdownMenuSub;\nvar SubTrigger2 = DropdownMenuSubTrigger;\nvar SubContent2 = DropdownMenuSubContent;\nexport {\n Arrow2 as Arrow,\n CheckboxItem2 as CheckboxItem,\n Content2 as Content,\n DropdownMenu,\n DropdownMenuArrow,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuItemIndicator,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n Group2 as Group,\n Item2 as Item,\n ItemIndicator2 as ItemIndicator,\n Label2 as Label,\n Portal2 as Portal,\n RadioGroup2 as RadioGroup,\n RadioItem2 as RadioItem,\n Root2 as Root,\n Separator2 as Separator,\n Sub2 as Sub,\n SubContent2 as SubContent,\n SubTrigger2 as SubTrigger,\n Trigger,\n createDropdownMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DROPDOWN_MENU_NAME","createDropdownMenuContext","createContextScope","createMenuScope","useMenuScope","DropdownMenuProvider","useDropdownMenuContext","DropdownMenu","props","__scopeDropdownMenu","children","dir","openProp","defaultOpen","onOpenChange","modal","menuScope","triggerRef","React","open","setOpen","useControllableState","jsx","useId","prevOpen","MenuPrimitive.Root","TRIGGER_NAME","DropdownMenuTrigger","forwardedRef","disabled","triggerProps","context","MenuPrimitive.Anchor","Primitive","composeRefs","composeEventHandlers","event","PORTAL_NAME","DropdownMenuPortal","portalProps","MenuPrimitive.Portal","CONTENT_NAME","DropdownMenuContent","contentProps","hasInteractedOutsideRef","MenuPrimitive.Content","originalEvent","ctrlLeftClick","isRightClick","GROUP_NAME","DropdownMenuGroup","groupProps","MenuPrimitive.Group","LABEL_NAME","DropdownMenuLabel","labelProps","MenuPrimitive.Label","ITEM_NAME","DropdownMenuItem","itemProps","MenuPrimitive.Item","CHECKBOX_ITEM_NAME","DropdownMenuCheckboxItem","checkboxItemProps","MenuPrimitive.CheckboxItem","RADIO_GROUP_NAME","DropdownMenuRadioGroup","radioGroupProps","MenuPrimitive.RadioGroup","RADIO_ITEM_NAME","DropdownMenuRadioItem","radioItemProps","MenuPrimitive.RadioItem","INDICATOR_NAME","DropdownMenuItemIndicator","itemIndicatorProps","MenuPrimitive.ItemIndicator","SEPARATOR_NAME","DropdownMenuSeparator","separatorProps","MenuPrimitive.Separator","ARROW_NAME","DropdownMenuArrow","arrowProps","MenuPrimitive.Arrow","SUB_TRIGGER_NAME","DropdownMenuSubTrigger","subTriggerProps","MenuPrimitive.SubTrigger","SUB_CONTENT_NAME","DropdownMenuSubContent","subContentProps","MenuPrimitive.SubContent","Root2","Trigger","Portal2","Content2","Item2"],"mappings":";;;;;;;;;AAaA,IAAIA,IAAqB,gBACrB,CAACC,CAAkD,IAAIC;AAAA,EACzDF;AAAA,EACA,CAACG,CAAe;AAClB,GACIC,IAAeD,EAAe,GAC9B,CAACE,GAAsBC,CAAsB,IAAIL,EAA0BD,CAAkB,GAC7FO,IAAe,CAACC,MAAU;AAC5B,QAAM;AAAA,IACJ,qBAAAC;AAAA,IACA,UAAAC;AAAA,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AAW,GAAGuE,GAAiB,KAAK3D,GAAc;AAC9G,CAAC;AACD0D,GAAuB,cAAcD;AACrC,IAAII,KAAmB,0BACnBC,KAAyBxE,EAAM,WAAW,CAACV,GAAOoB,MAAiB;AACrE,QAAM,EAAE,qBAAAnB,GAAqB,GAAGkF,EAAe,IAAKnF,GAC9CQ,IAAYZ,EAAaK,CAAmB;AAClD,SAAuBa,gBAAAA,EAAAA;AAAAA,IACrBsE;AAAAA,IACA;AAAA,MACE,GAAG5E;AAAA,MACH,GAAG2E;AAAA,MACH,KAAK/D;AAAA,MACL,OAAO;AAAA,QACL,GAAGpB,EAAM;AAAA,QAGP,kDAAkD;AAAA,QAClD,iDAAiD;AAAA,QACjD,kDAAkD;AAAA,QAClD,uCAAuC;AAAA,QACvC,wCAAwC;AAAA,MAElD;AAAA,IACA;AAAA,EACA;AACA,CAAC;AACDkF,GAAuB,cAAcD;AAClC,IAACI,KAAQtF,GACRuF,KAAUnE,GACVoE,KAAUzD,GACV0D,KAAWtD,GAGXuD,KAAQvC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index47.js","sources":["../src/components/PhoneNumberInput/normalization.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { AsYouType, getCountryCallingCode, validatePhoneNumberLength } from \"libphonenumber-js\"\n\nimport {\n COMMON_IDD_PREFIXES,\n COUNTRY_DIAL_CODES,\n DEFAULT_COUNTRY,\n MAX_DIAL_CODE_LENGTH,\n} from \"./country-options\"\n\n\nexport type LengthIssue = \"TOO_LONG\"\n\nexport function sanitizeDigits(value: string) {\n return value.replace(/\\D/g, \"\")\n}\n\nfunction isDialCodeProgress(digits: string) {\n if (!digits) {\n return true\n }\n\n if (digits.length > MAX_DIAL_CODE_LENGTH) {\n return false\n }\n\n return COUNTRY_DIAL_CODES.some((dial) => dial.startsWith(digits))\n}\n\nconst INVISIBLE_FORMATTING_CHARACTERS =\n /[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/g\n\nfunction stripInvisibleFormatting(value: string) {\n return value.replace(INVISIBLE_FORMATTING_CHARACTERS, \"\")\n}\n\nexport function injectNationalPrefixDisplay(\n international: string,\n dialCode: string,\n options: { force?: boolean } = {}\n) {\n // Preserve a user-typed national trunk (e.g. the French \"0\") purely for display\n // so validation can continue to use the canonical E.164 representation internally.\n const { force = false } = options\n const prefix = `+${dialCode}`\n\n if (!international.startsWith(prefix)) {\n return international\n }\n\n if (!force) {\n return international\n }\n\n const remainder = international.slice(prefix.length).trimStart()\n const alreadyHasTrunk = remainder.startsWith(\"0\")\n\n if (alreadyHasTrunk) {\n return international\n }\n\n if (!remainder) {\n return `${prefix} 0`\n }\n\n const [firstGroup, ...restGroups] = remainder.split(\" \")\n const rebuiltFirstGroup = `0${firstGroup ?? \"\"}`\n const rebuiltRemainder = restGroups.length > 0 ? ` ${restGroups.join(\" \")}` : \"\"\n\n return `${prefix} ${rebuiltFirstGroup}${rebuiltRemainder}`.replace(/\\s\\s+/g, \" \").trimEnd()\n}\n\nconst DETECTED_COUNTRY_OVERRIDES: Partial<Record<CountryCode, CountryCode>> = {\n GG: \"GB\",\n JE: \"GB\",\n IM: \"GB\",\n}\n\nfunction canonicalizeDetectedCountry(candidate: CountryCode | undefined): CountryCode | undefined {\n if (!candidate) {\n return undefined\n }\n return DETECTED_COUNTRY_OVERRIDES[candidate] ?? candidate\n}\n\ntype AsYouTypeNumber = ReturnType<AsYouType[\"getNumber\"]>\n\nfunction inferCountryFromDialCode(\n phoneNumber: AsYouTypeNumber,\n baseCountry: CountryCode | undefined,\n normalizedDigits: string\n): CountryCode | undefined {\n if (!phoneNumber) {\n return undefined\n }\n\n if (!normalizedDigits) {\n return undefined\n }\n\n const nationalDigits = phoneNumber.nationalNumber ?? \"\"\n if (nationalDigits.length < 4) {\n return undefined\n }\n\n const dial = phoneNumber.countryCallingCode\n if (!dial) {\n return undefined\n }\n\n const metadataGetter = (phoneNumber as unknown as { getMetadata?: () => unknown }).getMetadata\n const metadata =\n typeof metadataGetter === \"function\"\n ? (metadataGetter() as {\n country_calling_codes?: Record<string, string[]>\n } | null)\n : null\n\n const candidates = metadata?.country_calling_codes?.[dial]\n if (!candidates || candidates.length === 0) {\n return undefined\n }\n\n const canonicalCandidates: CountryCode[] = []\n for (const candidate of candidates) {\n const canonical = canonicalizeDetectedCountry(candidate as CountryCode)\n if (canonical && !canonicalCandidates.includes(canonical)) {\n canonicalCandidates.push(canonical)\n }\n }\n\n if (canonicalCandidates.length === 0) {\n return undefined\n }\n\n if (baseCountry && canonicalCandidates.includes(baseCountry)) {\n return baseCountry\n }\n\n if (canonicalCandidates.includes(DEFAULT_COUNTRY)) {\n return DEFAULT_COUNTRY\n }\n\n return canonicalCandidates[0]\n}\n\nexport function detectNationalPrefixForDisplay(\n rawDigits: string,\n internationalDigits: string,\n dialCode: string,\n hasExplicitInternationalPrefix: boolean\n) {\n if (!rawDigits) {\n return false\n }\n\n if (!hasExplicitInternationalPrefix) {\n return rawDigits.startsWith(\"0\")\n }\n\n if (!dialCode) {\n return false\n }\n\n if (!rawDigits.startsWith(dialCode)) {\n return false\n }\n\n if (!rawDigits.slice(dialCode.length).startsWith(\"0\")) {\n return false\n }\n\n const rawAfterTrunk = rawDigits.slice(dialCode.length + 1)\n const internationalAfterDial = internationalDigits.startsWith(dialCode)\n ? internationalDigits.slice(dialCode.length)\n : internationalDigits\n\n return rawAfterTrunk === internationalAfterDial\n}\n\nfunction stripIddPrefix(digits: string) {\n for (const prefix of COMMON_IDD_PREFIXES) {\n if (digits.startsWith(prefix)) {\n return digits.slice(prefix.length)\n }\n }\n return digits\n}\n\nexport function normalizeInputValue(\n rawValue: string,\n country: CountryCode | undefined,\n options: {\n allowJustPlus?: boolean\n removeNationalPrefix?: boolean\n previousValue?: string\n } = {}\n) {\n const { allowJustPlus = false, removeNationalPrefix = true, previousValue } = options\n const cleaned = stripInvisibleFormatting(rawValue)\n const trimmed = cleaned.trim()\n\n if (!trimmed) {\n return \"\"\n }\n\n if (trimmed === \"+\") {\n return allowJustPlus ? \"+\" : \"\"\n }\n\n if (trimmed.startsWith(\"+\")) {\n const digits = sanitizeDigits(trimmed)\n if (!digits) {\n return allowJustPlus ? \"+\" : \"\"\n }\n const digitsWithoutIdd = stripIddPrefix(digits)\n if (digitsWithoutIdd !== digits) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n if (removeNationalPrefix && country) {\n const dial = getCountryCallingCode(country)\n if (digits.startsWith(dial) && digits.slice(dial.length).startsWith(\"0\")) {\n const withoutPrefix = digits.slice(dial.length + 1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n }\n return `+${digits}`\n }\n\n const digitsOnly = sanitizeDigits(trimmed)\n if (!digitsOnly) {\n return \"\"\n }\n\n const digitsWithoutIdd = stripIddPrefix(digitsOnly)\n if (digitsWithoutIdd !== digitsOnly) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n\n const previousNormalized = typeof previousValue === \"string\" ? previousValue : \"\"\n const previousDigits =\n previousNormalized && previousNormalized.startsWith(\"+\")\n ? sanitizeDigits(previousNormalized)\n : \"\"\n\n if (previousDigits && previousDigits.length > digitsOnly.length) {\n if (previousDigits.endsWith(digitsOnly)) {\n const removedPrefixLength = previousDigits.length - digitsOnly.length\n if (removedPrefixLength <= MAX_DIAL_CODE_LENGTH) {\n return `+${digitsOnly}`\n }\n }\n }\n\n if (digitsOnly === \"0\") {\n return \"0\"\n }\n\n if (\n removeNationalPrefix &&\n country &&\n digitsOnly.length > 1 &&\n digitsOnly.startsWith(\"0\") &&\n !digitsOnly.startsWith(\"00\")\n ) {\n const dial = getCountryCallingCode(country)\n const withoutPrefix = digitsOnly.slice(1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n\n if (!country) {\n return digitsOnly\n }\n\n if (digitsOnly.length <= 4) {\n return `+${digitsOnly}`\n }\n\n const dial = getCountryCallingCode(country)\n return `+${dial}${digitsOnly}`\n}\n\nexport function formatWithAsYouType(value: string, baseCountry?: CountryCode) {\n if (value === \"+\") {\n return {\n international: \"+\",\n national: \"\",\n formatted: \"+\",\n phoneNumber: null,\n detectedCountry: undefined,\n inferredCountry: undefined,\n hasExplicitInternationalPrefix: true,\n }\n }\n\n const hasExplicitInternationalPrefix = /^\\s*\\+/.test(value)\n const formatter = baseCountry ? new AsYouType(baseCountry) : new AsYouType()\n const formatted = formatter.input(value)\n const phoneNumber = formatter.getNumber()\n const digits = sanitizeDigits(value)\n const detectedCountry = canonicalizeDetectedCountry(\n (phoneNumber?.country ?? formatter.country ?? undefined) as CountryCode | undefined\n )\n const inferredCountry =\n detectedCountry ?? !phoneNumber\n ? undefined\n : canonicalizeDetectedCountry(\n inferCountryFromDialCode(phoneNumber, baseCountry, digits)\n )\n\n const international = phoneNumber?.formatInternational() ?? formatted\n const national = phoneNumber?.formatNational() ?? sanitizeDigits(international)\n\n return {\n international,\n national,\n formatted,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n }\n}\n\nexport function stripPrefix(value: string, prefix: string) {\n return value.startsWith(prefix) ? value.slice(prefix.length) : value\n}\n\nexport function getLengthIssue(value: string, country: CountryCode | undefined): LengthIssue | null {\n if (!country || !value) {\n return null\n }\n\n try {\n const result = validatePhoneNumberLength(value, country)\n return result === \"TOO_LONG\" ? \"TOO_LONG\" : null\n } catch {\n return null\n }\n}\n\ntype SuggestionState = {\n shouldSuggest: boolean\n query: string\n}\n\nexport function getSuggestionState(\n normalized: string,\n baseCountry: CountryCode | undefined,\n phoneNumber: ReturnType<AsYouType[\"getNumber\"]>,\n options: {\n hasRemovedNationalPrefix?: boolean\n detectedCountry?: CountryCode\n hasExplicitInternationalPrefix?: boolean\n } = {}\n): SuggestionState {\n const {\n hasRemovedNationalPrefix = false,\n detectedCountry,\n hasExplicitInternationalPrefix = false,\n } = options\n\n if (!normalized) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (normalized === \"+\") {\n return { shouldSuggest: true, query: \"\" }\n }\n\n const digits = sanitizeDigits(normalized)\n if (!digits) {\n return { shouldSuggest: true, query: \"\" }\n }\n\n if (hasRemovedNationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (hasExplicitInternationalPrefix && !detectedCountry) {\n if (!isDialCodeProgress(digits)) {\n return { shouldSuggest: false, query: \"\" }\n }\n return { shouldSuggest: true, query: digits }\n }\n\n let dial = phoneNumber?.countryCallingCode ?? null\n if (!dial) {\n if (baseCountry) {\n const baseDial = getCountryCallingCode(baseCountry)\n if (digits.startsWith(baseDial)) {\n dial = baseDial\n }\n } else if (!hasExplicitInternationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n }\n\n if (!dial) {\n return { shouldSuggest: true, query: digits }\n }\n\n const nationalDigits = stripPrefix(digits, dial)\n if (nationalDigits.length === 0) {\n return { shouldSuggest: true, query: digits }\n }\n\n return { shouldSuggest: false, query: \"\" }\n}\n\nexport function shouldDisplayExplicitCountrySelection(\n suggestion: SuggestionState,\n options: { detectedCountry?: CountryCode; hasExplicitInternationalPrefix?: boolean }\n) {\n if (suggestion.shouldSuggest) {\n return false\n }\n\n const { hasExplicitInternationalPrefix = false, detectedCountry } = options\n\n if (!hasExplicitInternationalPrefix) {\n return true\n }\n\n return Boolean(detectedCountry)\n}\n"],"names":["sanitizeDigits","value","isDialCodeProgress","digits","MAX_DIAL_CODE_LENGTH","COUNTRY_DIAL_CODES","dial","INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","injectNationalPrefixDisplay","international","dialCode","options","force","prefix","remainder","firstGroup","restGroups","rebuiltFirstGroup","rebuiltRemainder","DETECTED_COUNTRY_OVERRIDES","canonicalizeDetectedCountry","candidate","inferCountryFromDialCode","phoneNumber","baseCountry","normalizedDigits","metadataGetter","candidates","canonicalCandidates","canonical","DEFAULT_COUNTRY","detectNationalPrefixForDisplay","rawDigits","internationalDigits","hasExplicitInternationalPrefix","rawAfterTrunk","internationalAfterDial","stripIddPrefix","COMMON_IDD_PREFIXES","normalizeInputValue","rawValue","country","allowJustPlus","removeNationalPrefix","previousValue","trimmed","digitsWithoutIdd","getCountryCallingCode","withoutPrefix","digitsOnly","previousNormalized","previousDigits","formatWithAsYouType","formatter","AsYouType","formatted","detectedCountry","inferredCountry","national","stripPrefix","getLengthIssue","validatePhoneNumberLength","getSuggestionState","normalized","hasRemovedNationalPrefix","baseDial","shouldDisplayExplicitCountrySelection","suggestion"],"mappings":";;;;AAaO,SAASA,EAAeC,GAAe;AAC5C,SAAOA,EAAM,QAAQ,OAAO,EAAE;AAChC;AAEA,SAASC,EAAmBC,GAAgB;AAC1C,SAAKA,IAIDA,EAAO,SAASC,IACX,KAGFC,EAAmB,KAAK,CAACC,MAASA,EAAK,WAAWH,CAAM,CAAC,IAPvD;AAQX;AAEA,MAAMI,IACJ;AAEF,SAASC,EAAyBP,GAAe;AAC/C,SAAOA,EAAM,QAAQM,GAAiC,EAAE;AAC1D;AAEO,SAASE,EACdC,GACAC,GACAC,IAA+B,CAAA,GAC/B;AAGA,QAAM,EAAE,OAAAC,IAAQ,GAAA,IAAUD,GACpBE,IAAS,IAAIH,CAAQ;AAM3B,MAJI,CAACD,EAAc,WAAWI,CAAM,KAIhC,CAACD;AACH,WAAOH;AAGT,QAAMK,IAAYL,EAAc,MAAMI,EAAO,MAAM,EAAE,UAAA;AAGrD,MAFwBC,EAAU,WAAW,GAAG;AAG9C,WAAOL;AAGT,MAAI,CAACK;AACH,WAAO,GAAGD,CAAM;AAGlB,QAAM,CAACE,GAAY,GAAGC,CAAU,IAAIF,EAAU,MAAM,GAAG,GACjDG,IAAoB,IAAIF,KAAc,EAAE,IACxCG,IAAmBF,EAAW,SAAS,IAAI,IAAIA,EAAW,KAAK,GAAG,CAAC,KAAK;AAE9E,SAAO,GAAGH,CAAM,IAAII,CAAiB,GAAGC,CAAgB,GAAG,QAAQ,UAA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AAO,EAAE,eAAe,IAAO,OAAO,GAAA;AAAA;AAI1C,SAAK7B,IAIkBsD,EAAYzD,GAAQG,CAAI,EAC5B,WAAW,IACrB,EAAE,eAAe,IAAM,OAAOH,EAAA,IAGhC,EAAE,eAAe,IAAO,OAAO,GAAA,IAR7B,EAAE,eAAe,IAAM,OAAOA,EAAA;AASzC;AAEO,SAASgE,EACdC,GACAxD,GACA;AACA,MAAIwD,EAAW;AACb,WAAO;AAGT,QAAM,EAAE,gCAAAjC,IAAiC,IAAO,iBAAAsB,EAAA,IAAoB7C;AAEpE,SAAKuB,IAIE,EAAQsB,IAHN;AAIX;"}
|
package/dist/index48.js
CHANGED
|
@@ -1,7 +1,80 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function c(t) {
|
|
2
|
+
if (!t)
|
|
3
|
+
return !1;
|
|
4
|
+
const e = t.charCodeAt(0);
|
|
5
|
+
return e >= 48 && e <= 57;
|
|
6
|
+
}
|
|
7
|
+
function l(t, e) {
|
|
8
|
+
let n = 0;
|
|
9
|
+
const r = Math.min(e, t.length);
|
|
10
|
+
for (let i = 0; i < r; i += 1)
|
|
11
|
+
c(t[i] ?? "") && (n += 1);
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
function a(t, e) {
|
|
15
|
+
if (e <= 0)
|
|
16
|
+
return t.startsWith("+") ? Math.min(1, t.length) : 0;
|
|
17
|
+
let n = 0;
|
|
18
|
+
for (let r = 0; r < t.length; r += 1)
|
|
19
|
+
if (c(t[r] ?? "") && (n += 1, n === e))
|
|
20
|
+
return r + 1;
|
|
21
|
+
return t.length;
|
|
22
|
+
}
|
|
23
|
+
function g(t) {
|
|
24
|
+
return !t || c(t) ? !1 : t !== "+";
|
|
25
|
+
}
|
|
26
|
+
function h(t, e) {
|
|
27
|
+
let n = e;
|
|
28
|
+
for (; n > 0; ) {
|
|
29
|
+
const r = t[n - 1] ?? "";
|
|
30
|
+
if (!g(r))
|
|
31
|
+
break;
|
|
32
|
+
n -= 1;
|
|
33
|
+
}
|
|
34
|
+
return n;
|
|
35
|
+
}
|
|
36
|
+
function S(t, e) {
|
|
37
|
+
let n = e;
|
|
38
|
+
for (; n < t.length; ) {
|
|
39
|
+
const r = t[n] ?? "";
|
|
40
|
+
if (!g(r))
|
|
41
|
+
break;
|
|
42
|
+
n += 1;
|
|
43
|
+
}
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function m(t) {
|
|
47
|
+
const { value: e } = t, n = t.selectionStart ?? e.length, r = t.selectionEnd ?? n, i = n <= 1 && e.startsWith("+"), o = r <= 1 && e.startsWith("+");
|
|
48
|
+
return {
|
|
49
|
+
selectionStart: n,
|
|
50
|
+
selectionEnd: r,
|
|
51
|
+
startDigits: l(e, n),
|
|
52
|
+
endDigits: l(e, r),
|
|
53
|
+
preserveStartIndex: i,
|
|
54
|
+
preserveEndIndex: o,
|
|
55
|
+
wasAtStart: n === 0,
|
|
56
|
+
wasAtEnd: r === e.length
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function u(t, e) {
|
|
60
|
+
if (t.selectionStart === t.selectionEnd) {
|
|
61
|
+
if (t.wasAtEnd) {
|
|
62
|
+
const f = e.length;
|
|
63
|
+
return { start: f, end: f };
|
|
64
|
+
}
|
|
65
|
+
if (t.wasAtStart)
|
|
66
|
+
return { start: 0, end: 0 };
|
|
67
|
+
}
|
|
68
|
+
const n = t.preserveStartIndex ? Math.min(t.selectionStart, e.length) : a(e, t.startDigits), r = t.preserveEndIndex ? Math.min(t.selectionEnd, e.length) : a(e, t.endDigits);
|
|
69
|
+
let i = n, o = r;
|
|
70
|
+
t.wasAtStart && (i = 0), t.wasAtEnd && (o = e.length), t.selectionStart === t.selectionEnd && (i = o);
|
|
71
|
+
const d = Math.min(Math.max(i, 0), e.length), s = Math.min(Math.max(o, 0), e.length);
|
|
72
|
+
return d > s ? { start: s, end: s } : { start: d, end: s };
|
|
3
73
|
}
|
|
4
74
|
export {
|
|
5
|
-
m as
|
|
75
|
+
m as captureSelectionSnapshot,
|
|
76
|
+
u as resolveSelection,
|
|
77
|
+
h as skipFormattingCharactersLeft,
|
|
78
|
+
S as skipFormattingCharactersRight
|
|
6
79
|
};
|
|
7
80
|
//# sourceMappingURL=index48.js.map
|
package/dist/index48.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index48.js","sources":["
|
|
1
|
+
{"version":3,"file":"index48.js","sources":["../src/components/PhoneNumberInput/selection.ts"],"sourcesContent":["function isDigitCharacter(char: string) {\n if (!char) {\n return false\n }\n const code = char.charCodeAt(0)\n return code >= 48 && code <= 57\n}\n\nfunction countDigitsBefore(value: string, index: number) {\n let count = 0\n const limit = Math.min(index, value.length)\n for (let position = 0; position < limit; position += 1) {\n if (isDigitCharacter(value[position] ?? \"\")) {\n count += 1\n }\n }\n return count\n}\n\nfunction findIndexForDigitCount(value: string, digitCount: number) {\n if (digitCount <= 0) {\n return value.startsWith(\"+\") ? Math.min(1, value.length) : 0\n }\n\n let seen = 0\n for (let index = 0; index < value.length; index += 1) {\n if (isDigitCharacter(value[index] ?? \"\")) {\n seen += 1\n if (seen === digitCount) {\n return index + 1\n }\n }\n }\n\n return value.length\n}\n\nfunction isFormattingCharacter(char: string) {\n if (!char) {\n return false\n }\n if (isDigitCharacter(char)) {\n return false\n }\n return char !== \"+\"\n}\n\nexport function skipFormattingCharactersLeft(value: string, index: number) {\n let position = index\n while (position > 0) {\n const next = value[position - 1] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position -= 1\n }\n return position\n}\n\nexport function skipFormattingCharactersRight(value: string, index: number) {\n let position = index\n while (position < value.length) {\n const next = value[position] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position += 1\n }\n return position\n}\n\ntype SelectionSnapshot = {\n selectionStart: number\n selectionEnd: number\n startDigits: number\n endDigits: number\n preserveStartIndex: boolean\n preserveEndIndex: boolean\n wasAtStart: boolean\n wasAtEnd: boolean\n}\n\nexport function captureSelectionSnapshot(input: HTMLInputElement): SelectionSnapshot {\n const { value } = input\n const selectionStart = input.selectionStart ?? value.length\n const selectionEnd = input.selectionEnd ?? selectionStart\n const preserveStartIndex = selectionStart <= 1 && value.startsWith(\"+\")\n const preserveEndIndex = selectionEnd <= 1 && value.startsWith(\"+\")\n\n return {\n selectionStart,\n selectionEnd,\n startDigits: countDigitsBefore(value, selectionStart),\n endDigits: countDigitsBefore(value, selectionEnd),\n preserveStartIndex,\n preserveEndIndex,\n wasAtStart: selectionStart === 0,\n wasAtEnd: selectionEnd === value.length,\n }\n}\n\nexport function resolveSelection(snapshot: SelectionSnapshot, value: string) {\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n if (snapshot.wasAtEnd) {\n const end = value.length\n return { start: end, end }\n }\n if (snapshot.wasAtStart) {\n return { start: 0, end: 0 }\n }\n }\n\n const start = snapshot.preserveStartIndex\n ? Math.min(snapshot.selectionStart, value.length)\n : findIndexForDigitCount(value, snapshot.startDigits)\n const end = snapshot.preserveEndIndex\n ? Math.min(snapshot.selectionEnd, value.length)\n : findIndexForDigitCount(value, snapshot.endDigits)\n\n let resolvedStart = start\n let resolvedEnd = end\n\n if (snapshot.wasAtStart) {\n resolvedStart = 0\n }\n\n if (snapshot.wasAtEnd) {\n resolvedEnd = value.length\n }\n\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n resolvedStart = resolvedEnd\n }\n\n const clampedStart = Math.min(Math.max(resolvedStart, 0), value.length)\n const clampedEnd = Math.min(Math.max(resolvedEnd, 0), value.length)\n\n if (clampedStart > clampedEnd) {\n return { start: clampedEnd, end: clampedEnd }\n }\n\n return { start: clampedStart, end: clampedEnd }\n}\n\n"],"names":["isDigitCharacter","char","code","countDigitsBefore","value","index","count","limit","position","findIndexForDigitCount","digitCount","seen","isFormattingCharacter","skipFormattingCharactersLeft","next","skipFormattingCharactersRight","captureSelectionSnapshot","input","selectionStart","selectionEnd","preserveStartIndex","preserveEndIndex","resolveSelection","snapshot","end","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