@gomusdev/web-components 1.8.3 → 1.8.4
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.
|
@@ -11012,7 +11012,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11012
11012
|
class Shop {
|
|
11013
11013
|
constructor(apiUrl, shopDomain, locale, type = "angular") {
|
|
11014
11014
|
__privateAdd(this, _Shop_instances);
|
|
11015
|
-
__privateAdd(this, _data2, /* @__PURE__ */ state(proxy({ customerSalutations: [], countries: [] })));
|
|
11015
|
+
__privateAdd(this, _data2, /* @__PURE__ */ state(proxy({ customerSalutations: [], countries: [], locales: [] })));
|
|
11016
11016
|
// Holds the fetch status and timestamp for data requests, tracking whether the request is ongoing or completed and when it was completed.
|
|
11017
11017
|
__privateAdd(this, _fetchStatus, {});
|
|
11018
11018
|
__privateAdd(this, _canFetch, () => {
|
|
@@ -11212,6 +11212,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11212
11212
|
get countries() {
|
|
11213
11213
|
return this.fetchAndCache("/api/v3/countries", "countries", "countries");
|
|
11214
11214
|
}
|
|
11215
|
+
get locales() {
|
|
11216
|
+
return this.fetchAndCache("/api/v4/locales", "locales", "locales_options");
|
|
11217
|
+
}
|
|
11215
11218
|
get urls() {
|
|
11216
11219
|
return get(__privateGet(this, _data2)).urls;
|
|
11217
11220
|
}
|
|
@@ -11400,10 +11403,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11400
11403
|
placeholder: "",
|
|
11401
11404
|
description: "",
|
|
11402
11405
|
autocomplete: "language",
|
|
11403
|
-
options: () =>
|
|
11404
|
-
{ value: 1, label: "German" },
|
|
11405
|
-
{ value: 5, label: "English" }
|
|
11406
|
-
]
|
|
11406
|
+
options: () => shop.locales.map((c) => ({ label: c.locale, value: c.id }))
|
|
11407
11407
|
},
|
|
11408
11408
|
acceptTerms: {
|
|
11409
11409
|
key: "acceptTerms",
|
|
@@ -11012,7 +11012,7 @@ function formatDate(isoDateString, options = {
|
|
|
11012
11012
|
class Shop {
|
|
11013
11013
|
constructor(apiUrl, shopDomain, locale, type = "angular") {
|
|
11014
11014
|
__privateAdd(this, _Shop_instances);
|
|
11015
|
-
__privateAdd(this, _data2, /* @__PURE__ */ state(proxy({ customerSalutations: [], countries: [] })));
|
|
11015
|
+
__privateAdd(this, _data2, /* @__PURE__ */ state(proxy({ customerSalutations: [], countries: [], locales: [] })));
|
|
11016
11016
|
// Holds the fetch status and timestamp for data requests, tracking whether the request is ongoing or completed and when it was completed.
|
|
11017
11017
|
__privateAdd(this, _fetchStatus, {});
|
|
11018
11018
|
__privateAdd(this, _canFetch, () => {
|
|
@@ -11212,6 +11212,9 @@ class Shop {
|
|
|
11212
11212
|
get countries() {
|
|
11213
11213
|
return this.fetchAndCache("/api/v3/countries", "countries", "countries");
|
|
11214
11214
|
}
|
|
11215
|
+
get locales() {
|
|
11216
|
+
return this.fetchAndCache("/api/v4/locales", "locales", "locales_options");
|
|
11217
|
+
}
|
|
11215
11218
|
get urls() {
|
|
11216
11219
|
return get(__privateGet(this, _data2)).urls;
|
|
11217
11220
|
}
|
|
@@ -11400,10 +11403,7 @@ var allFields = {
|
|
|
11400
11403
|
placeholder: "",
|
|
11401
11404
|
description: "",
|
|
11402
11405
|
autocomplete: "language",
|
|
11403
|
-
options: () =>
|
|
11404
|
-
{ value: 1, label: "German" },
|
|
11405
|
-
{ value: 5, label: "English" }
|
|
11406
|
-
]
|
|
11406
|
+
options: () => shop.locales.map((c) => ({ label: c.locale, value: c.id }))
|
|
11407
11407
|
},
|
|
11408
11408
|
acceptTerms: {
|
|
11409
11409
|
key: "acceptTerms",
|
|
@@ -3,7 +3,7 @@ import { ShopUrls } from '../helpers/urls';
|
|
|
3
3
|
import { User } from './user.svelte.ts';
|
|
4
4
|
import { OpenApiClient } from '@gomus/api';
|
|
5
5
|
import { TicketsAndQuotasParams, TicketsCalendarParams, TicketsParams } from '@gomus/api/lib/types.ts';
|
|
6
|
-
import { CheckoutParams, CheckoutResponse, Country, Event, Exhibition, Merchandise, Museum, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, Tour } from '@gomus/types';
|
|
6
|
+
import { CheckoutParams, CheckoutResponse, Country, Event, Exhibition, LocaleOptions, Merchandise, Museum, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, Tour } from '@gomus/types';
|
|
7
7
|
export type ShopKind = 'angular' | 'jmb';
|
|
8
8
|
export declare class Shop {
|
|
9
9
|
#private;
|
|
@@ -118,6 +118,7 @@ export declare class Shop {
|
|
|
118
118
|
urls?: ShopUrls;
|
|
119
119
|
customerSalutations?: Salutation[];
|
|
120
120
|
countries?: Country[];
|
|
121
|
+
locales?: LocaleOptions;
|
|
121
122
|
};
|
|
122
123
|
ticketsCalendar(params: TicketsCalendarParams): CalendarDates;
|
|
123
124
|
ticketsAndQuotas(params: TicketsAndQuotasParams): {
|
|
@@ -373,6 +374,10 @@ export declare class Shop {
|
|
|
373
374
|
id: number;
|
|
374
375
|
name: string;
|
|
375
376
|
}[];
|
|
377
|
+
get locales(): {
|
|
378
|
+
id: number;
|
|
379
|
+
locale: string;
|
|
380
|
+
}[];
|
|
376
381
|
get urls(): {
|
|
377
382
|
account: () => string;
|
|
378
383
|
annualTickets: () => string;
|