@dyedurham/search-and-file-widget 2.0.36 → 2.0.37

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.
@@ -58086,10 +58086,22 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
58086
58086
  const province = data[FormationFormControls.Province];
58087
58087
  const city = data[FormationFormControls.City];
58088
58088
  const postalCode = data[FormationFormControls.PostalCode];
58089
- const country = data[FormationFormControls.Country];
58089
+ const country = getCountryDisplayName(data[FormationFormControls.Country] || data[FormationFormControls.CountryCode]);
58090
58090
  const countrySummary = [city, province, postalCode, country].filter(Boolean).join(", ");
58091
58091
  return `${[unitSummary, streetSummary, countrySummary].filter(Boolean).join(", ")}`;
58092
58092
  }
58093
+ function getCountryDisplayName(country) {
58094
+ const value = country?.trim();
58095
+ if (!value) {
58096
+ return "";
58097
+ }
58098
+ const codeMatch = Object.entries(countryCodes).find(([, code]) => code.toLowerCase() === value.toLowerCase());
58099
+ return codeMatch?.[0] ?? value;
58100
+ }
58101
+ function getCountryListPreview(value, t) {
58102
+ const countries = (value ?? "").split(",").map((country) => getCountryDisplayName(country)).filter(Boolean);
58103
+ return countries.length ? countries.join(", ") : t ? t("Not specified") : "Not specified";
58104
+ }
58093
58105
  function getContactDetailsPreview(email, phone, t) {
58094
58106
  const details = [email, phone].filter((value) => Boolean(value?.trim()));
58095
58107
  if (details.length) {
@@ -58191,6 +58203,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
58191
58203
  init_common_enums();
58192
58204
  init_initial_return_enums();
58193
58205
  init_chip_type();
58206
+ init_common_constants();
58194
58207
  }
58195
58208
  });
58196
58209
 
@@ -83689,7 +83702,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
83689
83702
  },
83690
83703
  {
83691
83704
  type: FormType.Text,
83692
- dynamicLabel: (form, t) => `<span>${t("Countries Of Citizenship")}: ${form.get(FederalFormationFormControl.CountriesOfCitizenship)?.value}</span> </br> <span>${t("Countries Of Residence")}: ${form.get(FederalFormationFormControl.CountriesOfResidence)?.value}</span>`,
83705
+ dynamicLabel: (form, t) => `<span>${t("Countries Of Citizenship")}: ${getCountryListPreview(form.get(FederalFormationFormControl.CountriesOfCitizenship)?.value, t)}</span> </br> <span>${t("Countries Of Residence")}: ${getCountryListPreview(form.get(FederalFormationFormControl.CountriesOfResidence)?.value, t)}</span>`,
83693
83706
  formControlName: "",
83694
83707
  class: "span-12"
83695
83708
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyedurham/search-and-file-widget",
3
- "version": "2.0.36",
3
+ "version": "2.0.37",
4
4
  "description": "",
5
5
  "main": "dnd-filing-shell.js",
6
6
  "scripts": {