PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
← All changes | resources/js/lib/countries.ts +22 -0 3.0.7 → 3.0.16 View file →
@@ -71,8 +71,30 @@
71 71 return Object.entries(map).map(([code, name]) => ({ code, name }));
72 72 }
73 73
74 74 /**
75 + * Country options shaped for SearchableSelect, each carrying its national flag.
76 + *
77 + * The flag base URL is localized by AdminAssetsProvider (`flagBase`), pointing at
78 + * the SVG set the plugin already ships and the phone widget already uses — one
79 + * source of flag assets for the whole product. Without that global the options
80 + * are returned flagless rather than with broken images.
81 + */
82 +export function getCountrySelectOptions(): Array<{
83 + value: string;
84 + label: string;
85 + icon?: string;
86 +}> {
87 + const base = (window as any).yatraAdmin?.flagBase || "";
88 +
89 + return getCountryOptions().map((c) => ({
90 + value: c.code,
91 + label: c.name,
92 + icon: base ? base + c.code.toLowerCase() + ".svg" : undefined,
93 + }));
94 +}
95 +
96 +/**
75 97 * Look up a single country's display name by ISO-3166 code.
76 98 * Returns the code itself when unknown — same fallback the PHP
77 99 * helper uses, so the two never disagree on rendering.
78 100 */