@gomusdev/web-components 3.9.0 → 3.10.1
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.
- package/README.md +16 -0
- package/dist-js/components/shared/quantityStepper/QuantityStepper.svelte.d.ts +1 -0
- package/dist-js/gomus-webcomponents.css +165 -5
- package/dist-js/gomus-webcomponents.iife.js +341 -59
- package/dist-js/gomus-webcomponents.js +341 -59
- package/dist-js/gomus-webcomponents.min.css +1 -1
- package/dist-js/gomus-webcomponents.min.iife.js +45 -45
- package/dist-js/gomus-webcomponents.min.js +6949 -6735
- package/dist-js/src/components/annualTicketPersonalization/lib/PersonalizationDetails.svelte.d.ts +1 -1
- package/dist-js/src/components/forms/lib/Forms.svelte.d.ts +6 -3
- package/dist-js/src/components/shared/quantityStepper/QuantityStepper.spec.d.ts +1 -0
- package/dist-js/src/config/configStore.svelte.d.ts +6 -1
- package/dist-js/src/lib/helpers/translations.d.ts +2 -0
- package/dist-js/src/lib/models/cart/quantityStepper.d.ts +29 -0
- package/dist-js/src/lib/models/cart/quantityStepper.spec.d.ts +1 -0
- package/package.json +1 -1
package/dist-js/src/components/annualTicketPersonalization/lib/PersonalizationDetails.svelte.d.ts
CHANGED
|
@@ -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):
|
|
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?: {
|
|
@@ -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):
|
|
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):
|
|
20
|
-
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|