@gomusdev/web-components 4.1.0 → 4.1.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 +9 -0
- package/dist-js/gomus-webcomponents.iife.js +28 -14
- package/dist-js/gomus-webcomponents.js +28 -14
- package/dist-js/gomus-webcomponents.min.iife.js +31 -31
- package/dist-js/gomus-webcomponents.min.js +1755 -1747
- package/dist-js/src/components/forms/lib/Field.svelte.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.1.1 (2026-07-09)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **forms:** pass required type argument to HTMLAttributes
|
|
8
|
+
* **forms:** resolve remaining typescript-eslint errors in InputAndLabel
|
|
9
|
+
* **forms:** set field.value when a single payment mode is auto-selected, closes [#135](https://gitlab.giantmonkey.de/gomus/frontend/issues/135)
|
|
10
|
+
* **forms:** type the field snippet map as Record<FieldType, Snippet>
|
|
11
|
+
|
|
3
12
|
## 4.1.0 (2026-07-09)
|
|
4
13
|
|
|
5
14
|
### Features
|
|
@@ -32813,10 +32813,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
32813
32813
|
var root_9$1 = /* @__PURE__ */ from_html(`<label><!></label> <select><!></select>`, 1);
|
|
32814
32814
|
var root_10$1 = /* @__PURE__ */ from_html(`<img style="width: 60px" aria-hidden="true"/>`);
|
|
32815
32815
|
var root_11 = /* @__PURE__ */ from_html(`<span class="go-payment-mode-icons"></span>`);
|
|
32816
|
-
var root_12 = /* @__PURE__ */ from_html(`<
|
|
32817
|
-
var root_13 = /* @__PURE__ */ from_html(`<
|
|
32818
|
-
var root_14 = /* @__PURE__ */ from_html(`<
|
|
32819
|
-
var root_15 = /* @__PURE__ */ from_html(`<
|
|
32816
|
+
var root_12 = /* @__PURE__ */ from_html(`<span class="go-payment-mode-name"> </span>`);
|
|
32817
|
+
var root_13 = /* @__PURE__ */ from_html(`<label><input type="radio"/> <!></label>`);
|
|
32818
|
+
var root_14 = /* @__PURE__ */ from_html(`<fieldset role="radiogroup"><legend><!></legend> <!></fieldset>`);
|
|
32819
|
+
var root_15 = /* @__PURE__ */ from_html(`<label> <input/></label>`);
|
|
32820
|
+
var root_16 = /* @__PURE__ */ from_html(`<fieldset><legend><!></legend> <!></fieldset>`);
|
|
32820
32821
|
function InputAndLabel($$anchor, $$props) {
|
|
32821
32822
|
push($$props, true);
|
|
32822
32823
|
const labelText = ($$anchor) => {
|
|
@@ -33016,12 +33017,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33016
33017
|
};
|
|
33017
33018
|
const paymentMode = ($$anchor) => {
|
|
33018
33019
|
const modes = /* @__PURE__ */ user_derived(() => shop.payment_modes ? Object.values(shop.payment_modes) : []);
|
|
33019
|
-
var fieldset =
|
|
33020
|
+
var fieldset = root_14();
|
|
33020
33021
|
var legend = child(fieldset);
|
|
33021
33022
|
labelText(child(legend));
|
|
33022
33023
|
reset(legend);
|
|
33023
33024
|
each(sibling(legend, 2), 17, () => get$2(modes), (mode) => mode.id, ($$anchor, mode) => {
|
|
33024
|
-
var label_6 =
|
|
33025
|
+
var label_6 = root_13();
|
|
33025
33026
|
var input_4 = child(label_6);
|
|
33026
33027
|
remove_input_defaults(input_4);
|
|
33027
33028
|
var node_11 = sibling(input_4, 2);
|
|
@@ -33040,8 +33041,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33040
33041
|
reset(span_2);
|
|
33041
33042
|
append($$anchor, span_2);
|
|
33042
33043
|
};
|
|
33044
|
+
var alternate = ($$anchor) => {
|
|
33045
|
+
var span_3 = root_12();
|
|
33046
|
+
var text_4 = child(span_3, true);
|
|
33047
|
+
reset(span_3);
|
|
33048
|
+
template_effect(() => set_text(text_4, get$2(mode).name));
|
|
33049
|
+
append($$anchor, span_3);
|
|
33050
|
+
};
|
|
33043
33051
|
if_block(node_11, ($$render) => {
|
|
33044
33052
|
if (get$2(mode).icons.length > 0) $$render(consequent_3);
|
|
33053
|
+
else $$render(alternate, -1);
|
|
33045
33054
|
});
|
|
33046
33055
|
reset(label_6);
|
|
33047
33056
|
template_effect(($0, $1, $2) => {
|
|
@@ -33052,7 +33061,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33052
33061
|
set_attribute(input_4, "aria-label", $2);
|
|
33053
33062
|
}, [
|
|
33054
33063
|
() => String(get$2(mode).id),
|
|
33055
|
-
() =>
|
|
33064
|
+
() => field().value === String(get$2(mode).id),
|
|
33056
33065
|
() => shop.t(`cart.paymentMode.ariaLabel.${get$2(mode).name.toLowerCase()}`)
|
|
33057
33066
|
]);
|
|
33058
33067
|
delegated("change", input_4, () => {
|
|
@@ -33068,17 +33077,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33068
33077
|
append($$anchor, fieldset);
|
|
33069
33078
|
};
|
|
33070
33079
|
const radio = ($$anchor) => {
|
|
33071
|
-
var fieldset_1 =
|
|
33080
|
+
var fieldset_1 = root_16();
|
|
33072
33081
|
var legend_1 = child(fieldset_1);
|
|
33073
33082
|
labelText(child(legend_1));
|
|
33074
33083
|
reset(legend_1);
|
|
33075
33084
|
var node_13 = sibling(legend_1, 2);
|
|
33076
33085
|
var consequent_4 = ($$anchor) => {
|
|
33077
33086
|
var fragment_9 = comment();
|
|
33078
|
-
each(first_child(fragment_9), 17, () => field().options,
|
|
33079
|
-
var label_7 =
|
|
33080
|
-
var
|
|
33081
|
-
var input_5 = sibling(
|
|
33087
|
+
each(first_child(fragment_9), 17, () => field().options(), (option) => option.value, ($$anchor, option) => {
|
|
33088
|
+
var label_7 = root_15();
|
|
33089
|
+
var text_5 = child(label_7);
|
|
33090
|
+
var input_5 = sibling(text_5);
|
|
33082
33091
|
attribute_effect(input_5, () => ({
|
|
33083
33092
|
...get$2(fieldAttributes),
|
|
33084
33093
|
...restProps,
|
|
@@ -33088,8 +33097,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33088
33097
|
reset(label_7);
|
|
33089
33098
|
template_effect(() => {
|
|
33090
33099
|
set_class(label_7, 1, clsx(labelClass()));
|
|
33091
|
-
set_attribute(label_7, "for", get$2(inputId) + get$2(option));
|
|
33092
|
-
set_text(
|
|
33100
|
+
set_attribute(label_7, "for", get$2(inputId) + get$2(option).value);
|
|
33101
|
+
set_text(text_5, `${get$2(option).label ?? ""} `);
|
|
33093
33102
|
});
|
|
33094
33103
|
bind_value(input_5, () => field().value, ($$value) => field(field().value = $$value, true));
|
|
33095
33104
|
append($$anchor, label_7);
|
|
@@ -33139,6 +33148,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33139
33148
|
}));
|
|
33140
33149
|
let label = /* @__PURE__ */ user_derived(() => shop.t(field().label) || field().label);
|
|
33141
33150
|
const CDN_PATH = `https://cdn.shop.platform.gomus.de/`;
|
|
33151
|
+
user_effect(() => {
|
|
33152
|
+
if (field().type !== "paymentMode") return;
|
|
33153
|
+
const modes = shop.payment_modes ? Object.values(shop.payment_modes) : [];
|
|
33154
|
+
if (modes.length === 1 && field().value === "") field(field().value = String(modes[0].id), true);
|
|
33155
|
+
});
|
|
33142
33156
|
let filePreviewUrl = /* @__PURE__ */ state(null);
|
|
33143
33157
|
user_effect(() => {
|
|
33144
33158
|
const value = field().value;
|
|
@@ -32812,10 +32812,11 @@ var select_content = /* @__PURE__ */ from_html(`<!>`, 1);
|
|
|
32812
32812
|
var root_9$1 = /* @__PURE__ */ from_html(`<label><!></label> <select><!></select>`, 1);
|
|
32813
32813
|
var root_10$1 = /* @__PURE__ */ from_html(`<img style="width: 60px" aria-hidden="true"/>`);
|
|
32814
32814
|
var root_11 = /* @__PURE__ */ from_html(`<span class="go-payment-mode-icons"></span>`);
|
|
32815
|
-
var root_12 = /* @__PURE__ */ from_html(`<
|
|
32816
|
-
var root_13 = /* @__PURE__ */ from_html(`<
|
|
32817
|
-
var root_14 = /* @__PURE__ */ from_html(`<
|
|
32818
|
-
var root_15 = /* @__PURE__ */ from_html(`<
|
|
32815
|
+
var root_12 = /* @__PURE__ */ from_html(`<span class="go-payment-mode-name"> </span>`);
|
|
32816
|
+
var root_13 = /* @__PURE__ */ from_html(`<label><input type="radio"/> <!></label>`);
|
|
32817
|
+
var root_14 = /* @__PURE__ */ from_html(`<fieldset role="radiogroup"><legend><!></legend> <!></fieldset>`);
|
|
32818
|
+
var root_15 = /* @__PURE__ */ from_html(`<label> <input/></label>`);
|
|
32819
|
+
var root_16 = /* @__PURE__ */ from_html(`<fieldset><legend><!></legend> <!></fieldset>`);
|
|
32819
32820
|
function InputAndLabel($$anchor, $$props) {
|
|
32820
32821
|
push($$props, true);
|
|
32821
32822
|
const labelText = ($$anchor) => {
|
|
@@ -33015,12 +33016,12 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
33015
33016
|
};
|
|
33016
33017
|
const paymentMode = ($$anchor) => {
|
|
33017
33018
|
const modes = /* @__PURE__ */ user_derived(() => shop.payment_modes ? Object.values(shop.payment_modes) : []);
|
|
33018
|
-
var fieldset =
|
|
33019
|
+
var fieldset = root_14();
|
|
33019
33020
|
var legend = child(fieldset);
|
|
33020
33021
|
labelText(child(legend));
|
|
33021
33022
|
reset(legend);
|
|
33022
33023
|
each(sibling(legend, 2), 17, () => get$2(modes), (mode) => mode.id, ($$anchor, mode) => {
|
|
33023
|
-
var label_6 =
|
|
33024
|
+
var label_6 = root_13();
|
|
33024
33025
|
var input_4 = child(label_6);
|
|
33025
33026
|
remove_input_defaults(input_4);
|
|
33026
33027
|
var node_11 = sibling(input_4, 2);
|
|
@@ -33039,8 +33040,16 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
33039
33040
|
reset(span_2);
|
|
33040
33041
|
append($$anchor, span_2);
|
|
33041
33042
|
};
|
|
33043
|
+
var alternate = ($$anchor) => {
|
|
33044
|
+
var span_3 = root_12();
|
|
33045
|
+
var text_4 = child(span_3, true);
|
|
33046
|
+
reset(span_3);
|
|
33047
|
+
template_effect(() => set_text(text_4, get$2(mode).name));
|
|
33048
|
+
append($$anchor, span_3);
|
|
33049
|
+
};
|
|
33042
33050
|
if_block(node_11, ($$render) => {
|
|
33043
33051
|
if (get$2(mode).icons.length > 0) $$render(consequent_3);
|
|
33052
|
+
else $$render(alternate, -1);
|
|
33044
33053
|
});
|
|
33045
33054
|
reset(label_6);
|
|
33046
33055
|
template_effect(($0, $1, $2) => {
|
|
@@ -33051,7 +33060,7 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
33051
33060
|
set_attribute(input_4, "aria-label", $2);
|
|
33052
33061
|
}, [
|
|
33053
33062
|
() => String(get$2(mode).id),
|
|
33054
|
-
() =>
|
|
33063
|
+
() => field().value === String(get$2(mode).id),
|
|
33055
33064
|
() => shop.t(`cart.paymentMode.ariaLabel.${get$2(mode).name.toLowerCase()}`)
|
|
33056
33065
|
]);
|
|
33057
33066
|
delegated("change", input_4, () => {
|
|
@@ -33067,17 +33076,17 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
33067
33076
|
append($$anchor, fieldset);
|
|
33068
33077
|
};
|
|
33069
33078
|
const radio = ($$anchor) => {
|
|
33070
|
-
var fieldset_1 =
|
|
33079
|
+
var fieldset_1 = root_16();
|
|
33071
33080
|
var legend_1 = child(fieldset_1);
|
|
33072
33081
|
labelText(child(legend_1));
|
|
33073
33082
|
reset(legend_1);
|
|
33074
33083
|
var node_13 = sibling(legend_1, 2);
|
|
33075
33084
|
var consequent_4 = ($$anchor) => {
|
|
33076
33085
|
var fragment_9 = comment();
|
|
33077
|
-
each(first_child(fragment_9), 17, () => field().options,
|
|
33078
|
-
var label_7 =
|
|
33079
|
-
var
|
|
33080
|
-
var input_5 = sibling(
|
|
33086
|
+
each(first_child(fragment_9), 17, () => field().options(), (option) => option.value, ($$anchor, option) => {
|
|
33087
|
+
var label_7 = root_15();
|
|
33088
|
+
var text_5 = child(label_7);
|
|
33089
|
+
var input_5 = sibling(text_5);
|
|
33081
33090
|
attribute_effect(input_5, () => ({
|
|
33082
33091
|
...get$2(fieldAttributes),
|
|
33083
33092
|
...restProps,
|
|
@@ -33087,8 +33096,8 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
33087
33096
|
reset(label_7);
|
|
33088
33097
|
template_effect(() => {
|
|
33089
33098
|
set_class(label_7, 1, clsx(labelClass()));
|
|
33090
|
-
set_attribute(label_7, "for", get$2(inputId) + get$2(option));
|
|
33091
|
-
set_text(
|
|
33099
|
+
set_attribute(label_7, "for", get$2(inputId) + get$2(option).value);
|
|
33100
|
+
set_text(text_5, `${get$2(option).label ?? ""} `);
|
|
33092
33101
|
});
|
|
33093
33102
|
bind_value(input_5, () => field().value, ($$value) => field(field().value = $$value, true));
|
|
33094
33103
|
append($$anchor, label_7);
|
|
@@ -33138,6 +33147,11 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
33138
33147
|
}));
|
|
33139
33148
|
let label = /* @__PURE__ */ user_derived(() => shop.t(field().label) || field().label);
|
|
33140
33149
|
const CDN_PATH = `https://cdn.shop.platform.gomus.de/`;
|
|
33150
|
+
user_effect(() => {
|
|
33151
|
+
if (field().type !== "paymentMode") return;
|
|
33152
|
+
const modes = shop.payment_modes ? Object.values(shop.payment_modes) : [];
|
|
33153
|
+
if (modes.length === 1 && field().value === "") field(field().value = String(modes[0].id), true);
|
|
33154
|
+
});
|
|
33141
33155
|
let filePreviewUrl = /* @__PURE__ */ state(null);
|
|
33142
33156
|
user_effect(() => {
|
|
33143
33157
|
const value = field().value;
|