@rpcbase/ui 0.226.0 → 0.227.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/PhoneNumberInput/index.d.ts +1 -1
- package/dist/components/PhoneNumberInput/index.d.ts.map +1 -1
- package/dist/components/PhoneNumberInput/normalization.d.ts +0 -28
- package/dist/components/PhoneNumberInput/normalization.d.ts.map +1 -1
- package/dist/components/PhoneNumberInput/types.d.ts +4 -4
- package/dist/components/PhoneNumberInput/types.d.ts.map +1 -1
- package/dist/index100.js +4 -11
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +8 -68
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +6 -38
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +5 -14
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +4 -23
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +6 -110
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +146 -13
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +39 -4
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +5 -4
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +8 -5
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +13 -11
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +13 -19
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +8 -13
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +31 -261
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +10 -4
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +11 -28
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +8 -126
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +13 -5
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +101 -78
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +20 -67
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +53 -8
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +73 -16
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +9 -92
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +17 -62
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +15 -44
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +24 -52
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +6 -4
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +5 -4
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +23 -15
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +35 -6
- package/dist/index129.js.map +1 -1
- package/dist/index130.js +16 -8
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +6 -16
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +4 -4
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +4 -4
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +4 -5
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +4 -5
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +3 -4
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +6 -4
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +24 -7
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +7 -24
- package/dist/index139.js.map +1 -1
- package/dist/index140.js +6 -6
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +5 -4
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +3 -6
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +3 -5
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +4 -4
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +3 -5
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +4 -4
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +3 -8
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +3 -5
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +3 -4
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +11 -4
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +68 -6
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +35 -143
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +13 -39
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +23 -4
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +108 -5
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +13 -14
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +4 -13
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +4 -8
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +5 -32
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +11 -10
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +18 -9
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +13 -9
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +258 -10
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +4 -101
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +28 -20
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +122 -49
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +5 -72
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +78 -9
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +64 -18
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +8 -16
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +16 -24
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +92 -6
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +65 -5
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +43 -21
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +6 -35
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +69 -16
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +2 -7
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +363 -4
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +261 -4
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +377 -414
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +60 -4
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +46 -4
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +169 -3
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +109 -6
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +25 -24
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +8 -8
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +4 -6
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +5 -5
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +4 -3
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +466 -3
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +185 -4
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +107 -3
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +262 -4
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +9 -3
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +42 -3
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +4 -3
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +20 -14
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +58 -146
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +6 -30
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +11 -9
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +46 -44
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +4 -12
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +28 -43
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +14 -93
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +5 -86
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +21 -105
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +50 -51
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +25 -11
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +41 -37
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +39 -8
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +45 -117
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +20 -17
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +69 -14
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +17 -3
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +11 -36
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +27 -20
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +13 -9
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +18 -8
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +35 -18
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +260 -26
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +277 -15
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +66 -64
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +99 -8
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +82 -10
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +3 -8
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +29 -5
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +16 -13
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +35 -4
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +16 -3
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +3 -99
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +24 -27
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +27 -50
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +4 -18
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +78 -5
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +260 -113
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +11 -27
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +10 -32
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +25 -73
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +14 -260
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +121 -24
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +5 -6
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +40 -142
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +57 -53
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +13 -49
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +8 -15
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +4 -132
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +3 -8
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +10 -4
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +8 -4
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +133 -11
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +397 -19
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +53 -20
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +11 -11
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +11 -50
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +58 -16
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +8 -21
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +64 -49
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +19 -25
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +16 -41
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +5 -39
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +6 -45
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +6 -20
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +4 -70
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +6 -17
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +16 -11
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +4 -13
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +4 -18
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +12 -36
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +9 -278
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +13 -68
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +13 -83
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +4 -3
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +5 -29
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +6 -16
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +6 -35
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +52 -14
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +8 -3
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +4 -26
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +5 -4
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +8 -78
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +4 -269
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +4 -11
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +3 -10
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +10 -25
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +9 -16
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +9 -125
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +10 -5
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +10 -40
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +9 -65
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +7 -14
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +5 -7
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +4 -5
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +5 -3
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +6 -10
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +5 -7
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +14 -397
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +7 -52
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +10 -11
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +10 -11
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +21 -58
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +10 -8
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +9 -66
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +9 -19
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +4 -16
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +5 -5
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +15 -4
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +9 -6
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +18 -4
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +15 -6
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +12 -16
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +24 -24
- package/dist/index310.js +29 -4
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +12 -4
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +25 -12
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +5 -9
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +8 -13
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +11 -13
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +8 -4
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +13 -5
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +3 -6
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +3 -5
- package/dist/index319.js.map +1 -1
- package/dist/index32.js +3 -3
- package/dist/index320.js +16 -53
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +5 -8
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +51 -4
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +122 -4
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +32 -8
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +73 -4
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +142 -4
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +61 -3
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +49 -10
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +15 -10
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +8 -9
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +5 -11
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +11 -10
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +21 -9
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +13 -6
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +154 -5
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +30 -4
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +9 -5
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +48 -6
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +11 -5
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +4 -4
- package/dist/index340.js +42 -14
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +95 -7
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +85 -9
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +104 -9
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +52 -21
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +11 -10
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +37 -9
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +7 -8
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +116 -4
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +17 -5
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +5 -5
- package/dist/index350.js +14 -15
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +3 -9
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +34 -16
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +20 -15
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +9 -12
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +8 -29
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +18 -11
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +26 -23
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +16 -5
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +4 -21
- package/dist/index359.js.map +1 -1
- package/dist/index36.js +10 -10
- package/dist/index360.js +11 -8
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +16 -25
- package/dist/index361.js.map +1 -1
- package/dist/index362.js +5 -26
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +19 -136
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +44 -12
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +15 -224
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +5 -4
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +199 -18
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +76 -76
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +5 -12
- package/dist/index369.js.map +1 -1
- package/dist/index37.js +3 -3
- package/dist/index370.js +18 -4
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +12 -77
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +7 -199
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +25 -71
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +27 -9
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +137 -16
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +12 -15
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +227 -4
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +3 -11
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +19 -5
- package/dist/index379.js.map +1 -1
- package/dist/index38.js +4 -4
- package/dist/index380.js +76 -19
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +12 -45
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +4 -18
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +71 -4
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +9 -5
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +16 -18
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +20 -12
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +3 -15
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +3 -492
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +5 -3
- package/dist/index389.js.map +1 -1
- package/dist/index39.js +5 -5
- package/dist/index390.js +5 -3
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +4 -5
- package/dist/index391.js.map +1 -1
- package/dist/index392.js +15 -4
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +9 -4
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +5 -15
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +4 -8
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +545 -5
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +47 -5
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +15 -543
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +6 -47
- package/dist/index399.js.map +1 -1
- package/dist/index40.js +3 -3
- package/dist/index400.js +7 -17
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +6 -5
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +7 -7
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +11 -6
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +8 -7
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +12 -11
- package/dist/index405.js.map +1 -1
- package/dist/index406.js +14 -8
- package/dist/index406.js.map +1 -1
- package/dist/index407.js +491 -12
- package/dist/index407.js.map +1 -1
- package/dist/index41.js +10 -10
- package/dist/index410.js +1 -1
- package/dist/index411.js +1 -1
- package/dist/index414.js +1 -1
- package/dist/index415.js +1 -1
- package/dist/index423.js +2 -2
- package/dist/index425.js +2 -2
- package/dist/index44.js +23 -22
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +22 -196
- package/dist/index45.js.map +1 -1
- package/dist/index48.js +2 -2
- package/dist/index49.js +34 -34
- package/dist/index50.js +29 -29
- package/dist/index51.js +2 -2
- package/dist/index52.js +12 -12
- package/dist/index53.js +4 -4
- package/dist/index54.js +1 -1
- package/dist/index55.js +22 -22
- package/dist/index56.js +5 -5
- package/dist/index57.js +5 -5
- package/dist/index58.js +8 -8
- package/dist/index59.js +5 -5
- package/dist/index60.js +17 -17
- package/dist/index61.js +5 -5
- package/dist/index62.js +3 -3
- package/dist/index66.js +1 -1
- package/dist/index67.js +1 -1
- package/dist/index70.js +1 -1
- package/dist/index71.js +1 -1
- package/dist/index72.js +2 -6
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +2 -8
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +2 -6
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +2 -2
- package/dist/index76.js +6 -2
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +8 -2
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +6 -2
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +52 -6
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +4 -68
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +5 -2
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +15 -363
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +5 -261
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +7 -60
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +16 -46
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +4 -169
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +4 -109
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +5 -24
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +6 -8
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +4 -4
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +4 -5
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +6 -4
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +24 -466
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +6 -185
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +4 -107
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +6 -262
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +5 -9
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +4 -42
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +5 -4
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index411.js
CHANGED
package/dist/index414.js
CHANGED
package/dist/index415.js
CHANGED
package/dist/index423.js
CHANGED
package/dist/index425.js
CHANGED
package/dist/index44.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { getCountryList as E } from "./
|
|
1
|
+
import { getCountryList as E } from "./index76.js";
|
|
2
2
|
import { getCountryCallingCode as s } from "./index48.js";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const f = "US", u = E(), c = /* @__PURE__ */ new Map(), m = "__default_locale__", _ = Array.from(new Set(u.map((e) => s(e)))).sort((e, t) => t.length - e.length);
|
|
4
|
+
_.reduce((e, t) => Math.max(e, t.length), 0);
|
|
5
|
+
const O = ["0011", "001", "011", "00", "810"];
|
|
6
|
+
function y(e) {
|
|
7
|
+
return e && u.includes(e) ? e : f;
|
|
6
8
|
}
|
|
7
9
|
function C(e) {
|
|
8
10
|
if (typeof Intl > "u" || typeof Intl.DisplayNames > "u")
|
|
@@ -19,7 +21,7 @@ function C(e) {
|
|
|
19
21
|
function N(e) {
|
|
20
22
|
const t = C(e), r = C("en");
|
|
21
23
|
return u.map((n) => {
|
|
22
|
-
const a = s(n), o = t?.of(n) ?? r?.of(n) ?? n, i = r?.of(n) ?? o, g =
|
|
24
|
+
const a = s(n), o = t?.of(n) ?? r?.of(n) ?? n, i = r?.of(n) ?? o, g = T(n), l = Array.from(new Set([o, i, n.toUpperCase(), n.toLowerCase(), ...g].filter(Boolean)));
|
|
23
25
|
return {
|
|
24
26
|
value: n,
|
|
25
27
|
name: o,
|
|
@@ -37,10 +39,10 @@ function N(e) {
|
|
|
37
39
|
function d(e) {
|
|
38
40
|
return e === "US" ? 0 : e === "CA" ? 1 : s(e) === "1" ? 2 : 3;
|
|
39
41
|
}
|
|
40
|
-
function
|
|
42
|
+
function R(e) {
|
|
41
43
|
return e ? Array.isArray(e) ? e.join("\0") : e : m;
|
|
42
44
|
}
|
|
43
|
-
function
|
|
45
|
+
function b(e) {
|
|
44
46
|
if (e !== m) {
|
|
45
47
|
if (e.includes("\0")) {
|
|
46
48
|
const t = e.split("\0").filter(Boolean);
|
|
@@ -49,14 +51,14 @@ function L(e) {
|
|
|
49
51
|
return e;
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
function
|
|
53
|
-
const r =
|
|
54
|
+
function L(e, t) {
|
|
55
|
+
const r = c.get(t);
|
|
54
56
|
if (r)
|
|
55
57
|
return r;
|
|
56
58
|
const n = N(e);
|
|
57
|
-
return
|
|
59
|
+
return c.set(t, n), n;
|
|
58
60
|
}
|
|
59
|
-
function
|
|
61
|
+
function v(e) {
|
|
60
62
|
return {
|
|
61
63
|
code: e.value,
|
|
62
64
|
name: e.name,
|
|
@@ -64,7 +66,7 @@ function F(e) {
|
|
|
64
66
|
flag: e.flag
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
function
|
|
69
|
+
function F(e) {
|
|
68
70
|
return {
|
|
69
71
|
code: e,
|
|
70
72
|
name: e,
|
|
@@ -94,7 +96,7 @@ function B(e, t) {
|
|
|
94
96
|
}
|
|
95
97
|
return r === Number.MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : r;
|
|
96
98
|
}
|
|
97
|
-
function
|
|
99
|
+
function T(e) {
|
|
98
100
|
switch (e) {
|
|
99
101
|
case "US":
|
|
100
102
|
return ["USA", "United States", "America", "United States of America"];
|
|
@@ -117,17 +119,16 @@ function D(e) {
|
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
export {
|
|
120
|
-
|
|
122
|
+
O as COMMON_IDD_PREFIXES,
|
|
121
123
|
_ as COUNTRY_DIAL_CODES,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
R as getValidCountry,
|
|
124
|
+
f as DEFAULT_COUNTRY,
|
|
125
|
+
F as buildFallbackSelectedCountry,
|
|
126
|
+
L as getCachedCountryOptions,
|
|
127
|
+
R as getLocaleCacheKey,
|
|
128
|
+
y as getValidCountry,
|
|
128
129
|
U as normalizeSearchValue,
|
|
129
130
|
B as optionMatchIndex,
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
b as parseLocaleCacheKey,
|
|
132
|
+
v as toSelectedCountry
|
|
132
133
|
};
|
|
133
134
|
//# sourceMappingURL=index44.js.map
|
package/dist/index44.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index44.js","sources":["../src/components/PhoneNumberInput/country-options.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { getCountryCallingCode } from \"libphonenumber-js\"\n\nimport type { CountryOption, PhoneNumberSelectedCountry } from \"./types\"\nimport { getCountryList } from \"./countries\"\n\n\nexport const DEFAULT_COUNTRY: CountryCode = \"US\"\nconst COUNTRY_OPTIONS = getCountryList()\n\nconst COUNTRY_OPTIONS_CACHE = new Map<string, CountryOption[]>()\nconst DEFAULT_LOCALE_CACHE_KEY = \"__default_locale__\"\nexport const COUNTRY_DIAL_CODES = Array.from(\n new Set(COUNTRY_OPTIONS.map((code) => getCountryCallingCode(code)))\n).sort((a, b) => b.length - a.length)\nexport const MAX_DIAL_CODE_LENGTH = COUNTRY_DIAL_CODES.reduce(\n (max, dial) => Math.max(max, dial.length),\n 0\n)\nexport const COMMON_IDD_PREFIXES = [\"0011\", \"001\", \"011\", \"00\", \"810\"]\n\nexport function getValidCountry(input: CountryCode | undefined) {\n if (!input) {\n return DEFAULT_COUNTRY\n }\n\n return COUNTRY_OPTIONS.includes(input) ? input : DEFAULT_COUNTRY\n}\n\nfunction createDisplayNames(locale?: string | string[]) {\n if (typeof Intl === \"undefined\" || typeof Intl.DisplayNames === \"undefined\") {\n return null\n }\n\n try {\n const locales = Array.isArray(locale) ? locale : locale ? [locale] : undefined\n return new Intl.DisplayNames(locales, { type: \"region\" })\n } catch {\n return null\n }\n}\n\nfunction buildCountryOptions(locale?: string | string[]) {\n const displayNames = createDisplayNames(locale)\n const englishDisplayNames = createDisplayNames(\"en\")\n\n return COUNTRY_OPTIONS\n .map((country) => {\n const dialCode = getCountryCallingCode(country)\n const localizedName = displayNames?.of(country) ?? englishDisplayNames?.of(country) ?? country\n const englishName = englishDisplayNames?.of(country) ?? localizedName\n const aliasTokens = getCountryAliases(country)\n const searchableTokens = Array.from(\n new Set(\n [localizedName, englishName, country.toUpperCase(), country.toLowerCase(), ...aliasTokens].filter(\n Boolean\n )\n )\n ) as string[]\n return {\n value: country,\n name: localizedName,\n dialCode,\n label: `${localizedName} (+${dialCode})`,\n flag: countryCodeToFlagEmoji(country),\n searchableTokens,\n normalizedSearchableTokens: searchableTokens.map((token) => normalizeSearchValue(token)),\n }\n })\n .sort((a, b) => {\n const priorityA = getCountryPriority(a.value)\n const priorityB = getCountryPriority(b.value)\n if (priorityA !== priorityB) {\n return priorityA - priorityB\n }\n return a.name.localeCompare(b.name)\n })\n}\n\nfunction getCountryPriority(code: CountryCode) {\n if (code === \"US\") return 0\n if (code === \"CA\") return 1\n if (getCountryCallingCode(code) === \"1\") return 2\n return 3\n}\n\nexport function getLocaleCacheKey(locale?: string | string[]) {\n if (!locale) {\n return DEFAULT_LOCALE_CACHE_KEY\n }\n if (Array.isArray(locale)) {\n return locale.join(\"\\u0000\")\n }\n return locale\n}\n\nexport function parseLocaleCacheKey(cacheKey: string): string | string[] | undefined {\n if (cacheKey === DEFAULT_LOCALE_CACHE_KEY) {\n return undefined\n }\n\n if (cacheKey.includes(\"\\u0000\")) {\n const parts = cacheKey.split(\"\\u0000\").filter(Boolean)\n if (parts.length === 0) {\n return undefined\n }\n if (parts.length === 1) {\n return parts[0] ?? undefined\n }\n return parts\n }\n\n return cacheKey\n}\n\nexport function getCachedCountryOptions(locale: string | string[] | undefined, cacheKey: string) {\n const cached = COUNTRY_OPTIONS_CACHE.get(cacheKey)\n if (cached) {\n return cached\n }\n const built = buildCountryOptions(locale)\n COUNTRY_OPTIONS_CACHE.set(cacheKey, built)\n return built\n}\n\nexport function toSelectedCountry(option: CountryOption): PhoneNumberSelectedCountry {\n return {\n code: option.value,\n name: option.name,\n dialCode: option.dialCode,\n flag: option.flag,\n }\n}\n\nexport function buildFallbackSelectedCountry(country: CountryCode): PhoneNumberSelectedCountry {\n return {\n code: country,\n name: country,\n dialCode: getCountryCallingCode(country),\n flag: countryCodeToFlagEmoji(country),\n }\n}\n\nfunction countryCodeToFlagEmoji(country: CountryCode) {\n const upper = country?.toUpperCase()\n\n if (!upper || upper.length !== 2 || /[^A-Z]/.test(upper)) {\n return \"\"\n }\n\n const base = 127397\n return String.fromCodePoint(\n upper.charCodeAt(0) + base,\n upper.charCodeAt(1) + base\n )\n}\n\nconst DIACRITICS_REGEX = /[\\u0300-\\u036f]/g\n\nfunction stripDiacritics(value: string) {\n return value.normalize(\"NFD\").replace(DIACRITICS_REGEX, \"\")\n}\n\nexport function normalizeSearchValue(value: string) {\n return stripDiacritics(value).toLowerCase()\n}\n\nexport function optionMatchIndex(tokens: string[], query: string) {\n let best = Number.MAX_SAFE_INTEGER\n for (const token of tokens) {\n const index = token.indexOf(query)\n if (index >= 0 && index < best) {\n best = index\n }\n }\n return best === Number.MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : best\n}\n\nfunction getCountryAliases(code: CountryCode): string[] {\n switch (code) {\n case \"US\":\n return [\"USA\", \"United States\", \"America\", \"United States of America\"]\n case \"GB\":\n return [\"UK\", \"United Kingdom\", \"Great Britain\", \"England\"]\n case \"AE\":\n return [\"UAE\", \"United Arab Emirates\"]\n case \"KR\":\n return [\"South Korea\", \"Korea\"]\n case \"CN\":\n return [\"China\", \"PRC\"]\n case \"CD\":\n return [\"DRC\", \"Congo-Kinshasa\"]\n case \"CG\":\n return [\"Congo-Brazzaville\"]\n case \"BR\":\n return [\"Brazil\"]\n default:\n return []\n }\n}\n\n"],"names":["DEFAULT_COUNTRY","COUNTRY_OPTIONS","getCountryList","COUNTRY_OPTIONS_CACHE","Map","DEFAULT_LOCALE_CACHE_KEY","COUNTRY_DIAL_CODES","Array","from","Set","map","code","getCountryCallingCode","sort","a","b","length","MAX_DIAL_CODE_LENGTH","reduce","max","dial","Math","COMMON_IDD_PREFIXES","getValidCountry","input","includes","createDisplayNames","locale","Intl","DisplayNames","locales","isArray","undefined","type","buildCountryOptions","displayNames","englishDisplayNames","country","dialCode","localizedName","of","englishName","aliasTokens","getCountryAliases","searchableTokens","toUpperCase","toLowerCase","filter","Boolean","value","name","label","flag","countryCodeToFlagEmoji","normalizedSearchableTokens","token","normalizeSearchValue","priorityA","getCountryPriority","priorityB","localeCompare","getLocaleCacheKey","join","parseLocaleCacheKey","cacheKey","parts","split","getCachedCountryOptions","cached","get","built","set","toSelectedCountry","option","buildFallbackSelectedCountry","upper","test","base","String","fromCodePoint","charCodeAt","DIACRITICS_REGEX","stripDiacritics","normalize","replace","optionMatchIndex","tokens","query","best","Number","MAX_SAFE_INTEGER","index","indexOf"],"mappings":";;AAOO,MAAMA,IAA+B,MACtCC,IAAkBC,EAAAA,GAElBC,wBAA4BC,IAAAA,GAC5BC,IAA2B,sBACpBC,IAAqBC,MAAMC,KACtC,IAAIC,IAAIR,EAAgBS,IAAKC,OAASC,EAAsBD,CAAI,CAAC,CAAC,CACpE,EAAEE,KAAK,CAACC,GAAGC,MAAMA,EAAEC,SAASF,EAAEE,MAAM,GACvBC,IAAuBX,EAAmBY,OACrD,CAACC,GAAKC,MAASC,KAAKF,IAAIA,GAAKC,EAAKJ,MAAM,GACxC,CACF,GACaM,IAAsB,CAAC,QAAQ,OAAO,OAAO,MAAM,KAAK;AAE9D,SAASC,EAAgBC,GAAgC;AAC9D,SAAKA,KAIEvB,EAAgBwB,SAASD,CAAK,IAAIA,IAHhCxB;AAIX;AAEA,SAAS0B,EAAmBC,GAA4B;AACtD,MAAI,OAAOC,OAAS,OAAe,OAAOA,KAAKC,eAAiB;AAC9D,WA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,SAAOC,OAAOC,cACZJ,EAAMK,WAAW,CAAC,IAAIH,GACtBF,EAAMK,WAAW,CAAC,IAAIH,CACxB;AACF;AAEA,MAAMI,IAAmB;AAEzB,SAASC,EAAgBjC,GAAe;AACtC,SAAOA,EAAMkC,UAAU,KAAK,EAAEC,QAAQH,GAAkB,EAAE;AAC5D;AAEO,SAASzB,EAAqBP,GAAe;AAClD,SAAOiC,EAAgBjC,CAAK,EAAEH,YAAAA;AAChC;AAEO,SAASuC,EAAiBC,GAAkBC,GAAe;AAChE,MAAIC,IAAOC,OAAOC;AAClB,aAAWnC,KAAS+B,GAAQ;AAC1B,UAAMK,IAAQpC,EAAMqC,QAAQL,CAAK;AACjC,IAAII,KAAS,KAAKA,IAAQH,MACxBA,IAAOG;AAAAA,EAEX;AACA,SAAOH,MAASC,OAAOC,mBAAmBD,OAAOC,mBAAmBF;AACtE;AAEA,SAAS7C,EAAkBhC,GAA6B;AACtD,UAAQA,GAAAA;AAAAA,IACN,KAAK;AACH,aAAO,CAAC,OAAO,iBAAiB,WAAW,0BAA0B;AAAA,IACvE,KAAK;AACH,aAAO,CAAC,MAAM,kBAAkB,iBAAiB,SAAS;AAAA,IAC5D,KAAK;AACH,aAAO,CAAC,OAAO,sBAAsB;AAAA,IACvC,KAAK;AACH,aAAO,CAAC,eAAe,OAAO;AAAA,IAChC,KAAK;AACH,aAAO,CAAC,SAAS,KAAK;AAAA,IACxB,KAAK;AACH,aAAO,CAAC,OAAO,gBAAgB;AAAA,IACjC,KAAK;AACH,aAAO,CAAC,mBAAmB;AAAA,IAC7B,KAAK;AACH,aAAO,CAAC,QAAQ;AAAA,IAClB;AACE,aAAO,CAAA;AAAA,EAAA;AAEb;"}
|
|
1
|
+
{"version":3,"file":"index44.js","sources":["../src/components/PhoneNumberInput/country-options.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { getCountryCallingCode } from \"libphonenumber-js\"\n\nimport type { CountryOption, PhoneNumberSelectedCountry } from \"./types\"\nimport { getCountryList } from \"./countries\"\n\n\nexport const DEFAULT_COUNTRY: CountryCode = \"US\"\nconst COUNTRY_OPTIONS = getCountryList()\n\nconst COUNTRY_OPTIONS_CACHE = new Map<string, CountryOption[]>()\nconst DEFAULT_LOCALE_CACHE_KEY = \"__default_locale__\"\nexport const COUNTRY_DIAL_CODES = Array.from(\n new Set(COUNTRY_OPTIONS.map((code) => getCountryCallingCode(code)))\n).sort((a, b) => b.length - a.length)\nexport const MAX_DIAL_CODE_LENGTH = COUNTRY_DIAL_CODES.reduce(\n (max, dial) => Math.max(max, dial.length),\n 0\n)\nexport const COMMON_IDD_PREFIXES = [\"0011\", \"001\", \"011\", \"00\", \"810\"]\n\nexport function getValidCountry(input: CountryCode | undefined) {\n if (!input) {\n return DEFAULT_COUNTRY\n }\n\n return COUNTRY_OPTIONS.includes(input) ? input : DEFAULT_COUNTRY\n}\n\nfunction createDisplayNames(locale?: string | string[]) {\n if (typeof Intl === \"undefined\" || typeof Intl.DisplayNames === \"undefined\") {\n return null\n }\n\n try {\n const locales = Array.isArray(locale) ? locale : locale ? [locale] : undefined\n return new Intl.DisplayNames(locales, { type: \"region\" })\n } catch {\n return null\n }\n}\n\nfunction buildCountryOptions(locale?: string | string[]) {\n const displayNames = createDisplayNames(locale)\n const englishDisplayNames = createDisplayNames(\"en\")\n\n return COUNTRY_OPTIONS\n .map((country) => {\n const dialCode = getCountryCallingCode(country)\n const localizedName = displayNames?.of(country) ?? englishDisplayNames?.of(country) ?? country\n const englishName = englishDisplayNames?.of(country) ?? localizedName\n const aliasTokens = getCountryAliases(country)\n const searchableTokens = Array.from(\n new Set(\n [localizedName, englishName, country.toUpperCase(), country.toLowerCase(), ...aliasTokens].filter(\n Boolean\n )\n )\n ) as string[]\n return {\n value: country,\n name: localizedName,\n dialCode,\n label: `${localizedName} (+${dialCode})`,\n flag: countryCodeToFlagEmoji(country),\n searchableTokens,\n normalizedSearchableTokens: searchableTokens.map((token) => normalizeSearchValue(token)),\n }\n })\n .sort((a, b) => {\n const priorityA = getCountryPriority(a.value)\n const priorityB = getCountryPriority(b.value)\n if (priorityA !== priorityB) {\n return priorityA - priorityB\n }\n return a.name.localeCompare(b.name)\n })\n}\n\nfunction getCountryPriority(code: CountryCode) {\n if (code === \"US\") return 0\n if (code === \"CA\") return 1\n if (getCountryCallingCode(code) === \"1\") return 2\n return 3\n}\n\nexport function getLocaleCacheKey(locale?: string | string[]) {\n if (!locale) {\n return DEFAULT_LOCALE_CACHE_KEY\n }\n if (Array.isArray(locale)) {\n return locale.join(\"\\u0000\")\n }\n return locale\n}\n\nexport function parseLocaleCacheKey(cacheKey: string): string | string[] | undefined {\n if (cacheKey === DEFAULT_LOCALE_CACHE_KEY) {\n return undefined\n }\n\n if (cacheKey.includes(\"\\u0000\")) {\n const parts = cacheKey.split(\"\\u0000\").filter(Boolean)\n if (parts.length === 0) {\n return undefined\n }\n if (parts.length === 1) {\n return parts[0] ?? undefined\n }\n return parts\n }\n\n return cacheKey\n}\n\nexport function getCachedCountryOptions(locale: string | string[] | undefined, cacheKey: string) {\n const cached = COUNTRY_OPTIONS_CACHE.get(cacheKey)\n if (cached) {\n return cached\n }\n const built = buildCountryOptions(locale)\n COUNTRY_OPTIONS_CACHE.set(cacheKey, built)\n return built\n}\n\nexport function toSelectedCountry(option: CountryOption): PhoneNumberSelectedCountry {\n return {\n code: option.value,\n name: option.name,\n dialCode: option.dialCode,\n flag: option.flag,\n }\n}\n\nexport function buildFallbackSelectedCountry(country: CountryCode): PhoneNumberSelectedCountry {\n return {\n code: country,\n name: country,\n dialCode: getCountryCallingCode(country),\n flag: countryCodeToFlagEmoji(country),\n }\n}\n\nfunction countryCodeToFlagEmoji(country: CountryCode) {\n const upper = country?.toUpperCase()\n\n if (!upper || upper.length !== 2 || /[^A-Z]/.test(upper)) {\n return \"\"\n }\n\n const base = 127397\n return String.fromCodePoint(\n upper.charCodeAt(0) + base,\n upper.charCodeAt(1) + base\n )\n}\n\nconst DIACRITICS_REGEX = /[\\u0300-\\u036f]/g\n\nfunction stripDiacritics(value: string) {\n return value.normalize(\"NFD\").replace(DIACRITICS_REGEX, \"\")\n}\n\nexport function normalizeSearchValue(value: string) {\n return stripDiacritics(value).toLowerCase()\n}\n\nexport function optionMatchIndex(tokens: string[], query: string) {\n let best = Number.MAX_SAFE_INTEGER\n for (const token of tokens) {\n const index = token.indexOf(query)\n if (index >= 0 && index < best) {\n best = index\n }\n }\n return best === Number.MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : best\n}\n\nfunction getCountryAliases(code: CountryCode): string[] {\n switch (code) {\n case \"US\":\n return [\"USA\", \"United States\", \"America\", \"United States of America\"]\n case \"GB\":\n return [\"UK\", \"United Kingdom\", \"Great Britain\", \"England\"]\n case \"AE\":\n return [\"UAE\", \"United Arab Emirates\"]\n case \"KR\":\n return [\"South Korea\", \"Korea\"]\n case \"CN\":\n return [\"China\", \"PRC\"]\n case \"CD\":\n return [\"DRC\", \"Congo-Kinshasa\"]\n case \"CG\":\n return [\"Congo-Brazzaville\"]\n case \"BR\":\n return [\"Brazil\"]\n default:\n return []\n }\n}\n\n"],"names":["DEFAULT_COUNTRY","COUNTRY_OPTIONS","getCountryList","COUNTRY_OPTIONS_CACHE","Map","DEFAULT_LOCALE_CACHE_KEY","COUNTRY_DIAL_CODES","Array","from","Set","map","code","getCountryCallingCode","sort","a","b","length","reduce","max","dial","Math","COMMON_IDD_PREFIXES","getValidCountry","input","includes","createDisplayNames","locale","Intl","DisplayNames","locales","isArray","undefined","type","buildCountryOptions","displayNames","englishDisplayNames","country","dialCode","localizedName","of","englishName","aliasTokens","getCountryAliases","searchableTokens","toUpperCase","toLowerCase","filter","Boolean","value","name","label","flag","countryCodeToFlagEmoji","normalizedSearchableTokens","token","normalizeSearchValue","priorityA","getCountryPriority","priorityB","localeCompare","getLocaleCacheKey","join","parseLocaleCacheKey","cacheKey","parts","split","getCachedCountryOptions","cached","get","built","set","toSelectedCountry","option","buildFallbackSelectedCountry","upper","test","base","String","fromCodePoint","charCodeAt","DIACRITICS_REGEX","stripDiacritics","normalize","replace","optionMatchIndex","tokens","query","best","Number","MAX_SAFE_INTEGER","index","indexOf"],"mappings":";;AAOO,MAAMA,IAA+B,MACtCC,IAAkBC,EAAAA,GAElBC,wBAA4BC,IAAAA,GAC5BC,IAA2B,sBACpBC,IAAqBC,MAAMC,KACtC,IAAIC,IAAIR,EAAgBS,IAAKC,OAASC,EAAsBD,CAAI,CAAC,CAAC,CACpE,EAAEE,KAAK,CAACC,GAAGC,MAAMA,EAAEC,SAASF,EAAEE,MAAM;AACAV,EAAmBW,OACrD,CAACC,GAAKC,MAASC,KAAKF,IAAIA,GAAKC,EAAKH,MAAM,GACxC,CACF;AACO,MAAMK,IAAsB,CAAC,QAAQ,OAAO,OAAO,MAAM,KAAK;AAE9D,SAASC,EAAgBC,GAAgC;AAC9D,SAAKA,KAIEtB,EAAgBuB,SAASD,CAAK,IAAIA,IAHhCvB;AAIX;AAEA,SAASyB,EAAmBC,GAA4B;AACtD,MAAI,OAAOC,OAAS,OAAe,OAAOA,KAAKC,eAAiB;AAC9D,WAAO;AAGT,MAAI;AACF,UAAMC,IAAUtB,MAAMuB,QAAQJ,CAAM,IAAIA,IAASA,IAAS,CAACA,CAAM,IAAIK;AACrE,WAAO,IAAIJ,KAAKC,aAAaC,GAAS;AAAA,MAAEG,MAAM;AAAA,IAAA,CAAU;AAAA,EAC1D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAASC,EAAoBP,GAA4B;AACvD,QAAMQ,IAAeT,EAAmBC,CAAM,GACxCS,IAAsBV,EAAmB,IAAI;AAEnD,SAAOxB,EACJS,IAAK0B,CAAAA,MAAY;AAChB,UAAMC,IAAWzB,EAAsBwB,CAAO,GACxCE,IAAgBJ,GAAcK,GAAGH,CAAO,KAAKD,GAAqBI,GAAGH,CAAO,KAAKA,GACjFI,IAAcL,GAAqBI,GAAGH,CAAO,KAAKE,GAClDG,IAAcC,EAAkBN,CAAO,GAC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E;AAEA,SAAS7C,EAAkB/B,GAA6B;AACtD,UAAQA,GAAAA;AAAAA,IACN,KAAK;AACH,aAAO,CAAC,OAAO,iBAAiB,WAAW,0BAA0B;AAAA,IACvE,KAAK;AACH,aAAO,CAAC,MAAM,kBAAkB,iBAAiB,SAAS;AAAA,IAC5D,KAAK;AACH,aAAO,CAAC,OAAO,sBAAsB;AAAA,IACvC,KAAK;AACH,aAAO,CAAC,eAAe,OAAO;AAAA,IAChC,KAAK;AACH,aAAO,CAAC,SAAS,KAAK;AAAA,IACxB,KAAK;AACH,aAAO,CAAC,OAAO,gBAAgB;AAAA,IACjC,KAAK;AACH,aAAO,CAAC,mBAAmB;AAAA,IAC7B,KAAK;AACH,aAAO,CAAC,QAAQ;AAAA,IAClB;AACE,aAAO,CAAA;AAAA,EAAA;AAEb;"}
|
package/dist/index45.js
CHANGED
|
@@ -1,225 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { validatePhoneNumberLength as D } from "./index74.js";
|
|
5
|
-
function g(t) {
|
|
1
|
+
import { AsYouType as u } from "./index77.js";
|
|
2
|
+
import { validatePhoneNumberLength as a } from "./index78.js";
|
|
3
|
+
function l(t) {
|
|
6
4
|
return t.replace(/\D/g, "");
|
|
7
5
|
}
|
|
8
|
-
|
|
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 {
|
|
17
|
-
force: u = !1
|
|
18
|
-
} = s, o = `+${e}`;
|
|
19
|
-
if (!t.startsWith(o) || !u)
|
|
20
|
-
return t;
|
|
21
|
-
const i = t.slice(o.length).trimStart();
|
|
22
|
-
if (i.startsWith("0"))
|
|
23
|
-
return t;
|
|
24
|
-
if (!i)
|
|
25
|
-
return `${o} 0`;
|
|
26
|
-
const [n, ...r] = i.split(" "), f = `0${n ?? ""}`, l = r.length > 0 ? ` ${r.join(" ")}` : "";
|
|
27
|
-
return `${o} ${f}${l}`.replace(/\s\s+/g, " ").trimEnd();
|
|
28
|
-
}
|
|
29
|
-
const O = {
|
|
6
|
+
const f = {
|
|
30
7
|
GG: "GB",
|
|
31
8
|
JE: "GB",
|
|
32
9
|
IM: "GB"
|
|
33
10
|
};
|
|
34
|
-
function
|
|
11
|
+
function m(t) {
|
|
35
12
|
if (t)
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
function _(t, e, s) {
|
|
39
|
-
if (!t || !s || (t.nationalNumber ?? "").length < 4)
|
|
40
|
-
return;
|
|
41
|
-
const o = t.countryCallingCode;
|
|
42
|
-
if (!o)
|
|
43
|
-
return;
|
|
44
|
-
const i = t.getMetadata, n = (typeof i == "function" ? i() : null)?.country_calling_codes?.[o];
|
|
45
|
-
if (!n || n.length === 0)
|
|
46
|
-
return;
|
|
47
|
-
const r = [];
|
|
48
|
-
for (const f of n) {
|
|
49
|
-
const l = y(f);
|
|
50
|
-
l && !r.includes(l) && r.push(l);
|
|
51
|
-
}
|
|
52
|
-
if (r.length !== 0)
|
|
53
|
-
return e && r.includes(e) ? e : r.includes(x) ? x : r[0];
|
|
54
|
-
}
|
|
55
|
-
function B(t, e, s, u) {
|
|
56
|
-
if (!t)
|
|
57
|
-
return !1;
|
|
58
|
-
if (!u)
|
|
59
|
-
return t.startsWith("0");
|
|
60
|
-
if (!s || !t.startsWith(s) || !t.slice(s.length).startsWith("0"))
|
|
61
|
-
return !1;
|
|
62
|
-
const o = t.slice(s.length + 1), i = e.startsWith(s) ? e.slice(s.length) : e;
|
|
63
|
-
return o === i;
|
|
13
|
+
return f[t] ?? t;
|
|
64
14
|
}
|
|
65
|
-
function
|
|
66
|
-
for (const e of $)
|
|
67
|
-
if (t.startsWith(e))
|
|
68
|
-
return t.slice(e.length);
|
|
69
|
-
return t;
|
|
70
|
-
}
|
|
71
|
-
function M(t, e, s = {}) {
|
|
72
|
-
const {
|
|
73
|
-
allowJustPlus: u = !1,
|
|
74
|
-
removeNationalPrefix: o = !0,
|
|
75
|
-
previousValue: i
|
|
76
|
-
} = s, n = T(t).trim();
|
|
77
|
-
if (!n)
|
|
78
|
-
return "";
|
|
79
|
-
if (n === "+")
|
|
80
|
-
return u ? "+" : "";
|
|
81
|
-
if (n.startsWith("+")) {
|
|
82
|
-
const a = g(n);
|
|
83
|
-
if (!a)
|
|
84
|
-
return u ? "+" : "";
|
|
85
|
-
const d = S(a);
|
|
86
|
-
if (d !== a)
|
|
87
|
-
return d ? `+${d}` : u ? "+" : "";
|
|
88
|
-
if (o && e) {
|
|
89
|
-
const h = p(e);
|
|
90
|
-
if (a.startsWith(h) && a.slice(h.length).startsWith("0")) {
|
|
91
|
-
const E = a.slice(h.length + 1);
|
|
92
|
-
return E ? `+${h}${E}` : `+${h}`;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return `+${a}`;
|
|
96
|
-
}
|
|
97
|
-
const r = g(n);
|
|
98
|
-
if (!r)
|
|
99
|
-
return "";
|
|
100
|
-
const f = S(r);
|
|
101
|
-
if (f !== r)
|
|
102
|
-
return f ? `+${f}` : u ? "+" : "";
|
|
103
|
-
const l = typeof i == "string" ? i : "", m = l && l.startsWith("+") ? g(l) : "";
|
|
104
|
-
if (m && m.length > r.length && m.endsWith(r) && m.length - r.length <= W)
|
|
105
|
-
return `+${r}`;
|
|
106
|
-
if (r === "0")
|
|
107
|
-
return "0";
|
|
108
|
-
if (o && e && r.length > 1 && r.startsWith("0") && !r.startsWith("00")) {
|
|
109
|
-
const a = p(e), d = r.slice(1);
|
|
110
|
-
return d ? `+${a}${d}` : `+${a}`;
|
|
111
|
-
}
|
|
112
|
-
return e ? r.length <= 4 ? `+${r}` : `+${p(e)}${r}` : r;
|
|
113
|
-
}
|
|
114
|
-
function Y(t, e) {
|
|
15
|
+
function N(t, n) {
|
|
115
16
|
if (t === "+")
|
|
116
17
|
return {
|
|
117
18
|
international: "+",
|
|
118
19
|
national: "",
|
|
119
20
|
formatted: "+",
|
|
120
21
|
phoneNumber: null,
|
|
121
|
-
detectedCountry: void 0
|
|
122
|
-
inferredCountry: void 0,
|
|
123
|
-
hasExplicitInternationalPrefix: !0
|
|
22
|
+
detectedCountry: void 0
|
|
124
23
|
};
|
|
125
|
-
const
|
|
24
|
+
const r = n ? new u(n) : new u(), o = r.input(t), e = r.getNumber(), c = m(e?.country ?? r.country ?? void 0), i = e?.formatInternational() ?? o, s = e?.formatNational() ?? l(i);
|
|
126
25
|
return {
|
|
127
|
-
international:
|
|
128
|
-
national:
|
|
26
|
+
international: i,
|
|
27
|
+
national: s,
|
|
129
28
|
formatted: o,
|
|
130
|
-
phoneNumber:
|
|
131
|
-
detectedCountry:
|
|
132
|
-
inferredCountry: r,
|
|
133
|
-
hasExplicitInternationalPrefix: s
|
|
29
|
+
phoneNumber: e,
|
|
30
|
+
detectedCountry: c
|
|
134
31
|
};
|
|
135
32
|
}
|
|
136
|
-
function
|
|
137
|
-
return t.startsWith(
|
|
33
|
+
function O(t, n) {
|
|
34
|
+
return t.startsWith(n) ? t.slice(n.length) : t;
|
|
138
35
|
}
|
|
139
|
-
function
|
|
140
|
-
if (!
|
|
36
|
+
function d(t, n) {
|
|
37
|
+
if (!n || !t)
|
|
141
38
|
return null;
|
|
142
39
|
try {
|
|
143
|
-
return
|
|
40
|
+
return a(t, n) === "TOO_LONG" ? "TOO_LONG" : null;
|
|
144
41
|
} catch {
|
|
145
42
|
return null;
|
|
146
43
|
}
|
|
147
44
|
}
|
|
148
|
-
function U(t, e, s, u = {}) {
|
|
149
|
-
const {
|
|
150
|
-
hasRemovedNationalPrefix: o = !1,
|
|
151
|
-
detectedCountry: i,
|
|
152
|
-
hasExplicitInternationalPrefix: c = !1
|
|
153
|
-
} = u;
|
|
154
|
-
if (!t)
|
|
155
|
-
return {
|
|
156
|
-
shouldSuggest: !1,
|
|
157
|
-
query: ""
|
|
158
|
-
};
|
|
159
|
-
if (t === "+")
|
|
160
|
-
return {
|
|
161
|
-
shouldSuggest: !0,
|
|
162
|
-
query: ""
|
|
163
|
-
};
|
|
164
|
-
const n = g(t);
|
|
165
|
-
if (!n)
|
|
166
|
-
return {
|
|
167
|
-
shouldSuggest: !0,
|
|
168
|
-
query: ""
|
|
169
|
-
};
|
|
170
|
-
if (o)
|
|
171
|
-
return {
|
|
172
|
-
shouldSuggest: !1,
|
|
173
|
-
query: ""
|
|
174
|
-
};
|
|
175
|
-
if (c && !i)
|
|
176
|
-
return P(n) ? {
|
|
177
|
-
shouldSuggest: !0,
|
|
178
|
-
query: n
|
|
179
|
-
} : {
|
|
180
|
-
shouldSuggest: !1,
|
|
181
|
-
query: ""
|
|
182
|
-
};
|
|
183
|
-
let r = s?.countryCallingCode ?? null;
|
|
184
|
-
if (!r) {
|
|
185
|
-
if (e) {
|
|
186
|
-
const l = p(e);
|
|
187
|
-
n.startsWith(l) && (r = l);
|
|
188
|
-
} else if (!c)
|
|
189
|
-
return {
|
|
190
|
-
shouldSuggest: !1,
|
|
191
|
-
query: ""
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
return r ? v(n, r).length === 0 ? {
|
|
195
|
-
shouldSuggest: !0,
|
|
196
|
-
query: n
|
|
197
|
-
} : {
|
|
198
|
-
shouldSuggest: !1,
|
|
199
|
-
query: ""
|
|
200
|
-
} : {
|
|
201
|
-
shouldSuggest: !0,
|
|
202
|
-
query: n
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
function V(t, e) {
|
|
206
|
-
if (t.shouldSuggest)
|
|
207
|
-
return !1;
|
|
208
|
-
const {
|
|
209
|
-
hasExplicitInternationalPrefix: s = !1,
|
|
210
|
-
detectedCountry: u
|
|
211
|
-
} = e;
|
|
212
|
-
return s ? !!u : !0;
|
|
213
|
-
}
|
|
214
45
|
export {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
q as injectNationalPrefixDisplay,
|
|
220
|
-
M as normalizeInputValue,
|
|
221
|
-
g as sanitizeDigits,
|
|
222
|
-
V as shouldDisplayExplicitCountrySelection,
|
|
223
|
-
v as stripPrefix
|
|
46
|
+
N as formatWithAsYouType,
|
|
47
|
+
d as getLengthIssue,
|
|
48
|
+
l as sanitizeDigits,
|
|
49
|
+
O as stripPrefix
|
|
224
50
|
};
|
|
225
51
|
//# sourceMappingURL=index45.js.map
|
package/dist/index45.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index45.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","replace","isDialCodeProgress","digits","length","MAX_DIAL_CODE_LENGTH","COUNTRY_DIAL_CODES","some","dial","startsWith","INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","injectNationalPrefixDisplay","international","dialCode","options","force","prefix","remainder","slice","trimStart","firstGroup","restGroups","split","rebuiltFirstGroup","rebuiltRemainder","join","trimEnd","DETECTED_COUNTRY_OVERRIDES","GG","JE","IM","canonicalizeDetectedCountry","candidate","inferCountryFromDialCode","phoneNumber","baseCountry","normalizedDigits","nationalNumber","countryCallingCode","metadataGetter","getMetadata","candidates","country_calling_codes","canonicalCandidates","canonical","includes","push","DEFAULT_COUNTRY","detectNationalPrefixForDisplay","rawDigits","internationalDigits","hasExplicitInternationalPrefix","rawAfterTrunk","internationalAfterDial","stripIddPrefix","COMMON_IDD_PREFIXES","normalizeInputValue","rawValue","country","allowJustPlus","removeNationalPrefix","previousValue","trimmed","trim","digitsWithoutIdd","getCountryCallingCode","withoutPrefix","digitsOnly","previousNormalized","previousDigits","endsWith","formatWithAsYouType","national","formatted","detectedCountry","undefined","inferredCountry","test","formatter","AsYouType","input","getNumber","formatInternational","formatNational","stripPrefix","getLengthIssue","validatePhoneNumberLength","getSuggestionState","normalized","hasRemovedNationalPrefix","shouldSuggest","query","baseDial","shouldDisplayExplicitCountrySelection","suggestion","Boolean"],"mappings":";;;;AAaO,SAASA,EAAeC,GAAe;AAC5C,SAAOA,EAAMC,QAAQ,OAAO,EAAE;AAChC;AAEA,SAASC,EAAmBC,GAAgB;AAC1C,SAAKA,IAIDA,EAAOC,SAASC,IACX,KAGFC,EAAmBC,KAAMC,CAAAA,MAASA,EAAKC,WAAWN,CAAM,CAAC,IAPvD;AAQX;AAEA,MAAMO,IACJ;AAEF,SAASC,EAAyBX,GAAe;AAC/C,SAAOA,EAAMC,QAAQS,GAAiC,EAAE;AAC1D;AAEO,SAASE,EACdC,GACAC,GACAC,IAA+B,CAAA,GAC/B;AAGA,QAAM;AAAA,IAAEC,OAAAA,IAAQ;AAAA,EAAA,IAAUD,GACpBE,IAAS,IAAIH,CAAQ;AAM3B,MAJI,CAACD,EAAcJ,WAAWQ,CAAM,KAIhC,CAACD;AACH,WAAOH;AAGT,QAAMK,IAAYL,EAAcM,MAAMF,EAAOb,MAAM,EAAEgB,UAAAA;AAGrD,MAFwBF,EAAUT,WAAW,GAAG;AAG9C,WAAOI;AAGT,MAAI,CAACK;AACH,WAAO,GAAGD,CAAM;AAGlB,QAAM,CAACI,GAAY,GAAGC,CAAU,IAAIJ,EAAUK,MAAM,GAAG,GACjDC,IAAoB,IAAIH,KAAc,EAAE,IACxCI,IAAmBH,EAAWlB,SAAS,IAAI,IAAIkB,EAAWI,KAAK,GAAG,CAAC,KAAK;AAE9E,SAAO,GAAGT,CAAM,IAAIO,CAAiB,GAAGC,CAAgB,GAAGxB,QAAQ,UAAU,GAAG,EAAE0B,QAAAA;AACpF;AAEA,MAAMC,IAAwE;AAAA,EAC5EC,IAAI;AAAA,EACJC,IAAI;AAAA,EAC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IpF,IAAO2B,GAAaI,sBAAsB;AAC9C,MAAI,CAAC/B;AACH,QAAI4B,GAAa;AACf,YAAMyD,IAAW3B,EAAsB9B,CAAW;AAClD,MAAIjC,EAAOM,WAAWoF,CAAQ,MAC5BrF,IAAOqF;AAAAA,IAEX,WAAW,CAACzC;AACV,aAAO;AAAA,QAAEuC,eAAe;AAAA,QAAOC,OAAO;AAAA,MAAA;AAAA;AAI1C,SAAKpF,IAIkB6E,EAAYlF,GAAQK,CAAI,EAC5BJ,WAAW,IACrB;AAAA,IAAEuF,eAAe;AAAA,IAAMC,OAAOzF;AAAAA,EAAAA,IAGhC;AAAA,IAAEwF,eAAe;AAAA,IAAOC,OAAO;AAAA,EAAA,IAR7B;AAAA,IAAED,eAAe;AAAA,IAAMC,OAAOzF;AAAAA,EAAAA;AASzC;AAEO,SAAS2F,EACdC,GACAhF,GACA;AACA,MAAIgF,EAAWJ;AACb,WAAO;AAGT,QAAM;AAAA,IAAEvC,gCAAAA,IAAiC;AAAA,IAAOuB,iBAAAA;AAAAA,EAAAA,IAAoB5D;AAEpE,SAAKqC,IAIE4C,EAAQrB,IAHN;AAIX;"}
|
|
1
|
+
{"version":3,"file":"index45.js","sources":["../src/components/PhoneNumberInput/normalization.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { AsYouType, validatePhoneNumberLength } from \"libphonenumber-js\"\n\n\nexport type LengthIssue = \"TOO_LONG\"\n\nexport function sanitizeDigits(value: string) {\n return value.replace(/\\D/g, \"\")\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\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 }\n }\n\n const formatter = baseCountry ? new AsYouType(baseCountry) : new AsYouType()\n const formatted = formatter.input(value)\n const phoneNumber = formatter.getNumber()\n const detectedCountry = canonicalizeDetectedCountry(\n (phoneNumber?.country ?? formatter.country ?? undefined) as CountryCode | undefined\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 }\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"],"names":["sanitizeDigits","value","replace","DETECTED_COUNTRY_OVERRIDES","GG","JE","IM","canonicalizeDetectedCountry","candidate","formatWithAsYouType","baseCountry","international","national","formatted","phoneNumber","detectedCountry","undefined","formatter","AsYouType","input","getNumber","country","formatInternational","formatNational","stripPrefix","prefix","startsWith","slice","length","getLengthIssue","validatePhoneNumberLength"],"mappings":";;AAMO,SAASA,EAAeC,GAAe;AAC5C,SAAOA,EAAMC,QAAQ,OAAO,EAAE;AAChC;AAEA,MAAMC,IAAwE;AAAA,EAC5EC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AACN;AAEA,SAASC,EAA4BC,GAA6D;AAChG,MAAKA;AAGL,WAAOL,EAA2BK,CAAS,KAAKA;AAClD;AAEO,SAASC,EAAoBR,GAAeS,GAA2B;AAC5E,MAAIT,MAAU;AACZ,WAAO;AAAA,MACLU,eAAe;AAAA,MACfC,UAAU;AAAA,MACVC,WAAW;AAAA,MACXC,aAAa;AAAA,MACbC,iBAAiBC;AAAAA,IAAAA;AAIrB,QAAMC,IAAYP,IAAc,IAAIQ,EAAUR,CAAW,IAAI,IAAIQ,EAAAA,GAC3DL,IAAYI,EAAUE,MAAMlB,CAAK,GACjCa,IAAcG,EAAUG,UAAAA,GACxBL,IAAkBR,EACrBO,GAAaO,WAAWJ,EAAUI,WAAWL,MAChD,GACML,IAAgBG,GAAaQ,oBAAAA,KAAyBT,GACtDD,IAAWE,GAAaS,eAAAA,KAAoBvB,EAAeW,CAAa;AAE9E,SAAO;AAAA,IACLA,eAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,iBAAAA;AAAAA,EAAAA;AAEJ;AAEO,SAASS,EAAYvB,GAAewB,GAAgB;AACzD,SAAOxB,EAAMyB,WAAWD,CAAM,IAAIxB,EAAM0B,MAAMF,EAAOG,MAAM,IAAI3B;AACjE;AAEO,SAAS4B,EAAe5B,GAAeoB,GAAsD;AAClG,MAAI,CAACA,KAAW,CAACpB;AACf,WAAO;AAGT,MAAI;AAEF,WADe6B,EAA0B7B,GAAOoB,CAAO,MACrC,aAAa,aAAa;AAAA,EAC9C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;"}
|
package/dist/index48.js
CHANGED
package/dist/index49.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import * as s from "react";
|
|
2
|
-
import { visuallyHiddenInput as Ze, visuallyHidden as et } from "./
|
|
3
|
-
import { useMergedRefs as tt } from "./
|
|
4
|
-
import { useRefWithInit as ot } from "./
|
|
5
|
-
import { useOnFirstRender as nt } from "./
|
|
6
|
-
import { usePreviousValue as rt } from "./
|
|
7
|
-
import { useControlled as le } from "./
|
|
8
|
-
import { useIsoLayoutEffect as x } from "./
|
|
9
|
-
import { useStableCallback as b } from "./
|
|
10
|
-
import { useValueAsRef as st } from "./
|
|
11
|
-
import { EMPTY_ARRAY as ie, EMPTY_OBJECT as lt } from "./
|
|
12
|
-
import { SelectRootContext as it, SelectFloatingContext as at } from "./
|
|
13
|
-
import { useFieldRootContext as ut } from "./
|
|
14
|
-
import { useRegisterFieldControl as ct } from "./
|
|
15
|
-
import { useLabelableId as dt } from "./
|
|
16
|
-
import { useTransitionStatus as ft } from "./
|
|
17
|
-
import { selectors as A } from "./
|
|
18
|
-
import { createChangeEventDetails as ae } from "./
|
|
19
|
-
import { useOpenChangeComplete as mt } from "./
|
|
20
|
-
import { useFormContext as pt } from "./
|
|
21
|
-
import { stringifyAsValue as y, stringifyAsLabel as gt } from "./
|
|
22
|
-
import { defaultItemEquality as ht, findItemIndex as ue } from "./
|
|
23
|
-
import { useValueChanged as Rt } from "./
|
|
24
|
-
import { useOpenInteractionType as vt } from "./
|
|
25
|
-
import { getMaxScrollOffset as It, normalizeScrollOffset as bt } from "./
|
|
2
|
+
import { visuallyHiddenInput as Ze, visuallyHidden as et } from "./index196.js";
|
|
3
|
+
import { useMergedRefs as tt } from "./index197.js";
|
|
4
|
+
import { useRefWithInit as ot } from "./index198.js";
|
|
5
|
+
import { useOnFirstRender as nt } from "./index167.js";
|
|
6
|
+
import { usePreviousValue as rt } from "./index199.js";
|
|
7
|
+
import { useControlled as le } from "./index200.js";
|
|
8
|
+
import { useIsoLayoutEffect as x } from "./index201.js";
|
|
9
|
+
import { useStableCallback as b } from "./index202.js";
|
|
10
|
+
import { useValueAsRef as st } from "./index203.js";
|
|
11
|
+
import { EMPTY_ARRAY as ie, EMPTY_OBJECT as lt } from "./index204.js";
|
|
12
|
+
import { SelectRootContext as it, SelectFloatingContext as at } from "./index205.js";
|
|
13
|
+
import { useFieldRootContext as ut } from "./index206.js";
|
|
14
|
+
import { useRegisterFieldControl as ct } from "./index207.js";
|
|
15
|
+
import { useLabelableId as dt } from "./index208.js";
|
|
16
|
+
import { useTransitionStatus as ft } from "./index209.js";
|
|
17
|
+
import { selectors as A } from "./index210.js";
|
|
18
|
+
import { createChangeEventDetails as ae } from "./index154.js";
|
|
19
|
+
import { useOpenChangeComplete as mt } from "./index161.js";
|
|
20
|
+
import { useFormContext as pt } from "./index211.js";
|
|
21
|
+
import { stringifyAsValue as y, stringifyAsLabel as gt } from "./index212.js";
|
|
22
|
+
import { defaultItemEquality as ht, findItemIndex as ue } from "./index213.js";
|
|
23
|
+
import { useValueChanged as Rt } from "./index214.js";
|
|
24
|
+
import { useOpenInteractionType as vt } from "./index215.js";
|
|
25
|
+
import { getMaxScrollOffset as It, normalizeScrollOffset as bt } from "./index216.js";
|
|
26
26
|
import { j as M } from "./index30.js";
|
|
27
|
-
import { useStore as w } from "./
|
|
28
|
-
import { useFloatingRootContext as yt } from "./
|
|
29
|
-
import { useClick as Ct } from "./
|
|
30
|
-
import { useDismiss as Vt } from "./
|
|
31
|
-
import { useListNavigation as xt } from "./
|
|
32
|
-
import { useTypeahead as At } from "./
|
|
33
|
-
import { useInteractions as Mt } from "./
|
|
34
|
-
import { mergeProps as wt } from "./
|
|
35
|
-
import { Store as Pt } from "./
|
|
36
|
-
import { none as St, focusOut as Et, outsidePress as Tt } from "./
|
|
27
|
+
import { useStore as w } from "./index217.js";
|
|
28
|
+
import { useFloatingRootContext as yt } from "./index218.js";
|
|
29
|
+
import { useClick as Ct } from "./index173.js";
|
|
30
|
+
import { useDismiss as Vt } from "./index219.js";
|
|
31
|
+
import { useListNavigation as xt } from "./index220.js";
|
|
32
|
+
import { useTypeahead as At } from "./index221.js";
|
|
33
|
+
import { useInteractions as Mt } from "./index174.js";
|
|
34
|
+
import { mergeProps as wt } from "./index222.js";
|
|
35
|
+
import { Store as Pt } from "./index223.js";
|
|
36
|
+
import { none as St, focusOut as Et, outsidePress as Tt } from "./index156.js";
|
|
37
37
|
function ho(ce) {
|
|
38
38
|
const {
|
|
39
39
|
id: de,
|