@gomusdev/web-components 4.12.0 → 4.13.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 +12 -0
- package/dist-js/gomus-webcomponents.iife.js +156 -115
- package/dist-js/gomus-webcomponents.js +156 -115
- package/dist-js/gomus-webcomponents.min.iife.js +46 -46
- package/dist-js/gomus-webcomponents.min.js +6290 -6261
- package/dist-js/src/components/shared/quantityStepper/quantityLabel.d.ts +3 -1
- package/dist-js/src/lib/stores/shop.formatters.spec.d.ts +1 -0
- package/dist-js/src/lib/stores/shop.svelte.d.ts +5 -4
- package/dist-js/src/lib/stores/shop.translate.spec.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6377,6 +6377,18 @@ function warnOnInvalidLocale(locale) {
|
|
|
6377
6377
|
console.warn(`[go] Invalid locale "${locale}" — not a valid BCP 47 language tag (use "de", "de-CH", "en", …). Price and date formatting will throw.`);
|
|
6378
6378
|
}
|
|
6379
6379
|
}
|
|
6380
|
+
var defaultTranslations_default = {
|
|
6381
|
+
en: {
|
|
6382
|
+
"quantity.remove": "Remove item",
|
|
6383
|
+
"quantity.remove.label": "✕",
|
|
6384
|
+
"cart.item.remove": "✕"
|
|
6385
|
+
},
|
|
6386
|
+
de: {
|
|
6387
|
+
"quantity.remove": "Artikel entfernen",
|
|
6388
|
+
"quantity.remove.label": "✕",
|
|
6389
|
+
"cart.item.remove": "✕"
|
|
6390
|
+
}
|
|
6391
|
+
};
|
|
6380
6392
|
//#endregion
|
|
6381
6393
|
//#region src/lib/helpers/urls.ts
|
|
6382
6394
|
var ANGULAR_URLS = {
|
|
@@ -11100,9 +11112,6 @@ function $d07e34cce18680fd$export$b21e0b124e224484(date, time) {
|
|
|
11100
11112
|
if (time) ({hour: hour, minute: minute, second: second, millisecond: millisecond} = time);
|
|
11101
11113
|
return new $2aaf608024c21ca1$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
|
|
11102
11114
|
}
|
|
11103
|
-
function $d07e34cce18680fd$export$d33f79e3ffc3dc83(dateTime) {
|
|
11104
|
-
return new $2aaf608024c21ca1$export$680ea196effce5f(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
|
|
11105
|
-
}
|
|
11106
11115
|
function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
|
|
11107
11116
|
if ($ad063034c8620db8$export$dbc69fd56b53d5e(date.calendar, calendar)) return date;
|
|
11108
11117
|
let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
|
|
@@ -11260,14 +11269,6 @@ function $435a2ceaa8778ed8$var$addTimeFields(time, duration) {
|
|
|
11260
11269
|
time.millisecond += duration.milliseconds || 0;
|
|
11261
11270
|
return $435a2ceaa8778ed8$var$balanceTime(time);
|
|
11262
11271
|
}
|
|
11263
|
-
function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
|
|
11264
|
-
let res = time.copy();
|
|
11265
|
-
$435a2ceaa8778ed8$var$addTimeFields(res, duration);
|
|
11266
|
-
return res;
|
|
11267
|
-
}
|
|
11268
|
-
function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
|
|
11269
|
-
return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
|
|
11270
|
-
}
|
|
11271
11272
|
function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
|
|
11272
11273
|
let mutable = value.copy();
|
|
11273
11274
|
switch (field) {
|
|
@@ -11549,46 +11550,6 @@ var $2aaf608024c21ca1$export$99faa760c7908e4f = class $2aaf608024c21ca1$export$9
|
|
|
11549
11550
|
return $ad063034c8620db8$export$68781ddf31c0090f(this, b);
|
|
11550
11551
|
}
|
|
11551
11552
|
};
|
|
11552
|
-
var $2aaf608024c21ca1$export$680ea196effce5f = class $2aaf608024c21ca1$export$680ea196effce5f {
|
|
11553
|
-
#type;
|
|
11554
|
-
constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
|
|
11555
|
-
this.hour = hour;
|
|
11556
|
-
this.minute = minute;
|
|
11557
|
-
this.second = second;
|
|
11558
|
-
this.millisecond = millisecond;
|
|
11559
|
-
$435a2ceaa8778ed8$export$7555de1e070510cb(this);
|
|
11560
|
-
}
|
|
11561
|
-
/** Returns a copy of this time. */ copy() {
|
|
11562
|
-
return new $2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
|
|
11563
|
-
}
|
|
11564
|
-
/** Returns a new `Time` with the given duration added to it. */ add(duration) {
|
|
11565
|
-
return $435a2ceaa8778ed8$export$7ed87b6bc2506470(this, duration);
|
|
11566
|
-
}
|
|
11567
|
-
/** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
|
|
11568
|
-
return $435a2ceaa8778ed8$export$fe34d3a381cd7501(this, duration);
|
|
11569
|
-
}
|
|
11570
|
-
/**
|
|
11571
|
-
* Returns a new `Time` with the given fields set to the provided values. Other fields will be
|
|
11572
|
-
* constrained accordingly.
|
|
11573
|
-
*/ set(fields) {
|
|
11574
|
-
return $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(this, fields);
|
|
11575
|
-
}
|
|
11576
|
-
/**
|
|
11577
|
-
* Returns a new `Time` with the given field adjusted by a specified amount.
|
|
11578
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
11579
|
-
*/ cycle(field, amount, options) {
|
|
11580
|
-
return $435a2ceaa8778ed8$export$dd02b3e0007dfe28(this, field, amount, options);
|
|
11581
|
-
}
|
|
11582
|
-
/** Converts the time to an ISO 8601 formatted string. */ toString() {
|
|
11583
|
-
return $58246871e4652552$export$f59dee82248f5ad4(this);
|
|
11584
|
-
}
|
|
11585
|
-
/**
|
|
11586
|
-
* Compares this time with another. A negative result indicates that this time is before the given
|
|
11587
|
-
* one, and a positive time indicates that it is after.
|
|
11588
|
-
*/ compare(b) {
|
|
11589
|
-
return $ad063034c8620db8$export$c19a80a9721b80f6(this, b);
|
|
11590
|
-
}
|
|
11591
|
-
};
|
|
11592
11553
|
var $2aaf608024c21ca1$export$ca871e8dbb80966f = class $2aaf608024c21ca1$export$ca871e8dbb80966f {
|
|
11593
11554
|
#type;
|
|
11594
11555
|
constructor(...args) {
|
|
@@ -11813,19 +11774,31 @@ function $12a3c853105e5a70$var$getResolvedHourCycle(locale, options) {
|
|
|
11813
11774
|
}
|
|
11814
11775
|
//#endregion
|
|
11815
11776
|
//#region ../../packages/gomus-types/lib/helpers/utils.ts
|
|
11816
|
-
|
|
11817
|
-
|
|
11777
|
+
/** Named date presets — the single place defining what each rendering means (WI 151). */
|
|
11778
|
+
var DATE_FORMAT_PRESETS = {
|
|
11779
|
+
dayMonth: {
|
|
11780
|
+
month: "numeric",
|
|
11781
|
+
day: "numeric"
|
|
11782
|
+
},
|
|
11783
|
+
short: {
|
|
11784
|
+
year: "numeric",
|
|
11785
|
+
month: "numeric",
|
|
11786
|
+
day: "numeric"
|
|
11787
|
+
}
|
|
11788
|
+
};
|
|
11789
|
+
function formatTime(value, locale) {
|
|
11790
|
+
const zoned = $58246871e4652552$export$5adfdab05168c219(value, "Europe/Berlin");
|
|
11791
|
+
return new $12a3c853105e5a70$export$ad991b66133851cf(locale, {
|
|
11792
|
+
timeZone: zoned.timeZone,
|
|
11793
|
+
hour: "numeric",
|
|
11794
|
+
minute: "numeric"
|
|
11795
|
+
}).format(zoned.toDate());
|
|
11818
11796
|
}
|
|
11819
|
-
function formatDate(isoDateString,
|
|
11820
|
-
weekday: "long",
|
|
11821
|
-
year: "numeric",
|
|
11822
|
-
month: "long",
|
|
11823
|
-
day: "numeric"
|
|
11824
|
-
}, locale = "de") {
|
|
11797
|
+
function formatDate(isoDateString, preset, locale) {
|
|
11825
11798
|
const zoned = $58246871e4652552$export$5adfdab05168c219(isoDateString instanceof Date ? isoDateString.toISOString() : isoDateString, "Europe/Berlin");
|
|
11826
11799
|
return new $12a3c853105e5a70$export$ad991b66133851cf(locale, {
|
|
11827
11800
|
timeZone: zoned.timeZone,
|
|
11828
|
-
...
|
|
11801
|
+
...DATE_FORMAT_PRESETS[preset]
|
|
11829
11802
|
}).format(zoned.toDate());
|
|
11830
11803
|
}
|
|
11831
11804
|
//#endregion
|
|
@@ -13722,6 +13695,7 @@ var NOT_SIGNED_IN = { error: {
|
|
|
13722
13695
|
success: false,
|
|
13723
13696
|
errors: ["Not signed in"]
|
|
13724
13697
|
} };
|
|
13698
|
+
var defaultTranslations = defaultTranslations_default;
|
|
13725
13699
|
var Shop = class {
|
|
13726
13700
|
type;
|
|
13727
13701
|
#data = /* @__PURE__ */ state(proxy({
|
|
@@ -13789,7 +13763,10 @@ var Shop = class {
|
|
|
13789
13763
|
return this.shop?.config.donations;
|
|
13790
13764
|
}
|
|
13791
13765
|
get translations() {
|
|
13792
|
-
return
|
|
13766
|
+
return {
|
|
13767
|
+
...defaultTranslations[(this.locale ?? "en").toLowerCase().split(/[-_]/)[0]] ?? defaultTranslations.en,
|
|
13768
|
+
...this.shop?.translations
|
|
13769
|
+
};
|
|
13793
13770
|
}
|
|
13794
13771
|
get currency() {
|
|
13795
13772
|
return this.shop?.config.currency;
|
|
@@ -13813,7 +13790,13 @@ var Shop = class {
|
|
|
13813
13790
|
return "https://" + this.shopDomain;
|
|
13814
13791
|
}
|
|
13815
13792
|
get locale() {
|
|
13816
|
-
return get$2(this.#data).locale;
|
|
13793
|
+
return get$2(this.#data).locale ?? "de";
|
|
13794
|
+
}
|
|
13795
|
+
formatTime(value) {
|
|
13796
|
+
return formatTime(value, this.locale);
|
|
13797
|
+
}
|
|
13798
|
+
formatDate(value, preset) {
|
|
13799
|
+
return formatDate(value, preset, this.locale);
|
|
13817
13800
|
}
|
|
13818
13801
|
get shop() {
|
|
13819
13802
|
return this.fetchAndCache("/api/v4/shop", "shop", "shop");
|
|
@@ -15549,10 +15532,7 @@ function Event$2($$anchor, $$props) {
|
|
|
15549
15532
|
template_effect(($0, $1) => {
|
|
15550
15533
|
set_text(text_2, $0);
|
|
15551
15534
|
set_text(text_3, $1);
|
|
15552
|
-
}, [() => formatDate(cartItem().time,
|
|
15553
|
-
month: "numeric",
|
|
15554
|
-
day: "numeric"
|
|
15555
|
-
}, shop.locale), () => formatTime(cartItem().time)]);
|
|
15535
|
+
}, [() => shop.formatDate(cartItem().time, "dayMonth"), () => shop.formatTime(cartItem().time)]);
|
|
15556
15536
|
append($$anchor, fragment_1);
|
|
15557
15537
|
};
|
|
15558
15538
|
if_block(node, ($$render) => {
|
|
@@ -15611,16 +15591,13 @@ function Ticket($$anchor, $$props) {
|
|
|
15611
15591
|
var span_3 = root_1$19();
|
|
15612
15592
|
var text_3 = child(span_3, true);
|
|
15613
15593
|
reset(span_3);
|
|
15614
|
-
template_effect(($0) => set_text(text_3, $0), [() => formatTime(cartItem().time)]);
|
|
15594
|
+
template_effect(($0) => set_text(text_3, $0), [() => shop.formatTime(cartItem().time)]);
|
|
15615
15595
|
append($$anchor, span_3);
|
|
15616
15596
|
};
|
|
15617
15597
|
if_block(node_2, ($$render) => {
|
|
15618
15598
|
if (cartItem().product.type === "Ticket" && cartItem().product.subtype === "timeslot") $$render(consequent_1);
|
|
15619
15599
|
});
|
|
15620
|
-
template_effect(($0) => set_text(text_2, $0), [() => formatDate(cartItem().time,
|
|
15621
|
-
month: "numeric",
|
|
15622
|
-
day: "numeric"
|
|
15623
|
-
}, shop.locale)]);
|
|
15600
|
+
template_effect(($0) => set_text(text_2, $0), [() => shop.formatDate(cartItem().time, "dayMonth")]);
|
|
15624
15601
|
append($$anchor, fragment_1);
|
|
15625
15602
|
};
|
|
15626
15603
|
if_block(node_1, ($$render) => {
|
|
@@ -15645,12 +15622,8 @@ function Tour$1($$anchor, $$props) {
|
|
|
15645
15622
|
if (!cartItem().time) return null;
|
|
15646
15623
|
try {
|
|
15647
15624
|
return {
|
|
15648
|
-
date: formatDate(cartItem().time,
|
|
15649
|
-
|
|
15650
|
-
month: "numeric",
|
|
15651
|
-
day: "numeric"
|
|
15652
|
-
}, shop.locale),
|
|
15653
|
-
time: formatTime(cartItem().time)
|
|
15625
|
+
date: shop.formatDate(cartItem().time, "short"),
|
|
15626
|
+
time: shop.formatTime(cartItem().time)
|
|
15654
15627
|
};
|
|
15655
15628
|
} catch {
|
|
15656
15629
|
return {
|
|
@@ -15752,23 +15725,34 @@ function canDecrement(value, { floor = 0 }) {
|
|
|
15752
15725
|
}
|
|
15753
15726
|
//#endregion
|
|
15754
15727
|
//#region src/components/shared/quantityStepper/QuantityStepper.svelte
|
|
15755
|
-
var root$50 = /* @__PURE__ */ from_html(`<div class="go-quantity-stepper" role="group"><button type="button"
|
|
15728
|
+
var root$50 = /* @__PURE__ */ from_html(`<div class="go-quantity-stepper" role="group"><button type="button" tabindex="-1"><span aria-hidden="true"> </span></button> <input class="go-quantity-stepper-value" type="text" role="spinbutton" inputmode="numeric" autocomplete="off"/> <button type="button" class="go-quantity-stepper-button go-quantity-stepper-increment" tabindex="-1"><span aria-hidden="true">+</span></button></div>`);
|
|
15756
15729
|
function QuantityStepper($$anchor, $$props) {
|
|
15757
15730
|
const inputId = props_id();
|
|
15758
15731
|
push($$props, true);
|
|
15759
|
-
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), floor = prop($$props, "floor", 7, 0), label = prop($$props, "label", 7), decreaseLabel = prop($$props, "decreaseLabel", 7), increaseLabel = prop($$props, "increaseLabel", 7), onChange = prop($$props, "onChange", 7);
|
|
15760
|
-
const
|
|
15732
|
+
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), floor = prop($$props, "floor", 7, 0), label = prop($$props, "label", 7), decreaseLabel = prop($$props, "decreaseLabel", 7), increaseLabel = prop($$props, "increaseLabel", 7), onDecrementBelowMin = prop($$props, "onDecrementBelowMin", 7), removeAriaLabel = prop($$props, "removeAriaLabel", 7), removeLabel = prop($$props, "removeLabel", 7, "✕"), onChange = prop($$props, "onChange", 7);
|
|
15733
|
+
const removeMode = /* @__PURE__ */ user_derived(() => onDecrementBelowMin() != null);
|
|
15734
|
+
const removeBottom = /* @__PURE__ */ user_derived(() => Math.max(min(), 1));
|
|
15735
|
+
const bounds = /* @__PURE__ */ user_derived(() => get$2(removeMode) ? {
|
|
15736
|
+
min: get$2(removeBottom),
|
|
15737
|
+
max: max(),
|
|
15738
|
+
floor: get$2(removeBottom)
|
|
15739
|
+
} : {
|
|
15761
15740
|
min: min(),
|
|
15762
15741
|
max: max(),
|
|
15763
15742
|
floor: floor()
|
|
15764
|
-
})
|
|
15743
|
+
});
|
|
15744
|
+
const atRemove = /* @__PURE__ */ user_derived(() => get$2(removeMode) && value() <= get$2(removeBottom));
|
|
15765
15745
|
let inputEl;
|
|
15766
15746
|
let invalid = /* @__PURE__ */ state(false);
|
|
15767
|
-
const decDisabled = /* @__PURE__ */ user_derived(() => !canDecrement(value(), get$2(bounds)));
|
|
15747
|
+
const decDisabled = /* @__PURE__ */ user_derived(() => !get$2(atRemove) && !canDecrement(value(), get$2(bounds)));
|
|
15768
15748
|
const incDisabled = /* @__PURE__ */ user_derived(() => !canIncrement(value(), get$2(bounds)));
|
|
15769
15749
|
function emit(next) {
|
|
15770
15750
|
if (next !== value()) onChange()(next);
|
|
15771
15751
|
}
|
|
15752
|
+
function pressDecrement() {
|
|
15753
|
+
if (get$2(atRemove)) onDecrementBelowMin()();
|
|
15754
|
+
else stepDown();
|
|
15755
|
+
}
|
|
15772
15756
|
function stepDown() {
|
|
15773
15757
|
if (canDecrement(value(), get$2(bounds))) emit(decrement(value(), get$2(bounds)));
|
|
15774
15758
|
}
|
|
@@ -15776,7 +15760,14 @@ function QuantityStepper($$anchor, $$props) {
|
|
|
15776
15760
|
if (canIncrement(value(), get$2(bounds))) emit(increment(value(), get$2(bounds)));
|
|
15777
15761
|
}
|
|
15778
15762
|
function commitTyped() {
|
|
15779
|
-
const
|
|
15763
|
+
const raw = parseInt(inputEl.value, 10);
|
|
15764
|
+
if (get$2(removeMode) && (!Number.isFinite(raw) || raw <= 0)) {
|
|
15765
|
+
set(invalid, false);
|
|
15766
|
+
inputEl.value = String(value());
|
|
15767
|
+
onDecrementBelowMin()();
|
|
15768
|
+
return;
|
|
15769
|
+
}
|
|
15770
|
+
const next = clampTyped(raw, get$2(bounds));
|
|
15780
15771
|
set(invalid, false);
|
|
15781
15772
|
inputEl.value = String(next);
|
|
15782
15773
|
emit(next);
|
|
@@ -15797,7 +15788,7 @@ function QuantityStepper($$anchor, $$props) {
|
|
|
15797
15788
|
break;
|
|
15798
15789
|
case "Home":
|
|
15799
15790
|
e.preventDefault();
|
|
15800
|
-
emit(
|
|
15791
|
+
emit(get$2(bounds).floor);
|
|
15801
15792
|
break;
|
|
15802
15793
|
case "End":
|
|
15803
15794
|
e.preventDefault();
|
|
@@ -15859,6 +15850,27 @@ function QuantityStepper($$anchor, $$props) {
|
|
|
15859
15850
|
increaseLabel($$value);
|
|
15860
15851
|
flushSync();
|
|
15861
15852
|
},
|
|
15853
|
+
get onDecrementBelowMin() {
|
|
15854
|
+
return onDecrementBelowMin();
|
|
15855
|
+
},
|
|
15856
|
+
set onDecrementBelowMin($$value) {
|
|
15857
|
+
onDecrementBelowMin($$value);
|
|
15858
|
+
flushSync();
|
|
15859
|
+
},
|
|
15860
|
+
get removeAriaLabel() {
|
|
15861
|
+
return removeAriaLabel();
|
|
15862
|
+
},
|
|
15863
|
+
set removeAriaLabel($$value) {
|
|
15864
|
+
removeAriaLabel($$value);
|
|
15865
|
+
flushSync();
|
|
15866
|
+
},
|
|
15867
|
+
get removeLabel() {
|
|
15868
|
+
return removeLabel();
|
|
15869
|
+
},
|
|
15870
|
+
set removeLabel($$value = "✕") {
|
|
15871
|
+
removeLabel($$value);
|
|
15872
|
+
flushSync();
|
|
15873
|
+
},
|
|
15862
15874
|
get onChange() {
|
|
15863
15875
|
return onChange();
|
|
15864
15876
|
},
|
|
@@ -15869,6 +15881,11 @@ function QuantityStepper($$anchor, $$props) {
|
|
|
15869
15881
|
};
|
|
15870
15882
|
var div = root$50();
|
|
15871
15883
|
var button = child(div);
|
|
15884
|
+
let classes;
|
|
15885
|
+
var span = child(button);
|
|
15886
|
+
var text = child(span, true);
|
|
15887
|
+
reset(span);
|
|
15888
|
+
reset(button);
|
|
15872
15889
|
var input = sibling(button, 2);
|
|
15873
15890
|
remove_input_defaults(input);
|
|
15874
15891
|
bind_this(input, ($$value) => inputEl = $$value, () => inputEl);
|
|
@@ -15876,21 +15893,23 @@ function QuantityStepper($$anchor, $$props) {
|
|
|
15876
15893
|
reset(div);
|
|
15877
15894
|
template_effect(() => {
|
|
15878
15895
|
set_attribute(div, "aria-label", label());
|
|
15879
|
-
|
|
15896
|
+
classes = set_class(button, 1, "go-quantity-stepper-button go-quantity-stepper-decrement", null, classes, { "go-quantity-stepper-remove": get$2(atRemove) });
|
|
15897
|
+
set_attribute(button, "title", get$2(atRemove) ? removeAriaLabel() : decreaseLabel());
|
|
15880
15898
|
set_attribute(button, "aria-controls", inputId);
|
|
15881
15899
|
set_attribute(button, "aria-disabled", get$2(decDisabled));
|
|
15900
|
+
set_text(text, get$2(atRemove) ? removeLabel() : "−");
|
|
15882
15901
|
set_attribute(input, "id", inputId);
|
|
15883
15902
|
set_attribute(input, "aria-label", label());
|
|
15884
15903
|
set_value(input, value());
|
|
15885
15904
|
set_attribute(input, "aria-valuenow", value());
|
|
15886
|
-
set_attribute(input, "aria-valuemin",
|
|
15905
|
+
set_attribute(input, "aria-valuemin", get$2(bounds).floor);
|
|
15887
15906
|
set_attribute(input, "aria-valuemax", max());
|
|
15888
15907
|
set_attribute(input, "aria-invalid", get$2(invalid) ? "true" : void 0);
|
|
15889
15908
|
set_attribute(button_1, "title", increaseLabel());
|
|
15890
15909
|
set_attribute(button_1, "aria-controls", inputId);
|
|
15891
15910
|
set_attribute(button_1, "aria-disabled", get$2(incDisabled));
|
|
15892
15911
|
});
|
|
15893
|
-
delegated("click", button,
|
|
15912
|
+
delegated("click", button, pressDecrement);
|
|
15894
15913
|
delegated("input", input, onInput);
|
|
15895
15914
|
delegated("change", input, commitTyped);
|
|
15896
15915
|
event("blur", input, commitTyped);
|
|
@@ -15913,6 +15932,9 @@ create_custom_element(QuantityStepper, {
|
|
|
15913
15932
|
label: {},
|
|
15914
15933
|
decreaseLabel: {},
|
|
15915
15934
|
increaseLabel: {},
|
|
15935
|
+
onDecrementBelowMin: {},
|
|
15936
|
+
removeAriaLabel: {},
|
|
15937
|
+
removeLabel: {},
|
|
15916
15938
|
onChange: {}
|
|
15917
15939
|
}, [], [], { mode: "open" });
|
|
15918
15940
|
//#endregion
|
|
@@ -15953,8 +15975,12 @@ function QuantityControl($$anchor, $$props) {
|
|
|
15953
15975
|
* `min_persons`) a hard bottom on both controls: the backend does not enforce it,
|
|
15954
15976
|
* so the UI must (Angular-shop parity).
|
|
15955
15977
|
*/
|
|
15978
|
+
/**
|
|
15979
|
+
* Cart-only: when set, the stepper's `−` at the order minimum removes the line instead of
|
|
15980
|
+
* stepping (fires this). Presence turns the behaviour on; the legacy `<select>` ignores it.
|
|
15981
|
+
*/
|
|
15956
15982
|
/** Emits the next committed quantity. The control never mutates anything itself. */
|
|
15957
|
-
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), label = prop($$props, "label", 7), floor = prop($$props, "floor", 7, 0), deselectable = prop($$props, "deselectable", 7, true), onChange = prop($$props, "onChange", 7);
|
|
15983
|
+
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), label = prop($$props, "label", 7), floor = prop($$props, "floor", 7, 0), deselectable = prop($$props, "deselectable", 7, true), onDecrementBelowMin = prop($$props, "onDecrementBelowMin", 7), onChange = prop($$props, "onChange", 7);
|
|
15958
15984
|
const useStepper = /* @__PURE__ */ user_derived(() => configStore.config.quantityStepper);
|
|
15959
15985
|
var $$exports = {
|
|
15960
15986
|
get value() {
|
|
@@ -15999,6 +16025,13 @@ function QuantityControl($$anchor, $$props) {
|
|
|
15999
16025
|
deselectable($$value);
|
|
16000
16026
|
flushSync();
|
|
16001
16027
|
},
|
|
16028
|
+
get onDecrementBelowMin() {
|
|
16029
|
+
return onDecrementBelowMin();
|
|
16030
|
+
},
|
|
16031
|
+
set onDecrementBelowMin($$value) {
|
|
16032
|
+
onDecrementBelowMin($$value);
|
|
16033
|
+
flushSync();
|
|
16034
|
+
},
|
|
16002
16035
|
get onChange() {
|
|
16003
16036
|
return onChange();
|
|
16004
16037
|
},
|
|
@@ -16014,6 +16047,8 @@ function QuantityControl($$anchor, $$props) {
|
|
|
16014
16047
|
let $0 = /* @__PURE__ */ user_derived(() => deselectable() ? 0 : min());
|
|
16015
16048
|
let $1 = /* @__PURE__ */ user_derived(() => shop.t("quantity.decrease"));
|
|
16016
16049
|
let $2 = /* @__PURE__ */ user_derived(() => shop.t("quantity.increase"));
|
|
16050
|
+
let $3 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove"));
|
|
16051
|
+
let $4 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove.label"));
|
|
16017
16052
|
QuantityStepper($$anchor, {
|
|
16018
16053
|
get value() {
|
|
16019
16054
|
return value();
|
|
@@ -16036,6 +16071,15 @@ function QuantityControl($$anchor, $$props) {
|
|
|
16036
16071
|
get increaseLabel() {
|
|
16037
16072
|
return get$2($2);
|
|
16038
16073
|
},
|
|
16074
|
+
get onDecrementBelowMin() {
|
|
16075
|
+
return onDecrementBelowMin();
|
|
16076
|
+
},
|
|
16077
|
+
get removeAriaLabel() {
|
|
16078
|
+
return get$2($3);
|
|
16079
|
+
},
|
|
16080
|
+
get removeLabel() {
|
|
16081
|
+
return get$2($4);
|
|
16082
|
+
},
|
|
16039
16083
|
get onChange() {
|
|
16040
16084
|
return onChange();
|
|
16041
16085
|
}
|
|
@@ -16076,6 +16120,7 @@ create_custom_element(QuantityControl, {
|
|
|
16076
16120
|
label: {},
|
|
16077
16121
|
floor: {},
|
|
16078
16122
|
deselectable: {},
|
|
16123
|
+
onDecrementBelowMin: {},
|
|
16079
16124
|
onChange: {}
|
|
16080
16125
|
}, [], [], { mode: "open" });
|
|
16081
16126
|
//#endregion
|
|
@@ -18054,12 +18099,14 @@ create_custom_element(SubRow, {
|
|
|
18054
18099
|
* the visible row title: event rows compose it from event_title + time because a
|
|
18055
18100
|
* flat-price event's price row carries no title (the row IS the event) — naming
|
|
18056
18101
|
* the control from product.title alone left it unnamed (WI #141).
|
|
18102
|
+
*
|
|
18103
|
+
* Locale comes in as a parameter — shared/ components stay store-agnostic (WI #151).
|
|
18057
18104
|
*/
|
|
18058
|
-
function quantityLabel(item) {
|
|
18105
|
+
function quantityLabel(item, locale) {
|
|
18059
18106
|
const { product } = item;
|
|
18060
18107
|
return isEventTicket(product) ? [
|
|
18061
18108
|
product.event_title,
|
|
18062
|
-
item.time && formatTime(item.time),
|
|
18109
|
+
item.time && formatTime(item.time, locale),
|
|
18063
18110
|
product.title
|
|
18064
18111
|
].filter(Boolean).join(" - ") : product.title;
|
|
18065
18112
|
}
|
|
@@ -18070,7 +18117,7 @@ var root_1$15 = /* @__PURE__ */ from_html(`<span class="go-cart-item-price-disco
|
|
|
18070
18117
|
var root_2$11 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-participant-count"> </span>`);
|
|
18071
18118
|
var root_3$8 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-voucher-quantity"> </span>`);
|
|
18072
18119
|
var root_4$4 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
18073
|
-
var root_5$3 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove"
|
|
18120
|
+
var root_5$3 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove"> </button></li>`);
|
|
18074
18121
|
var root_6$2 = /* @__PURE__ */ from_html(`<ul class="go-sub-tickets" role="list"></ul>`);
|
|
18075
18122
|
var root_7$2 = /* @__PURE__ */ from_html(`<article class="go-cart-item-content"><ul><li class="go-cart-item-title-container"><!></li> <li class="go-cart-item-price"><!></li> <li class="go-cart-item-count"><!></li> <!> <li class="go-cart-item-sum"> </li></ul></article> <!>`, 1);
|
|
18076
18123
|
function Item$1($$anchor, $$props) {
|
|
@@ -18224,7 +18271,7 @@ function Item$1($$anchor, $$props) {
|
|
|
18224
18271
|
var alternate_1 = ($$anchor) => {
|
|
18225
18272
|
{
|
|
18226
18273
|
let $0 = /* @__PURE__ */ user_derived(() => displayItem().quantity ?? 0);
|
|
18227
|
-
let $1 = /* @__PURE__ */ user_derived(() => quantityLabel(displayItem()));
|
|
18274
|
+
let $1 = /* @__PURE__ */ user_derived(() => quantityLabel(displayItem(), shop.locale));
|
|
18228
18275
|
QuantityControl($$anchor, {
|
|
18229
18276
|
get value() {
|
|
18230
18277
|
return get$2($0);
|
|
@@ -18239,7 +18286,8 @@ function Item$1($$anchor, $$props) {
|
|
|
18239
18286
|
return get$2($1);
|
|
18240
18287
|
},
|
|
18241
18288
|
floor: 1,
|
|
18242
|
-
onChange: updateQuantity
|
|
18289
|
+
onChange: updateQuantity,
|
|
18290
|
+
onDecrementBelowMin: del
|
|
18243
18291
|
});
|
|
18244
18292
|
}
|
|
18245
18293
|
};
|
|
@@ -18254,8 +18302,13 @@ function Item$1($$anchor, $$props) {
|
|
|
18254
18302
|
var consequent_8 = ($$anchor) => {
|
|
18255
18303
|
var li_3 = root_5$3();
|
|
18256
18304
|
var button = child(li_3);
|
|
18305
|
+
var text_6 = child(button, true);
|
|
18306
|
+
reset(button);
|
|
18257
18307
|
reset(li_3);
|
|
18258
|
-
template_effect(($0
|
|
18308
|
+
template_effect(($0, $1) => {
|
|
18309
|
+
set_attribute(button, "aria-label", $0);
|
|
18310
|
+
set_text(text_6, $1);
|
|
18311
|
+
}, [() => shop.t("cart.item.aria.removeItem"), () => shop.t("cart.item.remove")]);
|
|
18259
18312
|
delegated("click", button, del);
|
|
18260
18313
|
append($$anchor, li_3);
|
|
18261
18314
|
};
|
|
@@ -18263,7 +18316,7 @@ function Item$1($$anchor, $$props) {
|
|
|
18263
18316
|
if (!preview()) $$render(consequent_8);
|
|
18264
18317
|
});
|
|
18265
18318
|
var li_4 = sibling(node_4, 2);
|
|
18266
|
-
var
|
|
18319
|
+
var text_7 = child(li_4, true);
|
|
18267
18320
|
reset(li_4);
|
|
18268
18321
|
reset(ul);
|
|
18269
18322
|
reset(article);
|
|
@@ -18297,7 +18350,7 @@ function Item$1($$anchor, $$props) {
|
|
|
18297
18350
|
if_block(node_5, ($$render) => {
|
|
18298
18351
|
if (get$2(mantleProduct)) $$render(consequent_9);
|
|
18299
18352
|
});
|
|
18300
|
-
template_effect(($0) => set_text(
|
|
18353
|
+
template_effect(($0) => set_text(text_7, $0), [() => formatCurrency(displayItem().total_price_cents)]);
|
|
18301
18354
|
append($$anchor, fragment_1);
|
|
18302
18355
|
};
|
|
18303
18356
|
if_block(node, ($$render) => {
|
|
@@ -36413,10 +36466,7 @@ function Event$1($$anchor, $$props) {
|
|
|
36413
36466
|
template_effect(($0, $1) => {
|
|
36414
36467
|
set_text(text_1, $0);
|
|
36415
36468
|
set_text(text_2, $1);
|
|
36416
|
-
}, [() => formatDate(item().attributes.start_time,
|
|
36417
|
-
month: "numeric",
|
|
36418
|
-
day: "numeric"
|
|
36419
|
-
}, shop.locale), () => formatTime(item().attributes.start_time)]);
|
|
36469
|
+
}, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
|
|
36420
36470
|
append($$anchor, fragment);
|
|
36421
36471
|
};
|
|
36422
36472
|
if_block(node, ($$render) => {
|
|
@@ -36559,20 +36609,14 @@ function TicketSale($$anchor, $$props) {
|
|
|
36559
36609
|
template_effect(($0, $1) => {
|
|
36560
36610
|
set_text(text_3, $0);
|
|
36561
36611
|
set_text(text_4, $1);
|
|
36562
|
-
}, [() => formatDate(item().attributes.start_time,
|
|
36563
|
-
month: "numeric",
|
|
36564
|
-
day: "numeric"
|
|
36565
|
-
}, shop.locale), () => formatTime(item().attributes.start_time)]);
|
|
36612
|
+
}, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
|
|
36566
36613
|
append($$anchor, fragment_4);
|
|
36567
36614
|
};
|
|
36568
36615
|
var consequent_2 = ($$anchor) => {
|
|
36569
36616
|
var span_5 = root_3$3();
|
|
36570
36617
|
var text_5 = child(span_5, true);
|
|
36571
36618
|
reset(span_5);
|
|
36572
|
-
template_effect(($0) => set_text(text_5, $0), [() => formatDate(item().attributes.start_time,
|
|
36573
|
-
month: "numeric",
|
|
36574
|
-
day: "numeric"
|
|
36575
|
-
}, shop.locale)]);
|
|
36619
|
+
template_effect(($0) => set_text(text_5, $0), [() => shop.formatDate(item().attributes.start_time, "dayMonth")]);
|
|
36576
36620
|
append($$anchor, span_5);
|
|
36577
36621
|
};
|
|
36578
36622
|
if_block(node_5, ($$render) => {
|
|
@@ -36764,10 +36808,7 @@ function Tour($$anchor, $$props) {
|
|
|
36764
36808
|
template_effect(($0, $1) => {
|
|
36765
36809
|
set_text(text_2, $0);
|
|
36766
36810
|
set_text(text_3, $1);
|
|
36767
|
-
}, [() => formatDate(item().attributes.start_time,
|
|
36768
|
-
month: "numeric",
|
|
36769
|
-
day: "numeric"
|
|
36770
|
-
}, shop.locale), () => formatTime(item().attributes.start_time)]);
|
|
36811
|
+
}, [() => shop.formatDate(item().attributes.start_time, "dayMonth"), () => shop.formatTime(item().attributes.start_time)]);
|
|
36771
36812
|
append($$anchor, fragment);
|
|
36772
36813
|
};
|
|
36773
36814
|
if_block(node, ($$render) => {
|
|
@@ -37541,7 +37582,7 @@ function Item($$anchor, $$props) {
|
|
|
37541
37582
|
template_effect(($0) => {
|
|
37542
37583
|
set_text(text, `${item().product.event_title ?? ""} - ${$0 ?? ""}`);
|
|
37543
37584
|
set_text(text_1, item().product.title);
|
|
37544
|
-
}, [() => formatTime(item().time)]);
|
|
37585
|
+
}, [() => shop.formatTime(item().time)]);
|
|
37545
37586
|
append($$anchor, fragment);
|
|
37546
37587
|
};
|
|
37547
37588
|
const default_title = ($$anchor) => {
|
|
@@ -37650,7 +37691,7 @@ function Item($$anchor, $$props) {
|
|
|
37650
37691
|
var li_6 = sibling(li_5, 2);
|
|
37651
37692
|
var node_5 = child(li_6);
|
|
37652
37693
|
{
|
|
37653
|
-
let $0 = /* @__PURE__ */ user_derived(() => quantityLabel(item()));
|
|
37694
|
+
let $0 = /* @__PURE__ */ user_derived(() => quantityLabel(item(), shop.locale));
|
|
37654
37695
|
QuantityControl(node_5, {
|
|
37655
37696
|
get value() {
|
|
37656
37697
|
return item().quantity;
|
|
@@ -37828,7 +37869,7 @@ var Details$1 = class {
|
|
|
37828
37869
|
this.timeslots = quotaManager.timeslotsOn(date, this.tsd?.timeslotTicketIds).map((x) => ({
|
|
37829
37870
|
...x,
|
|
37830
37871
|
startAt: x.timeSlot,
|
|
37831
|
-
timeFormatted: x.timeSlot
|
|
37872
|
+
timeFormatted: shop.formatTime(x.timeSlot),
|
|
37832
37873
|
available: x.capacity > 0
|
|
37833
37874
|
}));
|
|
37834
37875
|
}
|