@lmb-it/kitsconcerto-native 0.1.238 → 0.1.240

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.
@@ -1 +1 @@
1
- {"version":3,"file":"googlePlaces.cjs","sources":["../../../../../src/form/inputs/InputLocation/googlePlaces.ts"],"sourcesContent":["/**\n * Google Places transport — LEGACY Web Service endpoints (default / native).\n *\n * React Native has no CORS, so the legacy REST endpoints keep working there\n * unchanged. Browsers cannot call them (no ACAO header) — the web build\n * resolves `googlePlaces.web.ts` (Places API New) instead. Both files export\n * the SAME normalized contract so `index.tsx` is platform-agnostic.\n */\nimport axios from \"axios\";\nimport type {ILocationDetailsResponse, ILocationResponse} from \"@lmb-it/kitsconcerto-types\";\n\nconst GOOGLE_AUTOCOMPLETE =\n \"https://maps.googleapis.com/maps/api/place/autocomplete/json\";\nconst GOOGLE_DETAILS =\n \"https://maps.googleapis.com/maps/api/place/details/json\";\n\nexport interface IGoogleSuggestion {\n label: string;\n value: string;\n}\n\nexport interface IGoogleAddressComponent {\n /** First Google `types[]` entry — the key the consumer contract uses. */\n type: string | undefined;\n long: string;\n short: string;\n}\n\nexport interface IGooglePlaceDetails {\n formattedAddress: string;\n latitude: number | null;\n longitude: number | null;\n components: IGoogleAddressComponent[];\n}\n\nexport async function googleAutocomplete(\n query: string,\n apiKey: string,\n countryISO?: string\n): Promise<IGoogleSuggestion[]> {\n let url = `${GOOGLE_AUTOCOMPLETE}?input=${encodeURIComponent(query)}&key=${apiKey}`;\n if (countryISO) {\n url += `&components=country:${countryISO.toLowerCase().slice(0, 2)}`;\n }\n const {data} = await axios.get<ILocationResponse>(url);\n return (\n data.predictions?.map((p) => ({\n label: p.description,\n value: p.place_id,\n })) || []\n );\n}\n\nexport async function googleDetails(\n placeId: string,\n apiKey: string\n): Promise<IGooglePlaceDetails> {\n // Request address_components AND geometry so we get lat/lng too.\n const url = `${GOOGLE_DETAILS}?place_id=${placeId}&key=${apiKey}&fields=address_components,formatted_address,geometry`;\n const {data} = await axios.get<ILocationDetailsResponse>(url);\n return {\n formattedAddress: data.result.formatted_address,\n latitude: data.result.geometry?.location?.lat ?? null,\n longitude: data.result.geometry?.location?.lng ?? null,\n components: data.result.address_components.map((c) => ({\n type: c?.types?.[0],\n long: c.long_name,\n short: c.short_name,\n })),\n };\n}\n"],"names":[],"mappings":";;;;AAWA,MAAM,mBAAA,GACF,8DAAA;AACJ,MAAM,cAAA,GACF,yDAAA;AAqBJ,eAAsB,kBAAA,CAClB,KAAA,EACA,MAAA,EACA,UAAA,EAC4B;AAC5B,EAAA,IAAI,GAAA,GAAM,GAAG,mBAAmB,CAAA,OAAA,EAAU,mBAAmB,KAAK,CAAC,QAAQ,MAAM,CAAA,CAAA;AACjF,EAAA,IAAI,UAAA,EAAY;AACZ,IAAA,GAAA,IAAO,uBAAuB,UAAA,CAAW,WAAA,GAAc,KAAA,CAAM,CAAA,EAAG,CAAC,CAAC,CAAA,CAAA;AAAA,EACtE;AACA,EAAA,MAAM,EAAC,IAAA,EAAI,GAAI,MAAM,KAAA,CAAM,IAAuB,GAAG,CAAA;AACrD,EAAA,OACI,IAAA,CAAK,WAAA,EAAa,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,IAC1B,OAAO,CAAA,CAAE,WAAA;AAAA,IACT,OAAO,CAAA,CAAE;AAAA,GACb,CAAE,KAAK,EAAC;AAEhB;AAEA,eAAsB,aAAA,CAClB,SACA,MAAA,EAC4B;AAE5B,EAAA,MAAM,MAAM,CAAA,EAAG,cAAc,CAAA,UAAA,EAAa,OAAO,QAAQ,MAAM,CAAA,qDAAA,CAAA;AAC/D,EAAA,MAAM,EAAC,IAAA,EAAI,GAAI,MAAM,KAAA,CAAM,IAA8B,GAAG,CAAA;AAC5D,EAAA,OAAO;AAAA,IACH,gBAAA,EAAkB,KAAK,MAAA,CAAO,iBAAA;AAAA,IAC9B,QAAA,EAAU,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,UAAU,GAAA,IAAO,IAAA;AAAA,IACjD,SAAA,EAAW,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,UAAU,GAAA,IAAO,IAAA;AAAA,IAClD,YAAY,IAAA,CAAK,MAAA,CAAO,kBAAA,CAAmB,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,MACnD,IAAA,EAAM,CAAA,EAAG,KAAA,GAAQ,CAAC,CAAA;AAAA,MAClB,MAAM,CAAA,CAAE,SAAA;AAAA,MACR,OAAO,CAAA,CAAE;AAAA,KACb,CAAE;AAAA,GACN;AACJ;;;;;"}
1
+ {"version":3,"file":"googlePlaces.cjs","sources":["../../../../../src/form/inputs/InputLocation/googlePlaces.native.ts"],"sourcesContent":["/**\n * Google Places transport — LEGACY Web Service endpoints (NATIVE build).\n *\n * React Native has no CORS, so the legacy REST endpoints keep working there\n * unchanged. Browsers cannot call them (no ACAO header) — the web build\n * resolves `googlePlaces.web.ts` (Places API New) instead. Both files export\n * the SAME normalized contract (`googlePlaces.types.ts`) so `index.tsx` is\n * platform-agnostic. There is deliberately NO bare `googlePlaces.ts`: a bare\n * sibling wins module resolution over the platform-suffixed files and ships\n * the wrong transport (the v0.1.238 regression).\n */\nimport axios from \"axios\";\nimport type {ILocationDetailsResponse, ILocationResponse} from \"@lmb-it/kitsconcerto-types\";\nimport type {IGooglePlaceDetails, IGoogleSuggestion} from \"./googlePlaces.types\";\n\nconst GOOGLE_AUTOCOMPLETE =\n \"https://maps.googleapis.com/maps/api/place/autocomplete/json\";\nconst GOOGLE_DETAILS =\n \"https://maps.googleapis.com/maps/api/place/details/json\";\n\nexport type {IGoogleAddressComponent, IGooglePlaceDetails, IGoogleSuggestion} from \"./googlePlaces.types\";\n\nexport async function googleAutocomplete(\n query: string,\n apiKey: string,\n countryISO?: string\n): Promise<IGoogleSuggestion[]> {\n let url = `${GOOGLE_AUTOCOMPLETE}?input=${encodeURIComponent(query)}&key=${apiKey}`;\n if (countryISO) {\n url += `&components=country:${countryISO.toLowerCase().slice(0, 2)}`;\n }\n const {data} = await axios.get<ILocationResponse>(url);\n return (\n data.predictions?.map((p) => ({\n label: p.description,\n value: p.place_id,\n })) || []\n );\n}\n\nexport async function googleDetails(\n placeId: string,\n apiKey: string\n): Promise<IGooglePlaceDetails> {\n // Request address_components AND geometry so we get lat/lng too.\n const url = `${GOOGLE_DETAILS}?place_id=${placeId}&key=${apiKey}&fields=address_components,formatted_address,geometry`;\n const {data} = await axios.get<ILocationDetailsResponse>(url);\n return {\n formattedAddress: data.result.formatted_address,\n latitude: data.result.geometry?.location?.lat ?? null,\n longitude: data.result.geometry?.location?.lng ?? null,\n components: data.result.address_components.map((c) => ({\n type: c?.types?.[0],\n long: c.long_name,\n short: c.short_name,\n })),\n };\n}\n"],"names":[],"mappings":";;;;AAeA,MAAM,mBAAA,GACF,8DAAA;AACJ,MAAM,cAAA,GACF,yDAAA;AAIJ,eAAsB,kBAAA,CAClB,KAAA,EACA,MAAA,EACA,UAAA,EAC4B;AAC5B,EAAA,IAAI,GAAA,GAAM,GAAG,mBAAmB,CAAA,OAAA,EAAU,mBAAmB,KAAK,CAAC,QAAQ,MAAM,CAAA,CAAA;AACjF,EAAA,IAAI,UAAA,EAAY;AACZ,IAAA,GAAA,IAAO,uBAAuB,UAAA,CAAW,WAAA,GAAc,KAAA,CAAM,CAAA,EAAG,CAAC,CAAC,CAAA,CAAA;AAAA,EACtE;AACA,EAAA,MAAM,EAAC,IAAA,EAAI,GAAI,MAAM,KAAA,CAAM,IAAuB,GAAG,CAAA;AACrD,EAAA,OACI,IAAA,CAAK,WAAA,EAAa,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,IAC1B,OAAO,CAAA,CAAE,WAAA;AAAA,IACT,OAAO,CAAA,CAAE;AAAA,GACb,CAAE,KAAK,EAAC;AAEhB;AAEA,eAAsB,aAAA,CAClB,SACA,MAAA,EAC4B;AAE5B,EAAA,MAAM,MAAM,CAAA,EAAG,cAAc,CAAA,UAAA,EAAa,OAAO,QAAQ,MAAM,CAAA,qDAAA,CAAA;AAC/D,EAAA,MAAM,EAAC,IAAA,EAAI,GAAI,MAAM,KAAA,CAAM,IAA8B,GAAG,CAAA;AAC5D,EAAA,OAAO;AAAA,IACH,gBAAA,EAAkB,KAAK,MAAA,CAAO,iBAAA;AAAA,IAC9B,QAAA,EAAU,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,UAAU,GAAA,IAAO,IAAA;AAAA,IACjD,SAAA,EAAW,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,UAAU,GAAA,IAAO,IAAA;AAAA,IAClD,YAAY,IAAA,CAAK,MAAA,CAAO,kBAAA,CAAmB,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,MACnD,IAAA,EAAM,CAAA,EAAG,KAAA,GAAQ,CAAC,CAAA;AAAA,MAClB,MAAM,CAAA,CAAE,SAAA;AAAA,MACR,OAAO,CAAA,CAAE;AAAA,KACb,CAAE;AAAA,GACN;AACJ;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"googlePlaces.js","sources":["../../../../../src/form/inputs/InputLocation/googlePlaces.ts"],"sourcesContent":["/**\n * Google Places transport — LEGACY Web Service endpoints (default / native).\n *\n * React Native has no CORS, so the legacy REST endpoints keep working there\n * unchanged. Browsers cannot call them (no ACAO header) — the web build\n * resolves `googlePlaces.web.ts` (Places API New) instead. Both files export\n * the SAME normalized contract so `index.tsx` is platform-agnostic.\n */\nimport axios from \"axios\";\nimport type {ILocationDetailsResponse, ILocationResponse} from \"@lmb-it/kitsconcerto-types\";\n\nconst GOOGLE_AUTOCOMPLETE =\n \"https://maps.googleapis.com/maps/api/place/autocomplete/json\";\nconst GOOGLE_DETAILS =\n \"https://maps.googleapis.com/maps/api/place/details/json\";\n\nexport interface IGoogleSuggestion {\n label: string;\n value: string;\n}\n\nexport interface IGoogleAddressComponent {\n /** First Google `types[]` entry — the key the consumer contract uses. */\n type: string | undefined;\n long: string;\n short: string;\n}\n\nexport interface IGooglePlaceDetails {\n formattedAddress: string;\n latitude: number | null;\n longitude: number | null;\n components: IGoogleAddressComponent[];\n}\n\nexport async function googleAutocomplete(\n query: string,\n apiKey: string,\n countryISO?: string\n): Promise<IGoogleSuggestion[]> {\n let url = `${GOOGLE_AUTOCOMPLETE}?input=${encodeURIComponent(query)}&key=${apiKey}`;\n if (countryISO) {\n url += `&components=country:${countryISO.toLowerCase().slice(0, 2)}`;\n }\n const {data} = await axios.get<ILocationResponse>(url);\n return (\n data.predictions?.map((p) => ({\n label: p.description,\n value: p.place_id,\n })) || []\n );\n}\n\nexport async function googleDetails(\n placeId: string,\n apiKey: string\n): Promise<IGooglePlaceDetails> {\n // Request address_components AND geometry so we get lat/lng too.\n const url = `${GOOGLE_DETAILS}?place_id=${placeId}&key=${apiKey}&fields=address_components,formatted_address,geometry`;\n const {data} = await axios.get<ILocationDetailsResponse>(url);\n return {\n formattedAddress: data.result.formatted_address,\n latitude: data.result.geometry?.location?.lat ?? null,\n longitude: data.result.geometry?.location?.lng ?? null,\n components: data.result.address_components.map((c) => ({\n type: c?.types?.[0],\n long: c.long_name,\n short: c.short_name,\n })),\n };\n}\n"],"names":[],"mappings":";;AAWA,MAAM,mBAAA,GACF,8DAAA;AACJ,MAAM,cAAA,GACF,yDAAA;AAqBJ,eAAsB,kBAAA,CAClB,KAAA,EACA,MAAA,EACA,UAAA,EAC4B;AAC5B,EAAA,IAAI,GAAA,GAAM,GAAG,mBAAmB,CAAA,OAAA,EAAU,mBAAmB,KAAK,CAAC,QAAQ,MAAM,CAAA,CAAA;AACjF,EAAA,IAAI,UAAA,EAAY;AACZ,IAAA,GAAA,IAAO,uBAAuB,UAAA,CAAW,WAAA,GAAc,KAAA,CAAM,CAAA,EAAG,CAAC,CAAC,CAAA,CAAA;AAAA,EACtE;AACA,EAAA,MAAM,EAAC,IAAA,EAAI,GAAI,MAAM,KAAA,CAAM,IAAuB,GAAG,CAAA;AACrD,EAAA,OACI,IAAA,CAAK,WAAA,EAAa,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,IAC1B,OAAO,CAAA,CAAE,WAAA;AAAA,IACT,OAAO,CAAA,CAAE;AAAA,GACb,CAAE,KAAK,EAAC;AAEhB;AAEA,eAAsB,aAAA,CAClB,SACA,MAAA,EAC4B;AAE5B,EAAA,MAAM,MAAM,CAAA,EAAG,cAAc,CAAA,UAAA,EAAa,OAAO,QAAQ,MAAM,CAAA,qDAAA,CAAA;AAC/D,EAAA,MAAM,EAAC,IAAA,EAAI,GAAI,MAAM,KAAA,CAAM,IAA8B,GAAG,CAAA;AAC5D,EAAA,OAAO;AAAA,IACH,gBAAA,EAAkB,KAAK,MAAA,CAAO,iBAAA;AAAA,IAC9B,QAAA,EAAU,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,UAAU,GAAA,IAAO,IAAA;AAAA,IACjD,SAAA,EAAW,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,UAAU,GAAA,IAAO,IAAA;AAAA,IAClD,YAAY,IAAA,CAAK,MAAA,CAAO,kBAAA,CAAmB,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,MACnD,IAAA,EAAM,CAAA,EAAG,KAAA,GAAQ,CAAC,CAAA;AAAA,MAClB,MAAM,CAAA,CAAE,SAAA;AAAA,MACR,OAAO,CAAA,CAAE;AAAA,KACb,CAAE;AAAA,GACN;AACJ;;;;"}
1
+ {"version":3,"file":"googlePlaces.js","sources":["../../../../../src/form/inputs/InputLocation/googlePlaces.native.ts"],"sourcesContent":["/**\n * Google Places transport — LEGACY Web Service endpoints (NATIVE build).\n *\n * React Native has no CORS, so the legacy REST endpoints keep working there\n * unchanged. Browsers cannot call them (no ACAO header) — the web build\n * resolves `googlePlaces.web.ts` (Places API New) instead. Both files export\n * the SAME normalized contract (`googlePlaces.types.ts`) so `index.tsx` is\n * platform-agnostic. There is deliberately NO bare `googlePlaces.ts`: a bare\n * sibling wins module resolution over the platform-suffixed files and ships\n * the wrong transport (the v0.1.238 regression).\n */\nimport axios from \"axios\";\nimport type {ILocationDetailsResponse, ILocationResponse} from \"@lmb-it/kitsconcerto-types\";\nimport type {IGooglePlaceDetails, IGoogleSuggestion} from \"./googlePlaces.types\";\n\nconst GOOGLE_AUTOCOMPLETE =\n \"https://maps.googleapis.com/maps/api/place/autocomplete/json\";\nconst GOOGLE_DETAILS =\n \"https://maps.googleapis.com/maps/api/place/details/json\";\n\nexport type {IGoogleAddressComponent, IGooglePlaceDetails, IGoogleSuggestion} from \"./googlePlaces.types\";\n\nexport async function googleAutocomplete(\n query: string,\n apiKey: string,\n countryISO?: string\n): Promise<IGoogleSuggestion[]> {\n let url = `${GOOGLE_AUTOCOMPLETE}?input=${encodeURIComponent(query)}&key=${apiKey}`;\n if (countryISO) {\n url += `&components=country:${countryISO.toLowerCase().slice(0, 2)}`;\n }\n const {data} = await axios.get<ILocationResponse>(url);\n return (\n data.predictions?.map((p) => ({\n label: p.description,\n value: p.place_id,\n })) || []\n );\n}\n\nexport async function googleDetails(\n placeId: string,\n apiKey: string\n): Promise<IGooglePlaceDetails> {\n // Request address_components AND geometry so we get lat/lng too.\n const url = `${GOOGLE_DETAILS}?place_id=${placeId}&key=${apiKey}&fields=address_components,formatted_address,geometry`;\n const {data} = await axios.get<ILocationDetailsResponse>(url);\n return {\n formattedAddress: data.result.formatted_address,\n latitude: data.result.geometry?.location?.lat ?? null,\n longitude: data.result.geometry?.location?.lng ?? null,\n components: data.result.address_components.map((c) => ({\n type: c?.types?.[0],\n long: c.long_name,\n short: c.short_name,\n })),\n };\n}\n"],"names":[],"mappings":";;AAeA,MAAM,mBAAA,GACF,8DAAA;AACJ,MAAM,cAAA,GACF,yDAAA;AAIJ,eAAsB,kBAAA,CAClB,KAAA,EACA,MAAA,EACA,UAAA,EAC4B;AAC5B,EAAA,IAAI,GAAA,GAAM,GAAG,mBAAmB,CAAA,OAAA,EAAU,mBAAmB,KAAK,CAAC,QAAQ,MAAM,CAAA,CAAA;AACjF,EAAA,IAAI,UAAA,EAAY;AACZ,IAAA,GAAA,IAAO,uBAAuB,UAAA,CAAW,WAAA,GAAc,KAAA,CAAM,CAAA,EAAG,CAAC,CAAC,CAAA,CAAA;AAAA,EACtE;AACA,EAAA,MAAM,EAAC,IAAA,EAAI,GAAI,MAAM,KAAA,CAAM,IAAuB,GAAG,CAAA;AACrD,EAAA,OACI,IAAA,CAAK,WAAA,EAAa,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,IAC1B,OAAO,CAAA,CAAE,WAAA;AAAA,IACT,OAAO,CAAA,CAAE;AAAA,GACb,CAAE,KAAK,EAAC;AAEhB;AAEA,eAAsB,aAAA,CAClB,SACA,MAAA,EAC4B;AAE5B,EAAA,MAAM,MAAM,CAAA,EAAG,cAAc,CAAA,UAAA,EAAa,OAAO,QAAQ,MAAM,CAAA,qDAAA,CAAA;AAC/D,EAAA,MAAM,EAAC,IAAA,EAAI,GAAI,MAAM,KAAA,CAAM,IAA8B,GAAG,CAAA;AAC5D,EAAA,OAAO;AAAA,IACH,gBAAA,EAAkB,KAAK,MAAA,CAAO,iBAAA;AAAA,IAC9B,QAAA,EAAU,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,UAAU,GAAA,IAAO,IAAA;AAAA,IACjD,SAAA,EAAW,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,UAAU,GAAA,IAAO,IAAA;AAAA,IAClD,YAAY,IAAA,CAAK,MAAA,CAAO,kBAAA,CAAmB,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,MACnD,IAAA,EAAM,CAAA,EAAG,KAAA,GAAQ,CAAC,CAAA;AAAA,MAClB,MAAM,CAAA,CAAE,SAAA;AAAA,MACR,OAAO,CAAA,CAAE;AAAA,KACb,CAAE;AAAA,GACN;AACJ;;;;"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
7
  var Experian = require('./Experian.cjs');
8
- var googlePlaces = require('./googlePlaces.cjs');
8
+ var googlePlaces_native = require('./googlePlaces.cjs');
9
9
  var SelectContext = require('../../selects/SelectContext.cjs');
10
10
  require('../../../contexts/DialogContext.cjs');
11
11
 
@@ -32,6 +32,7 @@ const KitsInputLocation = ({
32
32
  if (!api_key) throw new Error("API KEY NOT PROVIDED");
33
33
  const selectRef = React.useRef(null);
34
34
  const [suggestions, setSuggestions] = React.useState([]);
35
+ const lastCommittedRef = React.useRef(null);
35
36
  const experian = React.useMemo(
36
37
  () => provider !== "google" ? new Experian.default(api_key) : null,
37
38
  [provider, api_key]
@@ -41,7 +42,7 @@ const KitsInputLocation = ({
41
42
  if (query.length < 4) return [];
42
43
  try {
43
44
  if (provider === "google") {
44
- const mapped = await googlePlaces.googleAutocomplete(query, api_key, countryISO);
45
+ const mapped = await googlePlaces_native.googleAutocomplete(query, api_key, countryISO);
45
46
  setSuggestions(mapped);
46
47
  return mapped;
47
48
  } else {
@@ -65,13 +66,27 @@ const KitsInputLocation = ({
65
66
  async (event, rawItem) => {
66
67
  const selected = rawItem ?? event;
67
68
  if (!selected) return;
69
+ if (typeof selected === "string") {
70
+ onChange?.({ target: { value: selected } });
71
+ return;
72
+ }
73
+ if (!(valueKey in selected)) {
74
+ onChange?.({
75
+ target: { value: selected?.target?.value ?? "" }
76
+ });
77
+ return;
78
+ }
68
79
  const placeId = selected[valueKey];
69
80
  onChange?.({
70
81
  target: { value: selected[labelKey] }
71
82
  });
72
83
  if (!onAddressClick || !placeId) return;
73
84
  if (provider === "google") {
74
- const details = await googlePlaces.googleDetails(placeId, api_key);
85
+ const last = lastCommittedRef.current;
86
+ if (last && last.placeId === placeId && last.label === selected[labelKey]) {
87
+ return;
88
+ }
89
+ const details = await googlePlaces_native.googleDetails(placeId, api_key);
75
90
  const richAddress = {
76
91
  formatted_address: details.formattedAddress,
77
92
  place_id: placeId,
@@ -86,6 +101,15 @@ const KitsInputLocation = ({
86
101
  };
87
102
  }
88
103
  });
104
+ if (details.formattedAddress) {
105
+ lastCommittedRef.current = {
106
+ placeId,
107
+ label: details.formattedAddress
108
+ };
109
+ setSuggestions(
110
+ (prev) => prev.some((s) => s.label === details.formattedAddress) ? prev : [...prev, { label: details.formattedAddress, value: placeId }]
111
+ );
112
+ }
89
113
  onAddressClick(richAddress);
90
114
  } else {
91
115
  const res = await experian?.formatAddress(placeId);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../src/form/inputs/InputLocation/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from \"react\";\nimport Experian from \"./Experian\";\nimport type {IKitsInputLocation, IRef} from \"@lmb-it/kitsconcerto-types\";\nimport {FormSelect} from \"../../../_compat\";\n// Platform-forked Google transport: legacy Web Service on native (no CORS in\n// RN), Places API (New) on web (`googlePlaces.web.ts`) — the legacy endpoints\n// are server-side-only and browsers block them. Same normalized contract on\n// both sides, so the Suggestion / IAddressFormat output is unchanged.\nimport {googleAutocomplete, googleDetails} from \"./googlePlaces\";\n\ntype Suggestion = {\n label: string;\n value: string;\n format?: string;\n};\n\nconst KitsInputLocation = ({\n id,\n label,\n errors,\n invalid,\n value,\n hideError,\n onAddressClick,\n onChange,\n disabled,\n placeholder,\n countryISO = \"AUS\",\n helperText,\n provider,\n api_key,\n labelKey = \"label\",\n valueKey = \"value\",\n // list,\n ...rest\n }: IKitsInputLocation) => {\n if (!api_key) throw new Error(\"API KEY NOT PROVIDED\");\n\n const selectRef = useRef<IRef>(null);\n const [suggestions, setSuggestions] = useState<Suggestion[]>([]);\n\n const experian = useMemo(\n () => (provider !== \"google\" ? new Experian(api_key) : null),\n [provider, api_key]\n );\n\n const search = useCallback(\n async (query: string): Promise<Suggestion[]> => {\n if (query.length < 4) return [];\n\n try {\n if (provider === \"google\") {\n const mapped = await googleAutocomplete(query, api_key, countryISO);\n setSuggestions(mapped);\n return mapped;\n } else {\n const res = await experian?.searchAddress(query, countryISO);\n const mapped = res?.data?.result?.suggestions?.map((s: any) => ({\n label: s.text,\n value: s.global_address_key,\n format: s.format,\n })) || [];\n setSuggestions(mapped);\n return mapped;\n }\n } catch {\n setSuggestions([]);\n return [];\n }\n },\n [provider, api_key, countryISO, experian]\n );\n\n const onPickAddress = useCallback(\n async (event: any, rawItem?: any) => {\n // rawItem is the full suggestion { label, value } passed as second arg by the hook\n const selected = rawItem ?? event;\n\n if (!selected) return;\n\n const placeId = selected[valueKey];\n\n onChange?.({\n target: {value: selected[labelKey]},\n } as any);\n\n if (!onAddressClick || !placeId) return;\n\n if (provider === \"google\") {\n const details = await googleDetails(placeId, api_key);\n\n // Build rich address format: each component has a `long` and `short` value.\n const richAddress: Record<string, any> = {\n formatted_address: details.formattedAddress,\n place_id: placeId,\n latitude: details.latitude,\n longitude: details.longitude,\n };\n\n details.components.forEach((c) => {\n if (c.type && !(c.type in richAddress)) {\n richAddress[c.type] = {\n long: c.long,\n short: c.short,\n };\n }\n });\n\n onAddressClick(richAddress);\n } else {\n const res = await experian?.formatAddress(placeId);\n if (res?.data?.result) { // @ts-ignore\n onAddressClick(res.data.result);\n }\n }\n },\n [\n provider,\n api_key,\n valueKey,\n labelKey,\n onChange,\n onAddressClick,\n experian,\n ]\n );\n\n return (\n <FormSelect\n ref={selectRef}\n id={id}\n shape=\"autocomplete\"\n value={value}\n label={label}\n placeholder={placeholder}\n labelKey={labelKey}\n valueKey={valueKey}\n onChange={onPickAddress}\n isMultiple={false}\n forceSelection\n completeMethod={search}\n list={suggestions}\n helperText={helperText}\n hideError={hideError}\n disabled={disabled}\n invalid={invalid}\n errors={errors}\n {...rest}\n />\n );\n};\n\nexport default KitsInputLocation;\n"],"names":["useRef","useState","useMemo","Experian","useCallback","googleAutocomplete","googleDetails","jsx","FormSelect"],"mappings":";;;;;;;;;;;AAgBA,MAAM,oBAAoB,CAAC;AAAA,EACI,EAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;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ED,QAAA,cAAA,CAAe,WAAW,CAAA;AAAA,MAC9B,CAAA,MAAO;AACH,QAAA,MAAM,GAAA,GAAM,MAAM,QAAA,EAAU,aAAA,CAAc,OAAO,CAAA;AACjD,QAAA,IAAI,GAAA,EAAK,MAAM,MAAA,EAAQ;AACnB,UAAA,cAAA,CAAe,GAAA,CAAI,KAAK,MAAM,CAAA;AAAA,QAClC;AAAA,MACJ;AAAA,IACJ,CAAA;AAAA,IACA;AAAA,MACI,QAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA;AACJ,GACJ;AAEA,EAAA,uBACIC,cAAA;AAAA,IAACC,qBAAA;AAAA,IAAA;AAAA,MACG,GAAA,EAAK,SAAA;AAAA,MACL,EAAA;AAAA,MACA,KAAA,EAAM,cAAA;AAAA,MACN,KAAA;AAAA,MACA,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA,EAAU,aAAA;AAAA,MACV,UAAA,EAAY,KAAA;AAAA,MACZ,cAAA,EAAc,IAAA;AAAA,MACd,cAAA,EAAgB,MAAA;AAAA,MAChB,IAAA,EAAM,WAAA;AAAA,MACN,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACR;AAER;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../src/form/inputs/InputLocation/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from \"react\";\nimport Experian from \"./Experian\";\nimport type {IKitsInputLocation, IRef} from \"@lmb-it/kitsconcerto-types\";\nimport {FormSelect} from \"../../../_compat\";\n// Platform-forked Google transport: legacy Web Service on native\n// (`googlePlaces.native.ts` — RN has no CORS), Places API (New) on web\n// (`googlePlaces.web.ts` — browsers block the legacy endpoints). Same\n// normalized contract on both sides (`googlePlaces.types.ts`), so the\n// Suggestion / IAddressFormat output is unchanged. There is deliberately NO\n// bare `googlePlaces.ts` — a bare sibling wins resolution over the platform\n// files and ships the wrong transport (the v0.1.238 regression).\nimport {googleAutocomplete, googleDetails} from \"./googlePlaces\";\n\ntype Suggestion = {\n label: string;\n value: string;\n format?: string;\n};\n\nconst KitsInputLocation = ({\n id,\n label,\n errors,\n invalid,\n value,\n hideError,\n onAddressClick,\n onChange,\n disabled,\n placeholder,\n countryISO = \"AUS\",\n helperText,\n provider,\n api_key,\n labelKey = \"label\",\n valueKey = \"value\",\n // list,\n ...rest\n }: IKitsInputLocation) => {\n if (!api_key) throw new Error(\"API KEY NOT PROVIDED\");\n\n const selectRef = useRef<IRef>(null);\n const [suggestions, setSuggestions] = useState<Suggestion[]>([]);\n // Last committed pick (set after details resolve). Lets the web blur-path\n // re-selection (see onPickAddress) skip a duplicate details fetch.\n const lastCommittedRef = useRef<{placeId: string; label: string} | null>(null);\n\n const experian = useMemo(\n () => (provider !== \"google\" ? new Experian(api_key) : null),\n [provider, api_key]\n );\n\n const search = useCallback(\n async (query: string): Promise<Suggestion[]> => {\n if (query.length < 4) return [];\n\n try {\n if (provider === \"google\") {\n const mapped = await googleAutocomplete(query, api_key, countryISO);\n setSuggestions(mapped);\n return mapped;\n } else {\n const res = await experian?.searchAddress(query, countryISO);\n const mapped = res?.data?.result?.suggestions?.map((s: any) => ({\n label: s.text,\n value: s.global_address_key,\n format: s.format,\n })) || [];\n setSuggestions(mapped);\n return mapped;\n }\n } catch {\n setSuggestions([]);\n return [];\n }\n },\n [provider, api_key, countryISO, experian]\n );\n\n const onPickAddress = useCallback(\n async (event: any, rawItem?: any) => {\n // rawItem is the full suggestion { label, value } passed as second arg by the hook\n const selected = rawItem ?? event;\n\n if (!selected) return;\n\n // WEB (PrimeReact) routes more than item objects through here:\n // typed text arrives as a plain STRING, and a forceSelection\n // blur-clear arrives as the raw change event with a null value.\n // Reading `selected[labelKey]` on those wiped the consumer's\n // controlled value with `undefined`. Pass strings through\n // verbatim; propagate a clear as ''. Native only ever sends item\n // objects, so both branches are no-ops there.\n if (typeof selected === \"string\") {\n onChange?.({target: {value: selected}} as any);\n return;\n }\n if (!(valueKey in selected)) {\n onChange?.({\n target: {value: selected?.target?.value ?? \"\"},\n } as any);\n return;\n }\n\n const placeId = selected[valueKey];\n\n onChange?.({\n target: {value: selected[labelKey]},\n } as any);\n\n if (!onAddressClick || !placeId) return;\n\n if (provider === \"google\") {\n // Web blur-path: forceSelection re-selects the appended\n // details suggestion (same placeId + committed label) — the\n // consumer already has this address; don't refetch details.\n const last = lastCommittedRef.current;\n if (last && last.placeId === placeId && last.label === selected[labelKey]) {\n return;\n }\n\n const details = await googleDetails(placeId, api_key);\n\n // Build rich address format: each component has a `long` and `short` value.\n const richAddress: Record<string, any> = {\n formatted_address: details.formattedAddress,\n place_id: placeId,\n latitude: details.latitude,\n longitude: details.longitude,\n };\n\n details.components.forEach((c) => {\n if (c.type && !(c.type in richAddress)) {\n richAddress[c.type] = {\n long: c.long,\n short: c.short,\n };\n }\n });\n\n // Places (New) details `formattedAddress` can differ from the\n // suggestion's label; consumers commit the details string into\n // the input (App contract). PrimeReact's forceSelection only\n // keeps blur values matching a CURRENT suggestion label, so\n // register the committed string as a valid suggestion — blur\n // then keeps the pick instead of clearing it. Freetext is\n // still rejected. Harmless on native (no blur validation; the\n // list is only visible mid-search).\n if (details.formattedAddress) {\n lastCommittedRef.current = {\n placeId,\n label: details.formattedAddress,\n };\n setSuggestions(prev =>\n prev.some(s => s.label === details.formattedAddress)\n ? prev\n : [...prev, {label: details.formattedAddress, value: placeId}],\n );\n }\n\n onAddressClick(richAddress);\n } else {\n const res = await experian?.formatAddress(placeId);\n if (res?.data?.result) { // @ts-ignore\n onAddressClick(res.data.result);\n }\n }\n },\n [\n provider,\n api_key,\n valueKey,\n labelKey,\n onChange,\n onAddressClick,\n experian,\n ]\n );\n\n return (\n <FormSelect\n ref={selectRef}\n id={id}\n shape=\"autocomplete\"\n value={value}\n label={label}\n placeholder={placeholder}\n labelKey={labelKey}\n valueKey={valueKey}\n onChange={onPickAddress}\n isMultiple={false}\n forceSelection\n completeMethod={search}\n list={suggestions}\n helperText={helperText}\n hideError={hideError}\n disabled={disabled}\n invalid={invalid}\n errors={errors}\n {...rest}\n />\n );\n};\n\nexport default KitsInputLocation;\n"],"names":["useRef","useState","useMemo","Experian","useCallback","googleAutocomplete","googleDetails","jsx","FormSelect"],"mappings":";;;;;;;;;;;AAmBA,MAAM,oBAAoB,CAAC;AAAA,EACI,EAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA,GAAa,KAAA;AAAA,EACb,UAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA,GAAW,OAAA;AAAA,EACX,QAAA,GAAW,OAAA;AAAA;AAAA,EAEX,GAAG;AACP,CAAA,KAA0B;AACjD,EAAA,IAAI,CAAC,OAAA,EAAS,MAAM,IAAI,MAAM,sBAAsB,CAAA;AAEpD,EAAA,MAAM,SAAA,GAAYA,aAAa,IAAI,CAAA;AACnC,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAIC,cAAA,CAAuB,EAAE,CAAA;AAG/D,EAAA,MAAM,gBAAA,GAAmBD,aAAgD,IAAI,CAAA;AAE7E,EAAA,MAAM,QAAA,GAAWE,aAAA;AAAA,IACb,MAAO,QAAA,KAAa,QAAA,GAAW,IAAIC,gBAAA,CAAS,OAAO,CAAA,GAAI,IAAA;AAAA,IACvD,CAAC,UAAU,OAAO;AAAA,GACtB;AAEA,EAAA,MAAM,MAAA,GAASC,iBAAA;AAAA,IACX,OAAO,KAAA,KAAyC;AAC5C,MAAA,IAAI,KAAA,CAAM,MAAA,GAAS,CAAA,EAAG,OAAO,EA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AAe,UACX,IAAA,CAAK,IAAA,CAAK,OAAK,CAAA,CAAE,KAAA,KAAU,QAAQ,gBAAgB,CAAA,GAC7C,OACA,CAAC,GAAG,MAAM,EAAC,KAAA,EAAO,QAAQ,gBAAA,EAAkB,KAAA,EAAO,SAAQ;AAAA,WACrE;AAAA,QACJ;AAEA,QAAA,cAAA,CAAe,WAAW,CAAA;AAAA,MAC9B,CAAA,MAAO;AACH,QAAA,MAAM,GAAA,GAAM,MAAM,QAAA,EAAU,aAAA,CAAc,OAAO,CAAA;AACjD,QAAA,IAAI,GAAA,EAAK,MAAM,MAAA,EAAQ;AACnB,UAAA,cAAA,CAAe,GAAA,CAAI,KAAK,MAAM,CAAA;AAAA,QAClC;AAAA,MACJ;AAAA,IACJ,CAAA;AAAA,IACA;AAAA,MACI,QAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA;AACJ,GACJ;AAEA,EAAA,uBACIC,cAAA;AAAA,IAACC,qBAAA;AAAA,IAAA;AAAA,MACG,GAAA,EAAK,SAAA;AAAA,MACL,EAAA;AAAA,MACA,KAAA,EAAM,cAAA;AAAA,MACN,KAAA;AAAA,MACA,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA,EAAU,aAAA;AAAA,MACV,UAAA,EAAY,KAAA;AAAA,MACZ,cAAA,EAAc,IAAA;AAAA,MACd,cAAA,EAAgB,MAAA;AAAA,MAChB,IAAA,EAAM,WAAA;AAAA,MACN,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACR;AAER;;;;"}
@@ -28,6 +28,7 @@ const KitsInputLocation = ({
28
28
  if (!api_key) throw new Error("API KEY NOT PROVIDED");
29
29
  const selectRef = useRef(null);
30
30
  const [suggestions, setSuggestions] = useState([]);
31
+ const lastCommittedRef = useRef(null);
31
32
  const experian = useMemo(
32
33
  () => provider !== "google" ? new Experian(api_key) : null,
33
34
  [provider, api_key]
@@ -61,12 +62,26 @@ const KitsInputLocation = ({
61
62
  async (event, rawItem) => {
62
63
  const selected = rawItem ?? event;
63
64
  if (!selected) return;
65
+ if (typeof selected === "string") {
66
+ onChange?.({ target: { value: selected } });
67
+ return;
68
+ }
69
+ if (!(valueKey in selected)) {
70
+ onChange?.({
71
+ target: { value: selected?.target?.value ?? "" }
72
+ });
73
+ return;
74
+ }
64
75
  const placeId = selected[valueKey];
65
76
  onChange?.({
66
77
  target: { value: selected[labelKey] }
67
78
  });
68
79
  if (!onAddressClick || !placeId) return;
69
80
  if (provider === "google") {
81
+ const last = lastCommittedRef.current;
82
+ if (last && last.placeId === placeId && last.label === selected[labelKey]) {
83
+ return;
84
+ }
70
85
  const details = await googleDetails(placeId, api_key);
71
86
  const richAddress = {
72
87
  formatted_address: details.formattedAddress,
@@ -82,6 +97,15 @@ const KitsInputLocation = ({
82
97
  };
83
98
  }
84
99
  });
100
+ if (details.formattedAddress) {
101
+ lastCommittedRef.current = {
102
+ placeId,
103
+ label: details.formattedAddress
104
+ };
105
+ setSuggestions(
106
+ (prev) => prev.some((s) => s.label === details.formattedAddress) ? prev : [...prev, { label: details.formattedAddress, value: placeId }]
107
+ );
108
+ }
85
109
  onAddressClick(richAddress);
86
110
  } else {
87
111
  const res = await experian?.formatAddress(placeId);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/form/inputs/InputLocation/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from \"react\";\nimport Experian from \"./Experian\";\nimport type {IKitsInputLocation, IRef} from \"@lmb-it/kitsconcerto-types\";\nimport {FormSelect} from \"../../../_compat\";\n// Platform-forked Google transport: legacy Web Service on native (no CORS in\n// RN), Places API (New) on web (`googlePlaces.web.ts`) — the legacy endpoints\n// are server-side-only and browsers block them. Same normalized contract on\n// both sides, so the Suggestion / IAddressFormat output is unchanged.\nimport {googleAutocomplete, googleDetails} from \"./googlePlaces\";\n\ntype Suggestion = {\n label: string;\n value: string;\n format?: string;\n};\n\nconst KitsInputLocation = ({\n id,\n label,\n errors,\n invalid,\n value,\n hideError,\n onAddressClick,\n onChange,\n disabled,\n placeholder,\n countryISO = \"AUS\",\n helperText,\n provider,\n api_key,\n labelKey = \"label\",\n valueKey = \"value\",\n // list,\n ...rest\n }: IKitsInputLocation) => {\n if (!api_key) throw new Error(\"API KEY NOT PROVIDED\");\n\n const selectRef = useRef<IRef>(null);\n const [suggestions, setSuggestions] = useState<Suggestion[]>([]);\n\n const experian = useMemo(\n () => (provider !== \"google\" ? new Experian(api_key) : null),\n [provider, api_key]\n );\n\n const search = useCallback(\n async (query: string): Promise<Suggestion[]> => {\n if (query.length < 4) return [];\n\n try {\n if (provider === \"google\") {\n const mapped = await googleAutocomplete(query, api_key, countryISO);\n setSuggestions(mapped);\n return mapped;\n } else {\n const res = await experian?.searchAddress(query, countryISO);\n const mapped = res?.data?.result?.suggestions?.map((s: any) => ({\n label: s.text,\n value: s.global_address_key,\n format: s.format,\n })) || [];\n setSuggestions(mapped);\n return mapped;\n }\n } catch {\n setSuggestions([]);\n return [];\n }\n },\n [provider, api_key, countryISO, experian]\n );\n\n const onPickAddress = useCallback(\n async (event: any, rawItem?: any) => {\n // rawItem is the full suggestion { label, value } passed as second arg by the hook\n const selected = rawItem ?? event;\n\n if (!selected) return;\n\n const placeId = selected[valueKey];\n\n onChange?.({\n target: {value: selected[labelKey]},\n } as any);\n\n if (!onAddressClick || !placeId) return;\n\n if (provider === \"google\") {\n const details = await googleDetails(placeId, api_key);\n\n // Build rich address format: each component has a `long` and `short` value.\n const richAddress: Record<string, any> = {\n formatted_address: details.formattedAddress,\n place_id: placeId,\n latitude: details.latitude,\n longitude: details.longitude,\n };\n\n details.components.forEach((c) => {\n if (c.type && !(c.type in richAddress)) {\n richAddress[c.type] = {\n long: c.long,\n short: c.short,\n };\n }\n });\n\n onAddressClick(richAddress);\n } else {\n const res = await experian?.formatAddress(placeId);\n if (res?.data?.result) { // @ts-ignore\n onAddressClick(res.data.result);\n }\n }\n },\n [\n provider,\n api_key,\n valueKey,\n labelKey,\n onChange,\n onAddressClick,\n experian,\n ]\n );\n\n return (\n <FormSelect\n ref={selectRef}\n id={id}\n shape=\"autocomplete\"\n value={value}\n label={label}\n placeholder={placeholder}\n labelKey={labelKey}\n valueKey={valueKey}\n onChange={onPickAddress}\n isMultiple={false}\n forceSelection\n completeMethod={search}\n list={suggestions}\n helperText={helperText}\n hideError={hideError}\n disabled={disabled}\n invalid={invalid}\n errors={errors}\n {...rest}\n />\n );\n};\n\nexport default KitsInputLocation;\n"],"names":[],"mappings":";;;;;;;AAgBA,MAAM,oBAAoB,CAAC;AAAA,EACI,EAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA,GAAa,KAAA;AAAA,EACb,UAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA,GAAW,OAAA;AAAA,EACX,QAAA,GAAW,OAAA;AAAA;AAAA,EAEX,GAAG;AACP,CAAA,KAA0B;AACjD,EAAA,IAAI,CAAC,OAAA,EAAS,MAAM,IAAI,MAAM,sBAAsB,CAAA;AAEpD,EAAA,MAAM,SAAA,GAAY,OAAa,IAAI,CAAA;AACnC,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,QAAA,CAAuB,EAAE,CAAA;AAE/D,EAAA,MAAM,QAAA,GAAW,OAAA;AAAA,IACb,MAAO,QAAA,KAAa,QAAA,GAAW,IAAI,QAAA,CAAS,OAAO,CAAA,GAAI,IAAA;AAAA,IACvD,CAAC,UAAU,OAAO;AAAA,GACtB;AAEA,EAAA,MAAM,MAAA,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A;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA,EAAU,aAAA;AAAA,MACV,UAAA,EAAY,KAAA;AAAA,MACZ,cAAA,EAAc,IAAA;AAAA,MACd,cAAA,EAAgB,MAAA;AAAA,MAChB,IAAA,EAAM,WAAA;AAAA,MACN,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACR;AAER;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/form/inputs/InputLocation/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from \"react\";\nimport Experian from \"./Experian\";\nimport type {IKitsInputLocation, IRef} from \"@lmb-it/kitsconcerto-types\";\nimport {FormSelect} from \"../../../_compat\";\n// Platform-forked Google transport: legacy Web Service on native\n// (`googlePlaces.native.ts` — RN has no CORS), Places API (New) on web\n// (`googlePlaces.web.ts` — browsers block the legacy endpoints). Same\n// normalized contract on both sides (`googlePlaces.types.ts`), so the\n// Suggestion / IAddressFormat output is unchanged. There is deliberately NO\n// bare `googlePlaces.ts` — a bare sibling wins resolution over the platform\n// files and ships the wrong transport (the v0.1.238 regression).\nimport {googleAutocomplete, googleDetails} from \"./googlePlaces\";\n\ntype Suggestion = {\n label: string;\n value: string;\n format?: string;\n};\n\nconst KitsInputLocation = ({\n id,\n label,\n errors,\n invalid,\n value,\n hideError,\n onAddressClick,\n onChange,\n disabled,\n placeholder,\n countryISO = \"AUS\",\n helperText,\n provider,\n api_key,\n labelKey = \"label\",\n valueKey = \"value\",\n // list,\n ...rest\n }: IKitsInputLocation) => {\n if (!api_key) throw new Error(\"API KEY NOT PROVIDED\");\n\n const selectRef = useRef<IRef>(null);\n const [suggestions, setSuggestions] = useState<Suggestion[]>([]);\n // Last committed pick (set after details resolve). Lets the web blur-path\n // re-selection (see onPickAddress) skip a duplicate details fetch.\n const lastCommittedRef = useRef<{placeId: string; label: string} | null>(null);\n\n const experian = useMemo(\n () => (provider !== \"google\" ? new Experian(api_key) : null),\n [provider, api_key]\n );\n\n const search = useCallback(\n async (query: string): Promise<Suggestion[]> => {\n if (query.length < 4) return [];\n\n try {\n if (provider === \"google\") {\n const mapped = await googleAutocomplete(query, api_key, countryISO);\n setSuggestions(mapped);\n return mapped;\n } else {\n const res = await experian?.searchAddress(query, countryISO);\n const mapped = res?.data?.result?.suggestions?.map((s: any) => ({\n label: s.text,\n value: s.global_address_key,\n format: s.format,\n })) || [];\n setSuggestions(mapped);\n return mapped;\n }\n } catch {\n setSuggestions([]);\n return [];\n }\n },\n [provider, api_key, countryISO, experian]\n );\n\n const onPickAddress = useCallback(\n async (event: any, rawItem?: any) => {\n // rawItem is the full suggestion { label, value } passed as second arg by the hook\n const selected = rawItem ?? event;\n\n if (!selected) return;\n\n // WEB (PrimeReact) routes more than item objects through here:\n // typed text arrives as a plain STRING, and a forceSelection\n // blur-clear arrives as the raw change event with a null value.\n // Reading `selected[labelKey]` on those wiped the consumer's\n // controlled value with `undefined`. Pass strings through\n // verbatim; propagate a clear as ''. Native only ever sends item\n // objects, so both branches are no-ops there.\n if (typeof selected === \"string\") {\n onChange?.({target: {value: selected}} as any);\n return;\n }\n if (!(valueKey in selected)) {\n onChange?.({\n target: {value: selected?.target?.value ?? \"\"},\n } as any);\n return;\n }\n\n const placeId = selected[valueKey];\n\n onChange?.({\n target: {value: selected[labelKey]},\n } as any);\n\n if (!onAddressClick || !placeId) return;\n\n if (provider === \"google\") {\n // Web blur-path: forceSelection re-selects the appended\n // details suggestion (same placeId + committed label) — the\n // consumer already has this address; don't refetch details.\n const last = lastCommittedRef.current;\n if (last && last.placeId === placeId && last.label === selected[labelKey]) {\n return;\n }\n\n const details = await googleDetails(placeId, api_key);\n\n // Build rich address format: each component has a `long` and `short` value.\n const richAddress: Record<string, any> = {\n formatted_address: details.formattedAddress,\n place_id: placeId,\n latitude: details.latitude,\n longitude: details.longitude,\n };\n\n details.components.forEach((c) => {\n if (c.type && !(c.type in richAddress)) {\n richAddress[c.type] = {\n long: c.long,\n short: c.short,\n };\n }\n });\n\n // Places (New) details `formattedAddress` can differ from the\n // suggestion's label; consumers commit the details string into\n // the input (App contract). PrimeReact's forceSelection only\n // keeps blur values matching a CURRENT suggestion label, so\n // register the committed string as a valid suggestion — blur\n // then keeps the pick instead of clearing it. Freetext is\n // still rejected. Harmless on native (no blur validation; the\n // list is only visible mid-search).\n if (details.formattedAddress) {\n lastCommittedRef.current = {\n placeId,\n label: details.formattedAddress,\n };\n setSuggestions(prev =>\n prev.some(s => s.label === details.formattedAddress)\n ? prev\n : [...prev, {label: details.formattedAddress, value: placeId}],\n );\n }\n\n onAddressClick(richAddress);\n } else {\n const res = await experian?.formatAddress(placeId);\n if (res?.data?.result) { // @ts-ignore\n onAddressClick(res.data.result);\n }\n }\n },\n [\n provider,\n api_key,\n valueKey,\n labelKey,\n onChange,\n onAddressClick,\n experian,\n ]\n );\n\n return (\n <FormSelect\n ref={selectRef}\n id={id}\n shape=\"autocomplete\"\n value={value}\n label={label}\n placeholder={placeholder}\n labelKey={labelKey}\n valueKey={valueKey}\n onChange={onPickAddress}\n isMultiple={false}\n forceSelection\n completeMethod={search}\n list={suggestions}\n helperText={helperText}\n hideError={hideError}\n disabled={disabled}\n invalid={invalid}\n errors={errors}\n {...rest}\n />\n );\n};\n\nexport default KitsInputLocation;\n"],"names":[],"mappings":";;;;;;;AAmBA,MAAM,oBAAoB,CAAC;AAAA,EACI,EAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA,GAAa,KAAA;AAAA,EACb,UAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA,GAAW,OAAA;AAAA,EACX,QAAA,GAAW,OAAA;A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UAAA;AAAA,IAAA;AAAA,MACG,GAAA,EAAK,SAAA;AAAA,MACL,EAAA;AAAA,MACA,KAAA,EAAM,cAAA;AAAA,MACN,KAAA;AAAA,MACA,KAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA,EAAU,aAAA;AAAA,MACV,UAAA,EAAY,KAAA;AAAA,MACZ,cAAA,EAAc,IAAA;AAAA,MACd,cAAA,EAAgB,MAAA;AAAA,MAChB,IAAA,EAAM,WAAA;AAAA,MACN,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACR;AAER;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmb-it/kitsconcerto-native",
3
- "version": "0.1.238",
3
+ "version": "0.1.240",
4
4
  "description": "KitsConcerto — Native (React Native) UI components",
5
5
  "main": "index.js",
6
6
  "module": "index.js",