@gomusdev/web-components 3.8.3 → 3.10.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.
@@ -95,7 +95,7 @@ export declare class PersonalizationDetails {
95
95
  is_bmc_ticket?: boolean | undefined;
96
96
  } | undefined;
97
97
  get isBmcTicket(): Boolean;
98
- goToPersonalization(ticketSale: TicketSale): any;
98
+ goToPersonalization(ticketSale: TicketSale): string;
99
99
  }
100
100
  export declare const setPersonalizationDetails: (host: HTMLElement, details: PersonalizationDetails) => void;
101
101
  export declare const getPersonalizationDetails: (host: HTMLElement, options?: {
@@ -3,6 +3,7 @@ export declare function createMockUITicket(): {
3
3
  type: "Ticket";
4
4
  subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
5
5
  shop_order: number;
6
+ content: import('@gomus/types').TicketContent | undefined;
6
7
  id: number;
7
8
  title: string;
8
9
  ticket_type: "time_slot" | "annual" | "normal";
@@ -67,6 +68,7 @@ export declare function createMockUITicket(): {
67
68
  type: "Ticket";
68
69
  subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
69
70
  shop_order: number;
71
+ content: import('@gomus/types').TicketContent | undefined;
70
72
  id: number;
71
73
  title: string;
72
74
  ticket_type: "time_slot" | "annual" | "normal";
@@ -123,6 +125,7 @@ export declare function createMockUITicket(): {
123
125
  type: "Ticket";
124
126
  subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
125
127
  shop_order: number;
128
+ content: import('@gomus/types').TicketContent | undefined;
126
129
  id: number;
127
130
  title: string;
128
131
  ticket_type: "time_slot" | "annual" | "normal";
@@ -14,10 +14,13 @@ export declare class Forms {
14
14
  static defineForm(options: defineFormOptions): void;
15
15
  static defineFields(fields: Record<string, FieldInit>): void;
16
16
  static setRequiredApiKeys(formId: string, requiredApiKeys: string[]): void;
17
- static getFormOptions(formId: string): any;
17
+ static getFormOptions(formId: string): import('../../../../config/configStore.svelte.ts').FormConfig;
18
18
  static createField(key: string, required: boolean): Field;
19
- static getFormFields(formId: string): any;
20
- static getFieldInit(key: string): any;
19
+ static getFormFields(formId: string): {
20
+ key: string;
21
+ required: boolean;
22
+ }[];
23
+ static getFieldInit(key: string): FieldInit;
21
24
  }
22
25
  /**
23
26
  * Calculates the number of fields that are mounted and have errors.
@@ -1,5 +1,21 @@
1
+ import { SegmentDetails } from '../../../../components/ticketSelection/subcomponents/tickets/subcomponents/segment/SegmentDetails.svelte.ts';
1
2
  import { TicketSelectionDetails } from '../../../../components/ticketSelection/TicketSelectionDetails.svelte.ts';
3
+ import { UITicket } from '../../../../lib/models/ticket/UITicket.svelte.ts';
2
4
  import { DateDetails, Quotas } from '@gomus/types';
5
+ /**
6
+ * When a segment opts into content attributes (with-content), batch-fetch
7
+ * tickets/content for the given tickets and merge each entry's `content` onto
8
+ * the matching ticket by id (mirrors the legacy `ticket.content = item.content`).
9
+ * Mutates the tickets in place; call before adding them to the preCart so the
10
+ * content is present on first render. No-op — and no request — when the segment
11
+ * hasn't enabled the feature or there are no tickets to enrich.
12
+ *
13
+ * Best-effort: the content is an optional, additive sidecar, so a failed or
14
+ * absent fetch degrades to "no info buttons" and must never empty the ticket
15
+ * list (see audit finding IB-01). Note this does NOT cover a hung request — a
16
+ * never-settling fetch is a separate core-infra concern (IB-05).
17
+ */
18
+ export declare function enrichTicketsWithContent(segment: SegmentDetails, tickets: UITicket[]): Promise<void>;
3
19
  /**
4
20
  * Load quotas fetched by a filter's loadTimeslots into the shared quota store and
5
21
  * record which ticket ids this selection loaded for its picker. timeslotsOn() reads
@@ -140,6 +140,7 @@ export declare class SegmentDetails {
140
140
  languageIds: number[] | undefined;
141
141
  catchWordIds: number[] | undefined;
142
142
  museumIds: number[] | undefined;
143
+ withContent: boolean;
143
144
  constructor(filters: TicketSegmentFilter | TicketSegmentFilter[] | undefined, tsdWrapper: DetailsWrapper<TicketSelectionDetails>);
144
145
  get effectiveFilters(): TicketSegmentFilter[];
145
146
  clear(): void;
@@ -13,6 +13,11 @@ export type ConfigOptions = {
13
13
  navigateTo?: (url: string) => void;
14
14
  forms?: Record<string, FormConfig>;
15
15
  fields?: Record<string, FieldInit>;
16
+ /**
17
+ * Render quantities in `go-tickets` / `go-cart` with the `− qty +` stepper
18
+ * (default). Set to `false` to keep the legacy `<select>` control.
19
+ */
20
+ quantityStepper?: boolean;
16
21
  };
17
22
  declare class ConfigStoreSvelte {
18
23
  private defaultConfig;
@@ -20,7 +25,7 @@ declare class ConfigStoreSvelte {
20
25
  private options;
21
26
  constructor();
22
27
  private update;
23
- get config(): {};
28
+ get config(): Required<ConfigOptions>;
24
29
  define(options: ConfigOptions): this;
25
30
  default(options: ConfigOptions): this;
26
31
  }
@@ -249,6 +249,8 @@ export declare const translations: {
249
249
  'product.list.filters.museum': string;
250
250
  'product.list.tours.subTitle': null;
251
251
  'product.list.tours.title': string;
252
+ 'quantity.decrease': string;
253
+ 'quantity.increase': string;
252
254
  'search.result.subTitle': null;
253
255
  'search.result.title': string;
254
256
  'start.aria.header': string;
@@ -532,6 +534,7 @@ export declare const translations: {
532
534
  'ticket.annual.personalization.detail.newUser': string;
533
535
  'ticket.annual.personalization.list.notPersonalizable.title': string;
534
536
  'ticket.annual.personalization.list.personalize.empty': string;
537
+ 'ticket.list.additionalInfo': string;
535
538
  'ticket.list.filters.exhibition': string;
536
539
  'ticket.list.filters.museum': string;
537
540
  'ticket.list.special': string;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Pure transition logic for the quantity stepper (WI 44).
3
+ *
4
+ * The set of valid quantities is `{0} ∪ [min, max]`:
5
+ * - `0` means "none selected" (`go-tickets`) or a kept-but-empty line (`go-cart`).
6
+ * Reaching `0` never removes a cart line — the ✕ button does that.
7
+ * - any positive quantity must be at least `min` (a ticket's `min_persons`) and
8
+ * at most `max` (the per-ticket / cart-wide capacity).
9
+ *
10
+ * The same functions drive the +/− buttons and the ArrowUp / ArrowDown / Home /
11
+ * End keys so they can never disagree. There is deliberately no `floor`
12
+ * parameter: both call sites bottom out at `0`.
13
+ */
14
+ export type QuantityBounds = {
15
+ min: number;
16
+ max: number;
17
+ };
18
+ /** `+`: from `0` jump to the order minimum (at least `1`); otherwise step up by one. Capped at `max`. */
19
+ export declare function increment(value: number, { min, max }: QuantityBounds): number;
20
+ /** `−`: from the order minimum drop straight to `0` (skipping the invalid `1..min-1` band); otherwise step down by one. */
21
+ export declare function decrement(value: number, { min }: QuantityBounds): number;
22
+ /** Clamp a typed value into `{0} ∪ [min, max]`: `≤0` → `0`, `0<v<min` rounds up to `min`, `>max` → `max`. */
23
+ export declare function clampTyped(raw: number, { min, max }: QuantityBounds): number;
24
+ /** Whether `value` is a committable quantity for these bounds. */
25
+ export declare function isValid(value: number, { min, max }: QuantityBounds): boolean;
26
+ /** Whether `+` can change the value (false → the button is `aria-disabled`). */
27
+ export declare function canIncrement(value: number, bounds: QuantityBounds): boolean;
28
+ /** Whether `−` can change the value (false → the button is `aria-disabled`). */
29
+ export declare function canDecrement(value: number): boolean;
@@ -1,5 +1,5 @@
1
1
  import { BaseProduct } from '../../../../lib/models/cart/types.ts';
2
- import { AnnualTicket, NormalTickets, Ticket, Tickets } from '@gomus/types';
2
+ import { AnnualTicket, NormalTickets, Ticket, TicketContent, Tickets } from '@gomus/types';
3
3
  interface Options {
4
4
  selectedTime?: string;
5
5
  }
@@ -11,6 +11,7 @@ export declare function createUITicket(apiTicket: Ticket | AnnualTicket | Normal
11
11
  type: "Ticket";
12
12
  subtype: UITicketType;
13
13
  shop_order: number;
14
+ content: TicketContent | undefined;
14
15
  id: number;
15
16
  title: string;
16
17
  ticket_type: "time_slot" | "annual" | "normal";
@@ -75,6 +76,7 @@ export declare function createUITicket(apiTicket: Ticket | AnnualTicket | Normal
75
76
  type: "Ticket";
76
77
  subtype: UITicketType;
77
78
  shop_order: number;
79
+ content: TicketContent | undefined;
78
80
  id: number;
79
81
  title: string;
80
82
  ticket_type: "time_slot" | "annual" | "normal";
@@ -131,6 +133,7 @@ export declare function createUITicket(apiTicket: Ticket | AnnualTicket | Normal
131
133
  type: "Ticket";
132
134
  subtype: UITicketType;
133
135
  shop_order: number;
136
+ content: TicketContent | undefined;
134
137
  id: number;
135
138
  title: string;
136
139
  ticket_type: "time_slot" | "annual" | "normal";
@@ -6,7 +6,7 @@ import { Auth } from '../../../lib/stores/auth.svelte.ts';
6
6
  import { User } from '../../../lib/stores/user.svelte.ts';
7
7
  import { OpenApiClient } from '@gomus/api';
8
8
  import { TicketsAndQuotasParams, TicketsCalendarParams, TicketsParams } from '@gomus/api/lib/types.ts';
9
- import { CapacitiesResponse, CheckoutParams, CheckoutResponse, Country, Event, Exhibition, FinalizePersonalizationParams, FinalizePersonalizationResponse, LocaleOptions, Merchandise, Museum, PasswordResetResponse, PasswordUpdateResponse, PostCartParams, PostCartResponse, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, Tour, UploadPersonalizationPhotoResponse, ValidateTokenResponse, WithdrawalParams, WithdrawalResponse } from '@gomus/types';
9
+ import { CapacitiesResponse, CheckoutParams, CheckoutResponse, Country, Event, Exhibition, FinalizePersonalizationParams, FinalizePersonalizationResponse, LocaleOptions, Merchandise, Museum, PasswordResetResponse, PasswordUpdateResponse, PostCartParams, PostCartResponse, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, TicketContentEntry, Tour, UploadPersonalizationPhotoResponse, ValidateTokenResponse, WithdrawalParams, WithdrawalResponse } from '@gomus/types';
10
10
  export type ShopKind = 'angular' | 'jmb';
11
11
  type ParseAs = 'json' | 'text' | 'blob' | 'arrayBuffer' | 'stream';
12
12
  export declare class Shop {
@@ -379,6 +379,7 @@ export declare class Shop {
379
379
  [key: string]: number;
380
380
  } | null;
381
381
  }[];
382
+ ticketsContent(ticketIds: number[]): TicketContentEntry[];
382
383
  signIn(params: SignInParams): Promise<SignInResponse>;
383
384
  signUp(params: SignUpParams, asGuest?: boolean): Promise<SignUpResponse>;
384
385
  withdrawal(params: WithdrawalParams): Promise<WithdrawalResponse>;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "Giantmonkey GmbH"
5
5
  },
6
6
  "license": "MIT",
7
- "version": "3.8.3",
7
+ "version": "3.10.0",
8
8
  "type": "module",
9
9
  "main": "./dist-js/gomus-webcomponents.iife.js",
10
10
  "module": "./dist-js/gomus-webcomponents.iife.js",