@rpcbase/ui 0.238.0 → 0.240.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AddressAutocompleteInput/index.d.ts.map +1 -1
- package/dist/components/I18nField/index.d.ts +2 -1
- package/dist/components/I18nField/index.d.ts.map +1 -1
- package/dist/helpers/useMapsLibrary.d.ts.map +1 -1
- package/dist/index106.js +36 -36
- package/dist/index11.js +373 -335
- package/dist/index11.js.map +1 -1
- package/dist/index118.js +6 -6
- package/dist/index121.js +10 -10
- package/dist/index123.js +2 -2
- package/dist/index124.js +3 -3
- package/dist/index125.js +1 -1
- package/dist/index127.js +2 -2
- package/dist/index129.js +2 -2
- package/dist/index172.js +3 -3
- package/dist/index175.js +1 -1
- package/dist/index176.js +4 -4
- package/dist/index178.js +1 -1
- package/dist/index182.js +2 -2
- package/dist/index184.js +12 -12
- package/dist/index185.js +1 -1
- package/dist/index187.js +6 -6
- package/dist/index189.js +6 -6
- package/dist/index190.js +5 -5
- package/dist/index193.js +3 -3
- package/dist/index194.js +5 -5
- package/dist/index196.js +20 -59
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +66 -8
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +6 -87
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +11 -19
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +48 -14
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +4 -6
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +29 -5
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +16 -6
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +5 -4
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +21 -6
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +51 -16
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +25 -4
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +41 -4
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +39 -12
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +45 -10
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +20 -13
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +70 -13
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +17 -4
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +11 -5
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +27 -6
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +13 -5
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +17 -53
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +36 -8
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +262 -4
- package/dist/index219.js.map +1 -1
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +278 -4
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +68 -8
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +99 -4
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +83 -4
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +3 -3
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +29 -10
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +16 -9
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +35 -10
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +16 -10
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +3 -10
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +26 -9
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +28 -6
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +4 -6
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +78 -4
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +269 -5
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +11 -6
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +10 -5
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +25 -29
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +16 -12
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +124 -24
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +5 -5
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +40 -16
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +65 -7
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +13 -10
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +7 -10
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +5 -21
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +3 -10
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +10 -9
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +7 -9
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +133 -4
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +399 -5
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +52 -16
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +11 -9
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +11 -18
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +16 -15
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +5 -12
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +6 -20
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +57 -65
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +87 -6
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +6 -11
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +4 -50
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +7 -4
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +16 -29
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +4 -16
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +4 -5
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +12 -21
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +9 -51
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +13 -25
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +13 -41
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +4 -39
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +6 -45
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +6 -20
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +5 -70
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +53 -16
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +8 -11
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +4 -27
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +4 -13
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +8 -18
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +4 -36
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +4 -262
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +3 -278
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +10 -68
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +9 -99
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +9 -83
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +10 -3
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +10 -29
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +9 -16
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +7 -35
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +5 -16
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +4 -3
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +5 -26
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +6 -28
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +6 -4
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +8 -78
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +18 -268
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +15 -10
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +7 -10
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +10 -25
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +10 -16
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +21 -125
- package/dist/index299.js.map +1 -1
- package/dist/index3.js.map +1 -1
- package/dist/index300.js +10 -5
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +9 -40
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +9 -65
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +5 -14
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +5 -7
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +16 -5
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +9 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +18 -10
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +15 -7
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +11 -132
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +29 -399
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +12 -52
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +25 -11
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +5 -11
- package/dist/index313.js.map +1 -1
- package/dist/index321.js +1 -1
- package/dist/index329.js +1 -1
- package/dist/index330.js +1 -1
- package/dist/index334.js +7 -8
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +8 -7
- package/dist/index335.js.map +1 -1
- package/dist/index339.js +1 -1
- package/dist/index345.js +51 -17
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +17 -51
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +5 -122
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +121 -31
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +31 -72
- package/dist/index349.js.map +1 -1
- package/dist/index350.js +70 -139
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +116 -35
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +56 -44
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +49 -14
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +15 -6
- package/dist/index354.js.map +1 -1
- package/dist/index359.js +11 -4
- package/dist/index359.js.map +1 -1
- package/dist/index360.js +17 -18
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +4 -13
- package/dist/index361.js.map +1 -1
- package/dist/index362.js +5 -11
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +19 -15
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +45 -6
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +18 -4
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +5 -21
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +200 -44
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +77 -17
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +5 -5
- package/dist/index369.js.map +1 -1
- package/dist/index370.js +16 -199
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +12 -77
- package/dist/index371.js.map +1 -1
- package/dist/index374.js +3 -3
- package/dist/index375.js +1 -1
- package/dist/index376.js +3 -3
- package/dist/index378.js +2 -2
- package/dist/index380.js +1 -1
- package/dist/index381.js +2 -2
- package/dist/index384.js +2 -2
- package/dist/index386.js +1 -1
- package/dist/index387.js +3 -5
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +3 -5
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +5 -4
- package/dist/index389.js.map +1 -1
- package/dist/index390.js +4 -15
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +4 -9
- package/dist/index391.js.map +1 -1
- package/dist/index392.js +15 -5
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +8 -4
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +5 -545
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +5 -47
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +543 -15
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +47 -6
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +17 -7
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +5 -6
- package/dist/index399.js.map +1 -1
- package/dist/index400.js +7 -7
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +6 -11
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +7 -8
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +11 -12
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +9 -3
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +13 -3
- package/dist/index405.js.map +1 -1
- package/dist/index407.js +1 -1
- package/dist/index408.js +7 -4
- package/dist/index408.js.map +1 -1
- package/dist/index409.js +2 -56
- package/dist/index409.js.map +1 -1
- package/dist/index410.js +43 -67
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +56 -31
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +8 -9
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +2 -153
- package/dist/index413.js.map +1 -1
- package/dist/index414.js +54 -107
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +55 -7
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +5 -2
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +54 -42
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +68 -56
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +31 -8
- package/dist/index419.js.map +1 -1
- package/dist/index420.js +9 -2
- package/dist/index420.js.map +1 -1
- package/dist/index421.js +152 -54
- package/dist/index421.js.map +1 -1
- package/dist/index422.js +108 -56
- package/dist/index422.js.map +1 -1
- package/dist/index423.js +2 -16
- package/dist/index423.js.map +1 -1
- package/dist/index424.js +2 -29
- package/dist/index424.js.map +1 -1
- package/dist/index425.js +2 -13
- package/dist/index425.js.map +1 -1
- package/dist/index426.js +2 -7
- package/dist/index426.js.map +1 -1
- package/dist/index427.js +16 -2
- package/dist/index427.js.map +1 -1
- package/dist/index428.js +29 -2
- package/dist/index428.js.map +1 -1
- package/dist/index429.js +13 -2
- package/dist/index429.js.map +1 -1
- package/dist/index430.js +7 -2
- package/dist/index430.js.map +1 -1
- package/dist/index44.js +1 -1
- package/dist/index45.js +2 -2
- package/dist/index49.js +28 -28
- package/dist/index50.js +21 -21
- package/dist/index51.js +1 -1
- package/dist/index52.js +8 -8
- package/dist/index53.js +2 -2
- package/dist/index55.js +17 -17
- package/dist/index56.js +4 -4
- package/dist/index57.js +3 -3
- package/dist/index58.js +7 -7
- package/dist/index59.js +4 -4
- package/dist/index60.js +12 -12
- package/dist/index61.js +2 -2
- package/dist/index62.js +2 -2
- package/dist/index70.js +1 -1
- package/dist/index71.js +1 -1
- package/dist/index74.js +6 -2
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +8 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +5 -5
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +2 -8
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +2 -6
- package/dist/index78.js.map +1 -1
- package/package.json +1 -1
package/dist/index297.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index297.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index297.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js"],"sourcesContent":["/**\n * Returns the months to display in the calendar.\n *\n * @param firstDisplayedMonth The first month currently displayed in the\n * calendar.\n * @param calendarEndMonth The latest month the user can navigate to.\n * @param props The DayPicker props, including `numberOfMonths`.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of dates representing the months to display.\n */\nexport function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {\n const { numberOfMonths = 1 } = props;\n const months = [];\n for (let i = 0; i < numberOfMonths; i++) {\n const month = dateLib.addMonths(firstDisplayedMonth, i);\n if (calendarEndMonth && month > calendarEndMonth) {\n break;\n }\n months.push(month);\n }\n return months;\n}\n"],"names":["getDisplayMonths","firstDisplayedMonth","calendarEndMonth","props","dateLib","numberOfMonths","months","i","month"],"mappings":"AAUO,SAASA,EAAiBC,GAAqBC,GAAkBC,GAAOC,GAAS;AACpF,QAAM,EAAE,gBAAAC,IAAiB,EAAC,IAAKF,GACzBG,IAAS,CAAA;AACf,WAASC,IAAI,GAAGA,IAAIF,GAAgBE,KAAK;AACrC,UAAMC,IAAQJ,EAAQ,UAAUH,GAAqBM,CAAC;AACtD,QAAIL,KAAoBM,IAAQN;AAC5B;AAEJ,IAAAI,EAAO,KAAKE,CAAK;AAAA,EACrB;AACA,SAAOF;AACX;","x_google_ignoreList":[0]}
|
package/dist/index298.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
r(!1);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const u = m(o).documentElement.clientWidth, f = o.offsetWidth;
|
|
14
|
-
r(u > 0 && f > 0 && f >= u - S);
|
|
15
|
-
}, [t, c, o]), p(t && (!c || s), l);
|
|
1
|
+
function u(i, o, n, e) {
|
|
2
|
+
const { month: s, defaultMonth: M, today: c = e.today(), numberOfMonths: f = 1 } = i;
|
|
3
|
+
let t = s || M || c;
|
|
4
|
+
const { differenceInCalendarMonths: h, addMonths: l, startOfMonth: r } = e;
|
|
5
|
+
if (n && h(n, t) < f - 1) {
|
|
6
|
+
const d = -1 * (f - 1);
|
|
7
|
+
t = l(n, d);
|
|
8
|
+
}
|
|
9
|
+
return o && h(t, o) < 0 && (t = o), r(t);
|
|
16
10
|
}
|
|
17
11
|
export {
|
|
18
|
-
|
|
12
|
+
u as getInitialMonth
|
|
19
13
|
};
|
|
20
14
|
//# sourceMappingURL=index298.js.map
|
package/dist/index298.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index298.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index298.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js"],"sourcesContent":["/**\n * Determines the initial month to display in the calendar based on the provided\n * props.\n *\n * This function calculates the starting month, considering constraints such as\n * `startMonth`, `endMonth`, and the number of months to display.\n *\n * @param props The DayPicker props, including navigation and date constraints.\n * @param dateLib The date library to use for date manipulation.\n * @returns The initial month to display.\n */\nexport function getInitialMonth(props, navStart, navEnd, dateLib) {\n const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1, } = props;\n let initialMonth = month || defaultMonth || today;\n const { differenceInCalendarMonths, addMonths, startOfMonth } = dateLib;\n if (navEnd &&\n differenceInCalendarMonths(navEnd, initialMonth) < numberOfMonths - 1) {\n const offset = -1 * (numberOfMonths - 1);\n initialMonth = addMonths(navEnd, offset);\n }\n if (navStart && differenceInCalendarMonths(initialMonth, navStart) < 0) {\n initialMonth = navStart;\n }\n return startOfMonth(initialMonth);\n}\n"],"names":["getInitialMonth","props","navStart","navEnd","dateLib","month","defaultMonth","today","numberOfMonths","initialMonth","differenceInCalendarMonths","addMonths","startOfMonth","offset"],"mappings":"AAWO,SAASA,EAAgBC,GAAOC,GAAUC,GAAQC,GAAS;AAC9D,QAAM,EAAE,OAAAC,GAAO,cAAAC,GAAc,OAAAC,IAAQH,EAAQ,SAAS,gBAAAI,IAAiB,EAAC,IAAMP;AAC9E,MAAIQ,IAAeJ,KAASC,KAAgBC;AAC5C,QAAM,EAAE,4BAAAG,GAA4B,WAAAC,GAAW,cAAAC,EAAY,IAAKR;AAChE,MAAID,KACAO,EAA2BP,GAAQM,CAAY,IAAID,IAAiB,GAAG;AACvE,UAAMK,IAAS,MAAML,IAAiB;AACtC,IAAAC,IAAeE,EAAUR,GAAQU,CAAM;AAAA,EAC3C;AACA,SAAIX,KAAYQ,EAA2BD,GAAcP,CAAQ,IAAI,MACjEO,IAAeP,IAEZU,EAAaH,CAAY;AACpC;","x_google_ignoreList":[0]}
|
package/dist/index299.js
CHANGED
|
@@ -1,129 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
function x(t) {
|
|
23
|
-
return t === "x" ? "y" : "x";
|
|
24
|
-
}
|
|
25
|
-
function b(t) {
|
|
26
|
-
return t === "y" ? "height" : "width";
|
|
27
|
-
}
|
|
28
|
-
function d(t) {
|
|
29
|
-
const n = t[0];
|
|
30
|
-
return n === "t" || n === "b" ? "y" : "x";
|
|
31
|
-
}
|
|
32
|
-
function A(t) {
|
|
33
|
-
return x(d(t));
|
|
34
|
-
}
|
|
35
|
-
function R(t, n, e) {
|
|
36
|
-
e === void 0 && (e = !1);
|
|
37
|
-
const r = a(t), i = A(t), o = b(i);
|
|
38
|
-
let c = i === "x" ? r === (e ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
39
|
-
return n.reference[o] > n.floating[o] && (c = f(c)), [c, f(c)];
|
|
40
|
-
}
|
|
41
|
-
function T(t) {
|
|
42
|
-
const n = f(t);
|
|
43
|
-
return [s(t), n, s(n)];
|
|
44
|
-
}
|
|
45
|
-
function s(t) {
|
|
46
|
-
return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
|
|
47
|
-
}
|
|
48
|
-
const u = ["left", "right"], l = ["right", "left"], P = ["top", "bottom"], y = ["bottom", "top"];
|
|
49
|
-
function O(t, n, e) {
|
|
50
|
-
switch (t) {
|
|
51
|
-
case "top":
|
|
52
|
-
case "bottom":
|
|
53
|
-
return e ? n ? l : u : n ? u : l;
|
|
54
|
-
case "left":
|
|
55
|
-
case "right":
|
|
56
|
-
return n ? P : y;
|
|
57
|
-
default:
|
|
58
|
-
return [];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function k(t, n, e, r) {
|
|
62
|
-
const i = a(t);
|
|
63
|
-
let o = O(g(t), e === "start", r);
|
|
64
|
-
return i && (o = o.map((c) => c + "-" + i), n && (o = o.concat(o.map(s)))), o;
|
|
65
|
-
}
|
|
66
|
-
function f(t) {
|
|
67
|
-
const n = g(t);
|
|
68
|
-
return p[n] + t.slice(n.length);
|
|
69
|
-
}
|
|
70
|
-
function M(t) {
|
|
71
|
-
return {
|
|
72
|
-
top: 0,
|
|
73
|
-
right: 0,
|
|
74
|
-
bottom: 0,
|
|
75
|
-
left: 0,
|
|
76
|
-
...t
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function q(t) {
|
|
80
|
-
return typeof t != "number" ? M(t) : {
|
|
81
|
-
top: t,
|
|
82
|
-
right: t,
|
|
83
|
-
bottom: t,
|
|
84
|
-
left: t
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function z(t) {
|
|
88
|
-
const {
|
|
89
|
-
x: n,
|
|
90
|
-
y: e,
|
|
91
|
-
width: r,
|
|
92
|
-
height: i
|
|
93
|
-
} = t;
|
|
94
|
-
return {
|
|
95
|
-
width: r,
|
|
96
|
-
height: i,
|
|
97
|
-
top: e,
|
|
98
|
-
left: n,
|
|
99
|
-
right: n + r,
|
|
100
|
-
bottom: e + i,
|
|
101
|
-
x: n,
|
|
102
|
-
y: e
|
|
103
|
-
};
|
|
1
|
+
import { CalendarDay as F } from "./index254.js";
|
|
2
|
+
import { CalendarWeek as N } from "./index256.js";
|
|
3
|
+
import { CalendarMonth as P } from "./index255.js";
|
|
4
|
+
function j(l, f, e, c) {
|
|
5
|
+
const { addDays: y, endOfBroadcastWeek: D, endOfISOWeek: h, endOfMonth: k, endOfWeek: C, getISOWeek: I, getWeek: M, startOfBroadcastWeek: S, startOfISOWeek: g, startOfWeek: w } = c, o = l.reduce((W, t) => {
|
|
6
|
+
const x = e.broadcastCalendar ? S(t, c) : e.ISOWeek ? g(t) : w(t), d = e.broadcastCalendar ? D(t) : e.ISOWeek ? h(k(t)) : C(k(t)), a = f.filter((r) => r >= x && r <= d), O = e.broadcastCalendar ? 35 : 42;
|
|
7
|
+
if (e.fixedWeeks && a.length < O) {
|
|
8
|
+
const r = f.filter((n) => {
|
|
9
|
+
const s = O - a.length;
|
|
10
|
+
return n > d && n <= y(d, s);
|
|
11
|
+
});
|
|
12
|
+
a.push(...r);
|
|
13
|
+
}
|
|
14
|
+
const b = a.reduce((r, n) => {
|
|
15
|
+
const s = e.ISOWeek ? I(n) : M(n), i = r.find((B) => B.weekNumber === s), u = new F(n, t, c);
|
|
16
|
+
return i ? i.days.push(u) : r.push(new N(s, [u])), r;
|
|
17
|
+
}, []), v = new P(t, b);
|
|
18
|
+
return W.push(v), W;
|
|
19
|
+
}, []);
|
|
20
|
+
return e.reverseMonths ? o.reverse() : o;
|
|
104
21
|
}
|
|
105
22
|
export {
|
|
106
|
-
|
|
107
|
-
j as createCoords,
|
|
108
|
-
E as evaluate,
|
|
109
|
-
M as expandPaddingObject,
|
|
110
|
-
C as floor,
|
|
111
|
-
a as getAlignment,
|
|
112
|
-
A as getAlignmentAxis,
|
|
113
|
-
R as getAlignmentSides,
|
|
114
|
-
b as getAxisLength,
|
|
115
|
-
T as getExpandedPlacements,
|
|
116
|
-
s as getOppositeAlignmentPlacement,
|
|
117
|
-
x as getOppositeAxis,
|
|
118
|
-
k as getOppositeAxisPlacements,
|
|
119
|
-
f as getOppositePlacement,
|
|
120
|
-
q as getPaddingObject,
|
|
121
|
-
g as getSide,
|
|
122
|
-
d as getSideAxis,
|
|
123
|
-
h as max,
|
|
124
|
-
m as min,
|
|
125
|
-
z as rectToClientRect,
|
|
126
|
-
w as round,
|
|
127
|
-
S as sides
|
|
23
|
+
j as getMonths
|
|
128
24
|
};
|
|
129
25
|
//# sourceMappingURL=index299.js.map
|
package/dist/index299.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index299.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index299.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getMonths.js"],"sourcesContent":["import { CalendarDay, CalendarMonth, CalendarWeek } from \"../classes/index.js\";\n/**\n * Returns the months to display in the calendar.\n *\n * This function generates `CalendarMonth` objects for each month to be\n * displayed, including their weeks and days, based on the provided display\n * months and dates.\n *\n * @param displayMonths The months (as dates) to display in the calendar.\n * @param dates The dates to display in the calendar.\n * @param props Options from the DayPicker props context.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of `CalendarMonth` objects representing the months to\n * display.\n */\nexport function getMonths(displayMonths, dates, props, dateLib) {\n const { addDays, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, getISOWeek, getWeek, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;\n const dayPickerMonths = displayMonths.reduce((months, month) => {\n const firstDateOfFirstWeek = props.broadcastCalendar\n ? startOfBroadcastWeek(month, dateLib)\n : props.ISOWeek\n ? startOfISOWeek(month)\n : startOfWeek(month);\n const lastDateOfLastWeek = props.broadcastCalendar\n ? endOfBroadcastWeek(month)\n : props.ISOWeek\n ? endOfISOWeek(endOfMonth(month))\n : endOfWeek(endOfMonth(month));\n /** The dates to display in the month. */\n const monthDates = dates.filter((date) => {\n return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;\n });\n const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;\n if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {\n const extraDates = dates.filter((date) => {\n const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;\n return (date > lastDateOfLastWeek &&\n date <= addDays(lastDateOfLastWeek, daysToAdd));\n });\n monthDates.push(...extraDates);\n }\n const weeks = monthDates.reduce((weeks, date) => {\n const weekNumber = props.ISOWeek ? getISOWeek(date) : getWeek(date);\n const week = weeks.find((week) => week.weekNumber === weekNumber);\n const day = new CalendarDay(date, month, dateLib);\n if (!week) {\n weeks.push(new CalendarWeek(weekNumber, [day]));\n }\n else {\n week.days.push(day);\n }\n return weeks;\n }, []);\n const dayPickerMonth = new CalendarMonth(month, weeks);\n months.push(dayPickerMonth);\n return months;\n }, []);\n if (!props.reverseMonths) {\n return dayPickerMonths;\n }\n else {\n return dayPickerMonths.reverse();\n }\n}\n"],"names":["getMonths","displayMonths","dates","props","dateLib","addDays","endOfBroadcastWeek","endOfISOWeek","endOfMonth","endOfWeek","getISOWeek","getWeek","startOfBroadcastWeek","startOfISOWeek","startOfWeek","dayPickerMonths","months","month","firstDateOfFirstWeek","lastDateOfLastWeek","monthDates","date","nrOfDaysWithFixedWeeks","extraDates","daysToAdd","weeks","weekNumber","week","day","CalendarDay","CalendarWeek","dayPickerMonth","CalendarMonth"],"mappings":";;;AAeO,SAASA,EAAUC,GAAeC,GAAOC,GAAOC,GAAS;AAC5D,QAAM,EAAE,SAAAC,GAAS,oBAAAC,GAAoB,cAAAC,GAAc,YAAAC,GAAY,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,sBAAAC,GAAsB,gBAAAC,GAAgB,aAAAC,EAAW,IAAMV,GAChJW,IAAkBd,EAAc,OAAO,CAACe,GAAQC,MAAU;AAC5D,UAAMC,IAAuBf,EAAM,oBAC7BS,EAAqBK,GAAOb,CAAO,IACnCD,EAAM,UACFU,EAAeI,CAAK,IACpBH,EAAYG,CAAK,GACrBE,IAAqBhB,EAAM,oBAC3BG,EAAmBW,CAAK,IACxBd,EAAM,UACFI,EAAaC,EAAWS,CAAK,CAAC,IAC9BR,EAAUD,EAAWS,CAAK,CAAC,GAE/BG,IAAalB,EAAM,OAAO,CAACmB,MACtBA,KAAQH,KAAwBG,KAAQF,CAClD,GACKG,IAAyBnB,EAAM,oBAAoB,KAAK;AAC9D,QAAIA,EAAM,cAAciB,EAAW,SAASE,GAAwB;AAChE,YAAMC,IAAarB,EAAM,OAAO,CAACmB,MAAS;AACtC,cAAMG,IAAYF,IAAyBF,EAAW;AACtD,eAAQC,IAAOF,KACXE,KAAQhB,EAAQc,GAAoBK,CAAS;AAAA,MACrD,CAAC;AACD,MAAAJ,EAAW,KAAK,GAAGG,CAAU;AAAA,IACjC;AACA,UAAME,IAAQL,EAAW,OAAO,CAACK,GAAOJ,MAAS;AAC7C,YAAMK,IAAavB,EAAM,UAAUO,EAAWW,CAAI,IAAIV,EAAQU,CAAI,GAC5DM,IAAOF,EAAM,KAAK,CAACE,MAASA,EAAK,eAAeD,CAAU,GAC1DE,IAAM,IAAIC,EAAYR,GAAMJ,GAAOb,CAAO;AAChD,aAAKuB,IAIDA,EAAK,KAAK,KAAKC,CAAG,IAHlBH,EAAM,KAAK,IAAIK,EAAaJ,GAAY,CAACE,CAAG,CAAC,CAAC,GAK3CH;AAAA,IACX,GAAG,CAAA,CAAE,GACCM,IAAiB,IAAIC,EAAcf,GAAOQ,CAAK;AACrD,WAAAT,EAAO,KAAKe,CAAc,GACnBf;AAAA,EACX,GAAG,CAAA,CAAE;AACL,SAAKb,EAAM,gBAIAY,EAAgB,QAAO,IAHvBA;AAKf;","x_google_ignoreList":[0]}
|
package/dist/index3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.js","sources":["../src/components/AddressAutocompleteInput/index.tsx"],"sourcesContent":["import { ReactNode, ChangeEvent, KeyboardEvent, useState, useEffect, useRef, useMemo } from \"react\"\nimport clsx from \"clsx\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { useMapsLibrary } from \"@/helpers/useMapsLibrary\"\nimport { Input } from \"@/components/Input\"\nimport { cn } from \"@/lib/utils\"\n\n\nconst DEFAULT_ALLOWED_TYPES = new Set([\n \"street_address\",\n \"route\",\n \"premise\",\n \"subpremise\",\n \"intersection\",\n \"sublocality\",\n \"sublocality_level_1\",\n \"sublocality_level_2\",\n \"sublocality_level_3\",\n \"sublocality_level_4\",\n \"sublocality_level_5\",\n \"administrative_area_level_1\",\n \"administrative_area_level_2\",\n \"administrative_area_level_3\",\n \"administrative_area_level_4\",\n \"administrative_area_level_5\",\n \"administrative_area_level_6\",\n \"administrative_area_level_7\",\n \"postal_code\",\n \"locality\",\n \"country\",\n \"geocode\",\n \"plus_code\",\n \"political\",\n \"neighborhood\",\n \"colloquial_area\",\n \"lodging\",\n \"train_station\",\n \"transit_station\",\n])\n\nconst getDisplayText = (prediction: google.maps.places.PlacePrediction) => {\n const fullText = prediction.text?.text ?? \"\"\n return fullText.replace(/, France$/, \"\").trim()\n}\n\nconst PredictionItem = ({ prediction }: { prediction: google.maps.places.PlacePrediction }) => {\n const displayText = getDisplayText(prediction)\n const fullText = prediction.text?.text ?? \"\"\n const matches = prediction.text?.matches ?? []\n const wasCountryRemoved = displayText.length < fullText.length\n\n if (matches.length === 0) {\n return <>{displayText}</>\n }\n\n const parts: ReactNode[] = []\n let lastIndex = 0\n\n matches.forEach((substring, index) => {\n if (wasCountryRemoved && substring.startOffset >= displayText.length) {\n return\n }\n\n const startOffset = substring.startOffset\n const endOffset = Math.min(substring.endOffset, displayText.length)\n\n if (startOffset > lastIndex) {\n parts.push(displayText.substring(lastIndex, startOffset))\n }\n\n if (endOffset > startOffset) {\n const matched = displayText.substring(startOffset, endOffset)\n parts.push(<strong key={index}>{matched}</strong>)\n }\n\n lastIndex = Math.max(lastIndex, endOffset)\n })\n\n if (lastIndex < displayText.length) {\n parts.push(displayText.substring(lastIndex))\n }\n\n if (parts.length === 0) {\n return <>{displayText}</>\n }\n\n return <>{parts}</>\n}\n\nconst isAllowedPrediction = (\n prediction: google.maps.places.PlacePrediction,\n allowedTypes: ReadonlySet<string> | null,\n) => {\n if (!prediction.types || prediction.types.length === 0) {\n return true\n }\n\n if (!allowedTypes || allowedTypes.size === 0) {\n return true\n }\n\n return prediction.types.some(type => allowedTypes.has(type))\n}\n\nconst getPredictionId = (prediction: google.maps.places.PlacePrediction, index: number) =>\n prediction.placeId || `${prediction.text?.text ?? \"prediction\"}-${index}`\n\nconst getUniquePredictions = (predictions: google.maps.places.PlacePrediction[]) => {\n const map = new Map<string, google.maps.places.PlacePrediction>()\n\n predictions.forEach(prediction => {\n const key = prediction.placeId\n\n if (!key) {\n return\n }\n\n if (!map.has(key)) {\n map.set(key, prediction)\n }\n })\n\n return Array.from(map.values())\n}\n\nconst getFilteredPredictions = (\n predictions: google.maps.places.PlacePrediction[],\n allowedTypes: ReadonlySet<string> | null,\n) => predictions.filter(prediction => isAllowedPrediction(prediction, allowedTypes))\n\nconst sortPredictions = (predictions: google.maps.places.PlacePrediction[]) =>\n predictions.sort((a, b) => {\n const aDistance = a.distanceMeters ?? Number.POSITIVE_INFINITY\n const bDistance = b.distanceMeters ?? Number.POSITIVE_INFINITY\n\n return aDistance - bDistance\n })\n\nconst buildDisplayPredictions = (\n predictions: google.maps.places.PlacePrediction[],\n allowedTypes: ReadonlySet<string> | null,\n) => sortPredictions(getFilteredPredictions(getUniquePredictions(predictions), allowedTypes))\n\nconst isExactMatch = (prediction: google.maps.places.PlacePrediction, value: string) => {\n const display = getDisplayText(prediction)\n return display.toLowerCase() === value.trim().toLowerCase()\n}\n\nexport const AddressAutocompleteInput = ({\n id,\n label,\n placeholder,\n value,\n onValueChange,\n disabled,\n name,\n className,\n autofillShimName,\n googleMapsApiKey,\n locationRestriction,\n allowedTypes,\n}: {\n id: string\n label: string\n placeholder: string\n value: string | undefined\n onValueChange: (value: string) => void\n disabled?: boolean\n name?: string\n className?: string\n autofillShimName?: string\n googleMapsApiKey?: string\n locationRestriction?: google.maps.LatLngBoundsLiteral | google.maps.LatLngBounds\n allowedTypes?: Iterable<string>\n}) => {\n const [inputValue, setInputValue] = useState(value ?? \"\")\n const [predictions, setPredictions] = useState<google.maps.places.PlacePrediction[]>([])\n const [isDropdownOpen, setIsDropdownOpen] = useState(false)\n const [highlightedIndex, setHighlightedIndex] = useState(-1)\n const [isLoading, setIsLoading] = useState(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n const dropdownRef = useRef<HTMLUListElement>(null)\n const isSelecting = useRef(false)\n const hasUserTyped = useRef(false)\n const sessionTokenRef = useRef<google.maps.places.AutocompleteSessionToken | null>(null)\n const optionRefs = useRef<(HTMLLIElement | null)[]>([])\n const scrollBehaviorRef = useRef<ScrollBehavior>(\"smooth\")\n const placesLibrary = useMapsLibrary(\"places\", googleMapsApiKey)\n const allowedTypesSet = useMemo(() => {\n if (!allowedTypes) {\n return DEFAULT_ALLOWED_TYPES\n }\n\n const newSet = new Set<string>()\n for (const type of allowedTypes) {\n newSet.add(type)\n }\n return newSet\n }, [allowedTypes])\n\n useEffect(() => {\n setInputValue(value ?? \"\")\n hasUserTyped.current = false\n }, [value])\n\n useEffect(() => {\n if (isSelecting.current) {\n isSelecting.current = false\n return\n }\n\n const trimmed = inputValue.trim()\n\n if (trimmed === \"\") {\n setIsLoading(false)\n } else {\n setIsLoading(true)\n }\n\n let isActive = true\n\n const handler = setTimeout(() => {\n if (!isActive) {\n return\n }\n\n if (trimmed === \"\") {\n setPredictions([])\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n if (value !== \"\") {\n onValueChange(\"\")\n }\n return\n }\n\n if (!placesLibrary) return\n\n const { AutocompleteSuggestion, AutocompleteSessionToken } = placesLibrary\n\n if (!AutocompleteSuggestion || !AutocompleteSessionToken) {\n console.error(\"AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports\")\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n return\n }\n\n if (!sessionTokenRef.current) {\n sessionTokenRef.current = new AutocompleteSessionToken()\n }\n\n const request: google.maps.places.AutocompleteRequest = {\n input: inputValue,\n sessionToken: sessionTokenRef.current ?? undefined,\n includedRegionCodes: [\"fr\"],\n }\n if (locationRestriction) {\n request.locationRestriction = locationRestriction\n }\n\n AutocompleteSuggestion.fetchAutocompleteSuggestions(request)\n .then((response: { suggestions: google.maps.places.AutocompleteSuggestion[] }) => {\n if (!isActive) {\n return\n }\n\n const placePredictions = response.suggestions\n .map((suggestion: google.maps.places.AutocompleteSuggestion) => suggestion.placePrediction)\n .filter((prediction): prediction is google.maps.places.PlacePrediction => Boolean(prediction))\n\n const combinedPredictions = buildDisplayPredictions(placePredictions, allowedTypesSet)\n\n const singlePrediction = combinedPredictions[0]\n const hasExactMatch =\n singlePrediction && combinedPredictions.length === 1 && isExactMatch(singlePrediction, inputValue)\n\n if (!hasUserTyped.current && hasExactMatch) {\n setPredictions(combinedPredictions)\n setIsDropdownOpen(false)\n setIsLoading(false)\n return\n }\n\n if (combinedPredictions.length > 0) {\n setPredictions(combinedPredictions)\n if (hasUserTyped.current) {\n setIsDropdownOpen(true)\n }\n setHighlightedIndex(-1)\n } else {\n setPredictions([])\n setIsDropdownOpen(false)\n }\n setIsLoading(false)\n })\n .catch((error: unknown) => {\n if (!isActive) {\n return\n }\n console.error(\"AddressAutocompleteInput: suggestion fetch failed\", error)\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n })\n }, 300)\n\n return () => {\n isActive = false\n clearTimeout(handler)\n }\n }, [inputValue, placesLibrary, onValueChange, value, locationRestriction, allowedTypesSet])\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n inputRef.current &&\n !inputRef.current.contains(event.target as Node) &&\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setIsDropdownOpen(false)\n }\n }\n document.addEventListener(\"mousedown\", handleClickOutside)\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside)\n }\n }, [])\n\n const handleSelectPrediction = (prediction: google.maps.places.PlacePrediction) => {\n isSelecting.current = true\n const newAddress = getDisplayText(prediction)\n setInputValue(newAddress)\n onValueChange(newAddress)\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n sessionTokenRef.current = null\n }\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n hasUserTyped.current = true\n setInputValue(e.target.value)\n }\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (!isDropdownOpen || predictions.length === 0) {\n if (e.key === \"Enter\") {\n e.preventDefault()\n onValueChange(inputValue)\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n }\n return\n }\n\n if (e.key === \"ArrowDown\") {\n scrollBehaviorRef.current = e.repeat ? \"auto\" : \"smooth\"\n e.preventDefault()\n setHighlightedIndex(prev => {\n if (predictions.length === 0) {\n return -1\n }\n return prev < 0 ? 0 : (prev + 1) % predictions.length\n })\n } else if (e.key === \"ArrowUp\") {\n scrollBehaviorRef.current = e.repeat ? \"auto\" : \"smooth\"\n e.preventDefault()\n setHighlightedIndex(prev => {\n if (predictions.length === 0) {\n return -1\n }\n if (prev <= 0) {\n return predictions.length - 1\n }\n return (prev - 1) % predictions.length\n })\n } else if (e.key === \"Enter\") {\n e.preventDefault()\n if (highlightedIndex > -1 && predictions[highlightedIndex]) {\n handleSelectPrediction(predictions[highlightedIndex])\n } else {\n onValueChange(inputValue)\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n }\n } else if (e.key === \"Escape\") {\n setIsDropdownOpen(false)\n }\n }\n\n const handleBlur = () => {\n setIsDropdownOpen(false)\n if (value !== inputValue) {\n onValueChange(inputValue)\n }\n sessionTokenRef.current = null\n }\n\n const shimName = autofillShimName ?? (name ? `${name}_shim` : undefined)\n\n useEffect(() => {\n if (!isDropdownOpen || highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n return\n }\n\n const item = optionRefs.current[highlightedIndex]\n const list = dropdownRef.current\n\n if (!item || !list) {\n scrollBehaviorRef.current = \"smooth\"\n return\n }\n\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n\n const top = item.offsetTop\n const bottom = top + item.offsetHeight\n const viewTop = list.scrollTop\n const viewBottom = viewTop + list.clientHeight\n\n if (top >= viewTop && bottom <= viewBottom) {\n return\n }\n\n item.scrollIntoView({\n block: \"nearest\",\n behavior,\n })\n }, [highlightedIndex, isDropdownOpen])\n\n optionRefs.current.length = predictions.length\n\n return (\n <div className=\"relative\">\n {shimName && (\n <input\n tabIndex={-1}\n autoComplete=\"street-address\"\n name={shimName}\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n left: \"-9999px\",\n top: \"-9999px\",\n height: \"1px\",\n width: \"1px\",\n }}\n />\n )}\n <label htmlFor={id} className=\"text-left block text-sm font-medium text-gray-700 mb-1 cursor-pointer\">\n {label}\n </label>\n <div className=\"relative\">\n <Input\n ref={inputRef}\n id={id}\n type=\"text\"\n placeholder={placeholder}\n name={name ?? `${id}_input`}\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={() => {\n if (predictions.length > 0 && inputValue) {\n setIsDropdownOpen(true)\n }\n }}\n onBlur={handleBlur}\n disabled={disabled}\n autoComplete=\"new-password\"\n className={cn(\"w-full\", isLoading && \"pr-9\", className)}\n />\n {isLoading && (\n <Loader2\n className=\"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-gray-400\"\n aria-hidden=\"true\"\n />\n )}\n </div>\n {isDropdownOpen && predictions.length > 0 && (\n <ul\n ref={dropdownRef}\n className=\"absolute z-10 mt-1 w-full max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white text-left shadow-lg\"\n role=\"listbox\"\n >\n {predictions.map((prediction, index) => (\n <li\n key={getPredictionId(prediction, index)}\n ref={node => {\n optionRefs.current[index] = node\n }}\n className={clsx(\n \"cursor-pointer px-3 py-2 text-sm text-gray-700 hover:bg-gray-100\",\n { \"bg-gray-100\": highlightedIndex === index },\n )}\n role=\"option\"\n onMouseDown={e => {\n e.preventDefault()\n handleSelectPrediction(prediction)\n }}\n >\n <PredictionItem prediction={prediction} />\n </li>\n ))}\n </ul>\n )}\n </div>\n )\n}\n"],"names":["DEFAULT_ALLOWED_TYPES","Set","getDisplayText","prediction","text","replace","trim","PredictionItem","t0","$","_c","displayText","parts","t1","Symbol","for","bb0","fullText","matches","wasCountryRemoved","length","lastIndex","forEach","substring","index","startOffset","endOffset","Math","min","push","matched","jsx","max","t2","isAllowedPrediction","allowedTypes","types","size","some","type","has","getPredictionId","placeId","getUniquePredictions","predictions","map","Map","key","set","Array","from","values","getFilteredPredictions","filter","sortPredictions","sort","a","b","aDistance","distanceMeters","Number","POSITIVE_INFINITY","bDistance","buildDisplayPredictions","isExactMatch","value","toLowerCase","AddressAutocompleteInput","id","label","placeholder","onValueChange","disabled","name","className","autofillShimName","googleMapsApiKey","locationRestriction","inputValue","setInputValue","useState","setPredictions","isDropdownOpen","setIsDropdownOpen","highlightedIndex","setHighlightedIndex","isLoading","setIsLoading","inputRef","useRef","dropdownRef","isSelecting","hasUserTyped","sessionTokenRef","optionRefs","scrollBehaviorRef","placesLibrary","useMapsLibrary","allowedTypesSet","useMemo","newSet","add","useEffect","current","trimmed","isActive","handler","setTimeout","AutocompleteSuggestion","AutocompleteSessionToken","console","error","request","input","sessionToken","undefined","includedRegionCodes","fetchAutocompleteSuggestions","then","response","placePredictions","suggestions","suggestion","placePrediction","Boolean","combinedPredictions","singlePrediction","hasExactMatch","catch","clearTimeout","handleClickOutside","event","contains","target","document","addEventListener","removeEventListener","handleSelectPrediction","newAddress","handleInputChange","e","handleKeyDown","preventDefault","repeat","prev","handleBlur","shimName","item","list","behavior","top","offsetTop","bottom","offsetHeight","viewTop","scrollTop","viewBottom","clientHeight","scrollIntoView","block","jsxs","position","left","height","width","Input","cn","Loader2","node","clsx"],"mappings":";;;;;;;;AASA,MAAMA,KAAwB,oBAAIC,IAAI,CACpC,kBACA,SACA,WACA,cACA,gBACA,eACA,uBACA,uBACA,uBACA,uBACA,uBACA,+BACA,+BACA,+BACA,+BACA,+BACA,+BACA,+BACA,eACA,YACA,WACA,WACA,aACA,aACA,gBACA,mBACA,WACA,iBACA,iBAAiB,CAClB,GAEKC,IAAiBA,CAACC,OACLA,EAAWC,MAAMA,QAAQ,IAC1BC,QAAQ,aAAa,EAAE,EAAEC,KAAAA,GAGrCC,KAAiBC,CAAAA,MAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,CAAA,GAAC;AAAA,IAAAP,YAAAA;AAAAA,EAAAA,IAAAK;AAAkE,MAAAG,GAAAC,GAAAC;AAAA,MAAAJ,SAAAN,GAAA;AAO/EU,IAAAA,IAAAC,uBAAkBC,IAAlB,6BAAiB;AAACC,IA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E,GACA,cAAa,gBACb,WAAW8F,GAAG,UAAUhF,KAAa,QAAQZ,CAAS,EAAA,CAAE;AAAA,MAEzDY,KACCvD,gBAAAA,EAAAA,IAACwI,IAAA,EACC,WAAU,oGACV,eAAY,OAAA,CAAM;AAAA,IAAA,GAGxB;AAAA,IACCrF,KAAkBtC,EAAYxB,SAAS,2BACrC,MAAA,EACC,KAAKsE,GACL,WAAU,qHACV,MAAK,WAEJ9C,UAAAA,EAAYC,IAAI,CAAC1C,GAAYqB,MAC5BO,gBAAAA,EAAAA,IAAC,MAAA,EAEC,KAAKyI,CAAAA,MAAQ;AACX1E,MAAAA,EAAWS,QAAQ/E,CAAK,IAAIgJ;AAAAA,IAC9B,GACA,WAAWC,GACT,oEACA;AAAA,MAAE,eAAerF,MAAqB5D;AAAAA,IAAAA,CACxC,GACA,MAAK,UACL,aAAaoH,CAAAA,MAAK;AAChBA,MAAAA,EAAEE,eAAAA,GACFL,EAAuBtI,CAAU;AAAA,IACnC,GAEA,UAAA4B,gBAAAA,EAAAA,IAACxB,IAAA,EAAe,YAAYJ,GAAW,EAAA,GAdlCsC,GAAgBtC,GAAYqB,CAAK,CAexC,CACD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index3.js","sources":["../src/components/AddressAutocompleteInput/index.tsx"],"sourcesContent":["/// <reference types=\"google.maps\" />\n\nimport { ReactNode, ChangeEvent, KeyboardEvent, useState, useEffect, useRef, useMemo } from \"react\"\nimport clsx from \"clsx\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { useMapsLibrary } from \"@/helpers/useMapsLibrary\"\nimport { Input } from \"@/components/Input\"\nimport { cn } from \"@/lib/utils\"\n\n\nconst DEFAULT_ALLOWED_TYPES = new Set([\n \"street_address\",\n \"route\",\n \"premise\",\n \"subpremise\",\n \"intersection\",\n \"sublocality\",\n \"sublocality_level_1\",\n \"sublocality_level_2\",\n \"sublocality_level_3\",\n \"sublocality_level_4\",\n \"sublocality_level_5\",\n \"administrative_area_level_1\",\n \"administrative_area_level_2\",\n \"administrative_area_level_3\",\n \"administrative_area_level_4\",\n \"administrative_area_level_5\",\n \"administrative_area_level_6\",\n \"administrative_area_level_7\",\n \"postal_code\",\n \"locality\",\n \"country\",\n \"geocode\",\n \"plus_code\",\n \"political\",\n \"neighborhood\",\n \"colloquial_area\",\n \"lodging\",\n \"train_station\",\n \"transit_station\",\n])\n\nconst getDisplayText = (prediction: google.maps.places.PlacePrediction) => {\n const fullText = prediction.text?.text ?? \"\"\n return fullText.replace(/, France$/, \"\").trim()\n}\n\nconst PredictionItem = ({ prediction }: { prediction: google.maps.places.PlacePrediction }) => {\n const displayText = getDisplayText(prediction)\n const fullText = prediction.text?.text ?? \"\"\n const matches = prediction.text?.matches ?? []\n const wasCountryRemoved = displayText.length < fullText.length\n\n if (matches.length === 0) {\n return <>{displayText}</>\n }\n\n const parts: ReactNode[] = []\n let lastIndex = 0\n\n matches.forEach((substring, index) => {\n if (wasCountryRemoved && substring.startOffset >= displayText.length) {\n return\n }\n\n const startOffset = substring.startOffset\n const endOffset = Math.min(substring.endOffset, displayText.length)\n\n if (startOffset > lastIndex) {\n parts.push(displayText.substring(lastIndex, startOffset))\n }\n\n if (endOffset > startOffset) {\n const matched = displayText.substring(startOffset, endOffset)\n parts.push(<strong key={index}>{matched}</strong>)\n }\n\n lastIndex = Math.max(lastIndex, endOffset)\n })\n\n if (lastIndex < displayText.length) {\n parts.push(displayText.substring(lastIndex))\n }\n\n if (parts.length === 0) {\n return <>{displayText}</>\n }\n\n return <>{parts}</>\n}\n\nconst isAllowedPrediction = (\n prediction: google.maps.places.PlacePrediction,\n allowedTypes: ReadonlySet<string> | null,\n) => {\n if (!prediction.types || prediction.types.length === 0) {\n return true\n }\n\n if (!allowedTypes || allowedTypes.size === 0) {\n return true\n }\n\n return prediction.types.some(type => allowedTypes.has(type))\n}\n\nconst getPredictionId = (prediction: google.maps.places.PlacePrediction, index: number) =>\n prediction.placeId || `${prediction.text?.text ?? \"prediction\"}-${index}`\n\nconst getUniquePredictions = (predictions: google.maps.places.PlacePrediction[]) => {\n const map = new Map<string, google.maps.places.PlacePrediction>()\n\n predictions.forEach(prediction => {\n const key = prediction.placeId\n\n if (!key) {\n return\n }\n\n if (!map.has(key)) {\n map.set(key, prediction)\n }\n })\n\n return Array.from(map.values())\n}\n\nconst getFilteredPredictions = (\n predictions: google.maps.places.PlacePrediction[],\n allowedTypes: ReadonlySet<string> | null,\n) => predictions.filter(prediction => isAllowedPrediction(prediction, allowedTypes))\n\nconst sortPredictions = (predictions: google.maps.places.PlacePrediction[]) =>\n predictions.sort((a, b) => {\n const aDistance = a.distanceMeters ?? Number.POSITIVE_INFINITY\n const bDistance = b.distanceMeters ?? Number.POSITIVE_INFINITY\n\n return aDistance - bDistance\n })\n\nconst buildDisplayPredictions = (\n predictions: google.maps.places.PlacePrediction[],\n allowedTypes: ReadonlySet<string> | null,\n) => sortPredictions(getFilteredPredictions(getUniquePredictions(predictions), allowedTypes))\n\nconst isExactMatch = (prediction: google.maps.places.PlacePrediction, value: string) => {\n const display = getDisplayText(prediction)\n return display.toLowerCase() === value.trim().toLowerCase()\n}\n\nexport const AddressAutocompleteInput = ({\n id,\n label,\n placeholder,\n value,\n onValueChange,\n disabled,\n name,\n className,\n autofillShimName,\n googleMapsApiKey,\n locationRestriction,\n allowedTypes,\n}: {\n id: string\n label: string\n placeholder: string\n value: string | undefined\n onValueChange: (value: string) => void\n disabled?: boolean\n name?: string\n className?: string\n autofillShimName?: string\n googleMapsApiKey?: string\n locationRestriction?: google.maps.LatLngBoundsLiteral | google.maps.LatLngBounds\n allowedTypes?: Iterable<string>\n}) => {\n const [inputValue, setInputValue] = useState(value ?? \"\")\n const [predictions, setPredictions] = useState<google.maps.places.PlacePrediction[]>([])\n const [isDropdownOpen, setIsDropdownOpen] = useState(false)\n const [highlightedIndex, setHighlightedIndex] = useState(-1)\n const [isLoading, setIsLoading] = useState(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n const dropdownRef = useRef<HTMLUListElement>(null)\n const isSelecting = useRef(false)\n const hasUserTyped = useRef(false)\n const sessionTokenRef = useRef<google.maps.places.AutocompleteSessionToken | null>(null)\n const optionRefs = useRef<(HTMLLIElement | null)[]>([])\n const scrollBehaviorRef = useRef<ScrollBehavior>(\"smooth\")\n const placesLibrary = useMapsLibrary(\"places\", googleMapsApiKey)\n const allowedTypesSet = useMemo(() => {\n if (!allowedTypes) {\n return DEFAULT_ALLOWED_TYPES\n }\n\n const newSet = new Set<string>()\n for (const type of allowedTypes) {\n newSet.add(type)\n }\n return newSet\n }, [allowedTypes])\n\n useEffect(() => {\n setInputValue(value ?? \"\")\n hasUserTyped.current = false\n }, [value])\n\n useEffect(() => {\n if (isSelecting.current) {\n isSelecting.current = false\n return\n }\n\n const trimmed = inputValue.trim()\n\n if (trimmed === \"\") {\n setIsLoading(false)\n } else {\n setIsLoading(true)\n }\n\n let isActive = true\n\n const handler = setTimeout(() => {\n if (!isActive) {\n return\n }\n\n if (trimmed === \"\") {\n setPredictions([])\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n if (value !== \"\") {\n onValueChange(\"\")\n }\n return\n }\n\n if (!placesLibrary) return\n\n const { AutocompleteSuggestion, AutocompleteSessionToken } = placesLibrary\n\n if (!AutocompleteSuggestion || !AutocompleteSessionToken) {\n console.error(\"AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports\")\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n return\n }\n\n if (!sessionTokenRef.current) {\n sessionTokenRef.current = new AutocompleteSessionToken()\n }\n\n const request: google.maps.places.AutocompleteRequest = {\n input: inputValue,\n sessionToken: sessionTokenRef.current ?? undefined,\n includedRegionCodes: [\"fr\"],\n }\n if (locationRestriction) {\n request.locationRestriction = locationRestriction\n }\n\n AutocompleteSuggestion.fetchAutocompleteSuggestions(request)\n .then((response: { suggestions: google.maps.places.AutocompleteSuggestion[] }) => {\n if (!isActive) {\n return\n }\n\n const placePredictions = response.suggestions\n .map((suggestion: google.maps.places.AutocompleteSuggestion) => suggestion.placePrediction)\n .filter((prediction): prediction is google.maps.places.PlacePrediction => Boolean(prediction))\n\n const combinedPredictions = buildDisplayPredictions(placePredictions, allowedTypesSet)\n\n const singlePrediction = combinedPredictions[0]\n const hasExactMatch =\n singlePrediction && combinedPredictions.length === 1 && isExactMatch(singlePrediction, inputValue)\n\n if (!hasUserTyped.current && hasExactMatch) {\n setPredictions(combinedPredictions)\n setIsDropdownOpen(false)\n setIsLoading(false)\n return\n }\n\n if (combinedPredictions.length > 0) {\n setPredictions(combinedPredictions)\n if (hasUserTyped.current) {\n setIsDropdownOpen(true)\n }\n setHighlightedIndex(-1)\n } else {\n setPredictions([])\n setIsDropdownOpen(false)\n }\n setIsLoading(false)\n })\n .catch((error: unknown) => {\n if (!isActive) {\n return\n }\n console.error(\"AddressAutocompleteInput: suggestion fetch failed\", error)\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n })\n }, 300)\n\n return () => {\n isActive = false\n clearTimeout(handler)\n }\n }, [inputValue, placesLibrary, onValueChange, value, locationRestriction, allowedTypesSet])\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n inputRef.current &&\n !inputRef.current.contains(event.target as Node) &&\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setIsDropdownOpen(false)\n }\n }\n document.addEventListener(\"mousedown\", handleClickOutside)\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside)\n }\n }, [])\n\n const handleSelectPrediction = (prediction: google.maps.places.PlacePrediction) => {\n isSelecting.current = true\n const newAddress = getDisplayText(prediction)\n setInputValue(newAddress)\n onValueChange(newAddress)\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n sessionTokenRef.current = null\n }\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n hasUserTyped.current = true\n setInputValue(e.target.value)\n }\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (!isDropdownOpen || predictions.length === 0) {\n if (e.key === \"Enter\") {\n e.preventDefault()\n onValueChange(inputValue)\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n }\n return\n }\n\n if (e.key === \"ArrowDown\") {\n scrollBehaviorRef.current = e.repeat ? \"auto\" : \"smooth\"\n e.preventDefault()\n setHighlightedIndex(prev => {\n if (predictions.length === 0) {\n return -1\n }\n return prev < 0 ? 0 : (prev + 1) % predictions.length\n })\n } else if (e.key === \"ArrowUp\") {\n scrollBehaviorRef.current = e.repeat ? \"auto\" : \"smooth\"\n e.preventDefault()\n setHighlightedIndex(prev => {\n if (predictions.length === 0) {\n return -1\n }\n if (prev <= 0) {\n return predictions.length - 1\n }\n return (prev - 1) % predictions.length\n })\n } else if (e.key === \"Enter\") {\n e.preventDefault()\n if (highlightedIndex > -1 && predictions[highlightedIndex]) {\n handleSelectPrediction(predictions[highlightedIndex])\n } else {\n onValueChange(inputValue)\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n }\n } else if (e.key === \"Escape\") {\n setIsDropdownOpen(false)\n }\n }\n\n const handleBlur = () => {\n setIsDropdownOpen(false)\n if (value !== inputValue) {\n onValueChange(inputValue)\n }\n sessionTokenRef.current = null\n }\n\n const shimName = autofillShimName ?? (name ? `${name}_shim` : undefined)\n\n useEffect(() => {\n if (!isDropdownOpen || highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n return\n }\n\n const item = optionRefs.current[highlightedIndex]\n const list = dropdownRef.current\n\n if (!item || !list) {\n scrollBehaviorRef.current = \"smooth\"\n return\n }\n\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n\n const top = item.offsetTop\n const bottom = top + item.offsetHeight\n const viewTop = list.scrollTop\n const viewBottom = viewTop + list.clientHeight\n\n if (top >= viewTop && bottom <= viewBottom) {\n return\n }\n\n item.scrollIntoView({\n block: \"nearest\",\n behavior,\n })\n }, [highlightedIndex, isDropdownOpen])\n\n optionRefs.current.length = predictions.length\n\n return (\n <div className=\"relative\">\n {shimName && (\n <input\n tabIndex={-1}\n autoComplete=\"street-address\"\n name={shimName}\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n left: \"-9999px\",\n top: \"-9999px\",\n height: \"1px\",\n width: \"1px\",\n }}\n />\n )}\n <label htmlFor={id} className=\"text-left block text-sm font-medium text-gray-700 mb-1 cursor-pointer\">\n {label}\n </label>\n <div className=\"relative\">\n <Input\n ref={inputRef}\n id={id}\n type=\"text\"\n placeholder={placeholder}\n name={name ?? `${id}_input`}\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={() => {\n if (predictions.length > 0 && inputValue) {\n setIsDropdownOpen(true)\n }\n }}\n onBlur={handleBlur}\n disabled={disabled}\n autoComplete=\"new-password\"\n className={cn(\"w-full\", isLoading && \"pr-9\", className)}\n />\n {isLoading && (\n <Loader2\n className=\"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-gray-400\"\n aria-hidden=\"true\"\n />\n )}\n </div>\n {isDropdownOpen && predictions.length > 0 && (\n <ul\n ref={dropdownRef}\n className=\"absolute z-10 mt-1 w-full max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white text-left shadow-lg\"\n role=\"listbox\"\n >\n {predictions.map((prediction, index) => (\n <li\n key={getPredictionId(prediction, index)}\n ref={node => {\n optionRefs.current[index] = node\n }}\n className={clsx(\n \"cursor-pointer px-3 py-2 text-sm text-gray-700 hover:bg-gray-100\",\n { \"bg-gray-100\": highlightedIndex === index },\n )}\n role=\"option\"\n onMouseDown={e => {\n e.preventDefault()\n handleSelectPrediction(prediction)\n }}\n >\n <PredictionItem prediction={prediction} />\n </li>\n ))}\n </ul>\n )}\n </div>\n )\n}\n"],"names":["DEFAULT_ALLOWED_TYPES","Set","getDisplayText","prediction","text","replace","trim","PredictionItem","t0","$","_c","displayText","parts","t1","Symbol","for","bb0","fullText","matches","wasCountryRemoved","length","lastIndex","forEach","substring","index","startOffset","endOffset","Math","min","push","matched","jsx","max","t2","isAllowedPrediction","allowedTypes","types","size","some","type","has","getPredictionId","placeId","getUniquePredictions","predictions","map","Map","key","set","Array","from","values","getFilteredPredictions","filter","sortPredictions","sort","a","b","aDistance","distanceMeters","Number","POSITIVE_INFINITY","bDistance","buildDisplayPredictions","isExactMatch","value","toLowerCase","AddressAutocompleteInput","id","label","placeholder","onValueChange","disabled","name","className","autofillShimName","googleMapsApiKey","locationRestriction","inputValue","setInputValue","useState","setPredictions","isDropdownOpen","setIsDropdownOpen","highlightedIndex","setHighlightedIndex","isLoading","setIsLoading","inputRef","useRef","dropdownRef","isSelecting","hasUserTyped","sessionTokenRef","optionRefs","scrollBehaviorRef","placesLibrary","useMapsLibrary","allowedTypesSet","useMemo","newSet","add","useEffect","current","trimmed","isActive","handler","setTimeout","AutocompleteSuggestion","AutocompleteSessionToken","console","error","request","input","sessionToken","undefined","includedRegionCodes","fetchAutocompleteSuggestions","then","response","placePredictions","suggestions","suggestion","placePrediction","Boolean","combinedPredictions","singlePrediction","hasExactMatch","catch","clearTimeout","handleClickOutside","event","contains","target","document","addEventListener","removeEventListener","handleSelectPrediction","newAddress","handleInputChange","e","handleKeyDown","preventDefault","repeat","prev","handleBlur","shimName","item","list","behavior","top","offsetTop","bottom","offsetHeight","viewTop","scrollTop","viewBottom","clientHeight","scrollIntoView","block","jsxs","position","left","height","width","Input","cn","Loader2","node","clsx"],"mappings":";;;;;;;;AAWA,MAAMA,KAAwB,oBAAIC,IAAI,CACpC,kBACA,SACA,WACA,cACA,gBACA,eACA,uBACA,uBACA,uBACA,uBACA,uBACA,+BACA,+BACA,+BACA,+BACA,+BACA,+BACA,+BACA,eACA,YACA,WACA,WACA,aACA,aACA,gBACA,mBACA,WACA,iBACA,iBAAiB,CAClB,GAEKC,IAAiBA,CAACC,OACLA,EAAWC,MAAMA,QAAQ,IAC1BC,QAAQ,aAAa,EAAE,EAAEC,KAAAA,GA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,KAAK7E,GACL,IAAApB,GACA,MAAK,QACL,aAAAE,GACA,MAAMG,KAAQ,GAAGL,CAAE,UACnB,OAAOU,GACP,UAAU6D,GACV,WAAWE,GACX,SAAS,MAAM;AACb,QAAIjG,EAAYxB,SAAS,KAAK0D,KAC5BK,EAAkB,EAAI;AAAA,MAE1B,GACA,QAAQ8D,GACR,UAAAzE,GACA,cAAa,gBACb,WAAW8F,GAAG,UAAUhF,KAAa,QAAQZ,CAAS,EAAA,CAAE;AAAA,MAEzDY,KACCvD,gBAAAA,EAAAA,IAACwI,IAAA,EACC,WAAU,oGACV,eAAY,OAAA,CAAM;AAAA,IAAA,GAGxB;AAAA,IACCrF,KAAkBtC,EAAYxB,SAAS,2BACrC,MAAA,EACC,KAAKsE,GACL,WAAU,qHACV,MAAK,WAEJ9C,UAAAA,EAAYC,IAAI,CAAC1C,GAAYqB,MAC5BO,gBAAAA,EAAAA,IAAC,MAAA,EAEC,KAAKyI,CAAAA,MAAQ;AACX1E,MAAAA,EAAWS,QAAQ/E,CAAK,IAAIgJ;AAAAA,IAC9B,GACA,WAAWC,GACT,oEACA;AAAA,MAAE,eAAerF,MAAqB5D;AAAAA,IAAAA,CACxC,GACA,MAAK,UACL,aAAaoH,CAAAA,MAAK;AAChBA,MAAAA,EAAEE,eAAAA,GACFL,EAAuBtI,CAAU;AAAA,IACnC,GAEA,UAAA4B,gBAAAA,EAAAA,IAACxB,IAAA,EAAe,YAAYJ,GAAW,EAAA,GAdlCsC,GAAgBtC,GAAYqB,CAAK,CAexC,CACD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
package/dist/index300.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
function O(o, r) {
|
|
2
|
+
let { startMonth: t, endMonth: e } = o;
|
|
3
|
+
const { startOfYear: M, startOfDay: d, startOfMonth: c, endOfMonth: Y, addYears: l, endOfYear: w, newDate: f, today: i } = r, { fromYear: a, toYear: n, fromMonth: s, toMonth: h } = o;
|
|
4
|
+
!t && s && (t = s), !t && a && (t = r.newDate(a, 0, 1)), !e && h && (e = h), !e && n && (e = f(n, 11, 31));
|
|
5
|
+
const y = o.captionLayout === "dropdown" || o.captionLayout === "dropdown-years";
|
|
6
|
+
return t ? t = c(t) : a ? t = f(a, 0, 1) : !t && y && (t = M(l(o.today ?? i(), -100))), e ? e = Y(e) : n ? e = f(n, 11, 31) : !e && y && (e = w(o.today ?? i())), [
|
|
7
|
+
t && d(t),
|
|
8
|
+
e && d(e)
|
|
9
|
+
];
|
|
5
10
|
}
|
|
6
11
|
export {
|
|
7
|
-
|
|
12
|
+
O as getNavMonths
|
|
8
13
|
};
|
|
9
14
|
//# sourceMappingURL=index300.js.map
|
package/dist/index300.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index300.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index300.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js"],"sourcesContent":["/**\n * Returns the start and end months for calendar navigation.\n *\n * @param props The DayPicker props, including navigation and layout options.\n * @param dateLib The date library to use for date manipulation.\n * @returns A tuple containing the start and end months for navigation.\n */\nexport function getNavMonths(props, dateLib) {\n let { startMonth, endMonth } = props;\n const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today, } = dateLib;\n // Handle deprecated code\n const { fromYear, toYear, fromMonth, toMonth } = props;\n if (!startMonth && fromMonth) {\n startMonth = fromMonth;\n }\n if (!startMonth && fromYear) {\n startMonth = dateLib.newDate(fromYear, 0, 1);\n }\n if (!endMonth && toMonth) {\n endMonth = toMonth;\n }\n if (!endMonth && toYear) {\n endMonth = newDate(toYear, 11, 31);\n }\n const hasYearDropdown = props.captionLayout === \"dropdown\" ||\n props.captionLayout === \"dropdown-years\";\n if (startMonth) {\n startMonth = startOfMonth(startMonth);\n }\n else if (fromYear) {\n startMonth = newDate(fromYear, 0, 1);\n }\n else if (!startMonth && hasYearDropdown) {\n startMonth = startOfYear(addYears(props.today ?? today(), -100));\n }\n if (endMonth) {\n endMonth = endOfMonth(endMonth);\n }\n else if (toYear) {\n endMonth = newDate(toYear, 11, 31);\n }\n else if (!endMonth && hasYearDropdown) {\n endMonth = endOfYear(props.today ?? today());\n }\n return [\n startMonth ? startOfDay(startMonth) : startMonth,\n endMonth ? startOfDay(endMonth) : endMonth,\n ];\n}\n"],"names":["getNavMonths","props","dateLib","startMonth","endMonth","startOfYear","startOfDay","startOfMonth","endOfMonth","addYears","endOfYear","newDate","today","fromYear","toYear","fromMonth","toMonth","hasYearDropdown"],"mappings":"AAOO,SAASA,EAAaC,GAAOC,GAAS;AACzC,MAAI,EAAE,YAAAC,GAAY,UAAAC,EAAQ,IAAKH;AAC/B,QAAM,EAAE,aAAAI,GAAa,YAAAC,GAAY,cAAAC,GAAc,YAAAC,GAAY,UAAAC,GAAU,WAAAC,GAAW,SAAAC,GAAS,OAAAC,EAAK,IAAMV,GAE9F,EAAE,UAAAW,GAAU,QAAAC,GAAQ,WAAAC,GAAW,SAAAC,EAAO,IAAKf;AACjD,EAAI,CAACE,KAAcY,MACfZ,IAAaY,IAEb,CAACZ,KAAcU,MACfV,IAAaD,EAAQ,QAAQW,GAAU,GAAG,CAAC,IAE3C,CAACT,KAAYY,MACbZ,IAAWY,IAEX,CAACZ,KAAYU,MACbV,IAAWO,EAAQG,GAAQ,IAAI,EAAE;AAErC,QAAMG,IAAkBhB,EAAM,kBAAkB,cAC5CA,EAAM,kBAAkB;AAC5B,SAAIE,IACAA,IAAaI,EAAaJ,CAAU,IAE/BU,IACLV,IAAaQ,EAAQE,GAAU,GAAG,CAAC,IAE9B,CAACV,KAAcc,MACpBd,IAAaE,EAAYI,EAASR,EAAM,SAASW,EAAK,GAAI,IAAI,CAAC,IAE/DR,IACAA,IAAWI,EAAWJ,CAAQ,IAEzBU,IACLV,IAAWO,EAAQG,GAAQ,IAAI,EAAE,IAE5B,CAACV,KAAYa,MAClBb,IAAWM,EAAUT,EAAM,SAASW,EAAK,CAAE,IAExC;AAAA,IACHT,KAAaG,EAAWH,CAAU;AAAA,IAClCC,KAAWE,EAAWF,CAAQ;AAAA,EACtC;AACA;","x_google_ignoreList":[0]}
|
package/dist/index301.js
CHANGED
|
@@ -1,44 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
platform: "",
|
|
11
|
-
maxTouchPoints: -1
|
|
12
|
-
};
|
|
13
|
-
const t = navigator.userAgentData;
|
|
14
|
-
return t?.platform ? {
|
|
15
|
-
platform: t.platform,
|
|
16
|
-
maxTouchPoints: navigator.maxTouchPoints
|
|
17
|
-
} : {
|
|
18
|
-
platform: navigator.platform ?? "",
|
|
19
|
-
maxTouchPoints: navigator.maxTouchPoints ?? -1
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function u() {
|
|
23
|
-
if (!a)
|
|
24
|
-
return "";
|
|
25
|
-
const t = navigator.userAgentData;
|
|
26
|
-
return t && Array.isArray(t.brands) ? t.brands.map(({
|
|
27
|
-
brand: i,
|
|
28
|
-
version: e
|
|
29
|
-
}) => `${i}/${e}`).join(" ") : navigator.userAgent;
|
|
30
|
-
}
|
|
31
|
-
function f() {
|
|
32
|
-
if (!a)
|
|
33
|
-
return "";
|
|
34
|
-
const t = navigator.userAgentData;
|
|
35
|
-
return t?.platform ? t.platform : navigator.platform ?? "";
|
|
1
|
+
function h(n, t, e, s) {
|
|
2
|
+
if (e.disableNavigation)
|
|
3
|
+
return;
|
|
4
|
+
const { pagedNavigation: u, numberOfMonths: f = 1 } = e, { startOfMonth: a, addMonths: o, differenceInCalendarMonths: d } = s, i = u ? f : 1, r = a(n);
|
|
5
|
+
if (!t)
|
|
6
|
+
return o(r, i);
|
|
7
|
+
if (!(d(t, n) < f))
|
|
8
|
+
return o(r, i);
|
|
36
9
|
}
|
|
37
10
|
export {
|
|
38
|
-
|
|
39
|
-
m as isIOS,
|
|
40
|
-
d as isJSDOM,
|
|
41
|
-
p as isSafari,
|
|
42
|
-
c as isWebKit
|
|
11
|
+
h as getNextMonth
|
|
43
12
|
};
|
|
44
13
|
//# sourceMappingURL=index301.js.map
|
package/dist/index301.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index301.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index301.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js"],"sourcesContent":["/**\n * Returns the next month the user can navigate to, based on the given options.\n *\n * The next month is not always the next calendar month:\n *\n * - If it is after the `calendarEndMonth`, it returns `undefined`.\n * - If paged navigation is enabled, it skips forward by the number of displayed\n * months.\n *\n * @param firstDisplayedMonth The first month currently displayed in the\n * calendar.\n * @param calendarEndMonth The latest month the user can navigate to.\n * @param options Navigation options, including `numberOfMonths` and\n * `pagedNavigation`.\n * @param dateLib The date library to use for date manipulation.\n * @returns The next month, or `undefined` if navigation is not possible.\n */\nexport function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {\n if (options.disableNavigation) {\n return undefined;\n }\n const { pagedNavigation, numberOfMonths = 1 } = options;\n const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;\n const offset = pagedNavigation ? numberOfMonths : 1;\n const month = startOfMonth(firstDisplayedMonth);\n if (!calendarEndMonth) {\n return addMonths(month, offset);\n }\n const monthsDiff = differenceInCalendarMonths(calendarEndMonth, firstDisplayedMonth);\n if (monthsDiff < numberOfMonths) {\n return undefined;\n }\n return addMonths(month, offset);\n}\n"],"names":["getNextMonth","firstDisplayedMonth","calendarEndMonth","options","dateLib","pagedNavigation","numberOfMonths","startOfMonth","addMonths","differenceInCalendarMonths","offset","month"],"mappings":"AAiBO,SAASA,EAAaC,GAAqBC,GAAkBC,GAASC,GAAS;AAClF,MAAID,EAAQ;AACR;AAEJ,QAAM,EAAE,iBAAAE,GAAiB,gBAAAC,IAAiB,EAAC,IAAKH,GAC1C,EAAE,cAAAI,GAAc,WAAAC,GAAW,4BAAAC,EAA0B,IAAKL,GAC1DM,IAASL,IAAkBC,IAAiB,GAC5CK,IAAQJ,EAAaN,CAAmB;AAC9C,MAAI,CAACC;AACD,WAAOM,EAAUG,GAAOD,CAAM;AAGlC,MAAI,EADeD,EAA2BP,GAAkBD,CAAmB,IAClEK;AAGjB,WAAOE,EAAUG,GAAOD,CAAM;AAClC;","x_google_ignoreList":[0]}
|
package/dist/index302.js
CHANGED
|
@@ -1,69 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* be much more efficient if there is a call pattern that alterns as
|
|
10
|
-
* "request-cancel-request-cancel-…".
|
|
11
|
-
* But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
|
|
12
|
-
* frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
|
|
13
|
-
callbacks = [];
|
|
14
|
-
callbacksCount = 0;
|
|
15
|
-
nextId = 1;
|
|
16
|
-
startId = 1;
|
|
17
|
-
isScheduled = !1;
|
|
18
|
-
tick = (t) => {
|
|
19
|
-
this.isScheduled = !1;
|
|
20
|
-
const e = this.callbacks, r = this.callbacksCount;
|
|
21
|
-
if (this.callbacks = [], this.callbacksCount = 0, this.startId = this.nextId, r > 0)
|
|
22
|
-
for (let i = 0; i < e.length; i += 1)
|
|
23
|
-
e[i]?.(t);
|
|
24
|
-
};
|
|
25
|
-
request(t) {
|
|
26
|
-
const e = this.nextId;
|
|
27
|
-
this.nextId += 1, this.callbacks.push(t), this.callbacksCount += 1;
|
|
28
|
-
const r = process.env.NODE_ENV !== "production" && l !== requestAnimationFrame && (l = requestAnimationFrame, !0);
|
|
29
|
-
return (!this.isScheduled || r) && (requestAnimationFrame(this.tick), this.isScheduled = !0), e;
|
|
30
|
-
}
|
|
31
|
-
cancel(t) {
|
|
32
|
-
const e = t - this.startId;
|
|
33
|
-
e < 0 || e >= this.callbacks.length || (this.callbacks[e] = null, this.callbacksCount -= 1);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
const c = new o();
|
|
37
|
-
class a {
|
|
38
|
-
static create() {
|
|
39
|
-
return new a();
|
|
40
|
-
}
|
|
41
|
-
static request(t) {
|
|
42
|
-
return c.request(t);
|
|
43
|
-
}
|
|
44
|
-
static cancel(t) {
|
|
45
|
-
return c.cancel(t);
|
|
46
|
-
}
|
|
47
|
-
currentId = s;
|
|
48
|
-
/**
|
|
49
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
50
|
-
*/
|
|
51
|
-
request(t) {
|
|
52
|
-
this.cancel(), this.currentId = c.request(() => {
|
|
53
|
-
this.currentId = s, t();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
cancel = () => {
|
|
57
|
-
this.currentId !== s && (c.cancel(this.currentId), this.currentId = s);
|
|
58
|
-
};
|
|
59
|
-
disposeEffect = () => this.cancel;
|
|
60
|
-
}
|
|
61
|
-
function k() {
|
|
62
|
-
const n = u(a.create).current;
|
|
63
|
-
return h(n.disposeEffect), n;
|
|
1
|
+
function c(i, t, e, s) {
|
|
2
|
+
if (e.disableNavigation)
|
|
3
|
+
return;
|
|
4
|
+
const { pagedNavigation: r, numberOfMonths: d } = e, { startOfMonth: u, addMonths: f, differenceInCalendarMonths: a } = s, o = r ? d ?? 1 : 1, n = u(i);
|
|
5
|
+
if (!t)
|
|
6
|
+
return f(n, -o);
|
|
7
|
+
if (!(a(n, t) <= 0))
|
|
8
|
+
return f(n, -o);
|
|
64
9
|
}
|
|
65
10
|
export {
|
|
66
|
-
|
|
67
|
-
k as useAnimationFrame
|
|
11
|
+
c as getPreviousMonth
|
|
68
12
|
};
|
|
69
13
|
//# sourceMappingURL=index302.js.map
|