@gomusdev/web-components 4.7.0 → 4.8.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.8.1 (2026-07-16)
4
+
5
+ ### Bug Fixes
6
+
7
+ * **couponRedemption:** clear stale error when flush() succeeds
8
+ * **forms:** clear form-level api errors on valid submit, closes [#apiErrors](https://gitlab.giantmonkey.de/gomus/frontend/issues/apiErrors) [#147](https://gitlab.giantmonkey.de/gomus/frontend/issues/147)
9
+ * **forms:** reset stale success message on valid submit
10
+
11
+ ## 4.8.0 (2026-07-15)
12
+
13
+ ### Features
14
+
15
+ * **forms:** add dateOfBirth field for annual ticket personalization, closes [#149](https://gitlab.giantmonkey.de/gomus/frontend/issues/149)
16
+
17
+ ### Bug Fixes
18
+
19
+ * **forms:** tolerate undefined shop.locales in language field options
20
+
3
21
  ## 4.7.0 (2026-07-14)
4
22
 
5
23
  ### Features
@@ -14465,7 +14465,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14465
14465
  placeholder: "",
14466
14466
  description: "",
14467
14467
  autocomplete: "language",
14468
- options: () => shop.locales.map((c) => ({
14468
+ options: () => (shop.locales ?? []).map((c) => ({
14469
14469
  label: shop.t(`languages.${c.locale}`),
14470
14470
  value: c.id
14471
14471
  }))
@@ -14489,6 +14489,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14489
14489
  autocomplete: "off",
14490
14490
  validator: string().date()
14491
14491
  },
14492
+ dateOfBirth: {
14493
+ key: "dateOfBirth",
14494
+ apiKey: "date_of_birth",
14495
+ type: "date",
14496
+ label: "user.registration.form.dateOfBirth",
14497
+ placeholder: "",
14498
+ description: "",
14499
+ autocomplete: "bday",
14500
+ validator: string().date()
14501
+ },
14492
14502
  token: {
14493
14503
  key: "token",
14494
14504
  apiKey: "id",
@@ -14862,6 +14872,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14862
14872
  * @param {string[] | Record<string, string[]>} errors - Errors passed as an array or an object where keys are API field keys and values are arrays of error messages. If an array is provided, it assigns the errors directly. If an object is provided, it maps the errors to the respective fields based on their API keys.
14863
14873
  */
14864
14874
  set apiErrors(errors) {
14875
+ set(this.#apiErrors, [], true);
14865
14876
  this.fields.forEach((f) => f.apiErrors = []);
14866
14877
  if (isArray(errors)) {
14867
14878
  set(this.#apiErrors, errors, true);
@@ -14902,7 +14913,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14902
14913
  */
14903
14914
  get fields() {
14904
14915
  const parent = this.form.closest("go-form");
14905
- return Array.from(this.form.querySelectorAll("go-field")).filter((fe) => fe.closest("go-form") === parent).map((fe) => fe.getField?.()).filter((f) => f);
14916
+ return Array.from(this.form.querySelectorAll("go-field")).filter((fe) => fe.closest("go-form") === parent).map((fe) => fe.getField?.()).filter((f) => !!f);
14906
14917
  }
14907
14918
  toString() {
14908
14919
  return `Form: ${this.formId}, Fields: [${this.fields.map((f) => f.key).join(", ")}], Data: ${JSON.stringify(this.formData)}`;
@@ -14970,6 +14981,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14970
14981
  details?.form?.dispatchEvent(new Event("go-after-validation", event));
14971
14982
  if (details.isValid) {
14972
14983
  details.apiErrors = {};
14984
+ details.successMessage = void 0;
14973
14985
  details?.form?.dispatchEvent(new Event("go-submit", event));
14974
14986
  $$props.$$host.dispatchEvent(new Event("submit", {
14975
14987
  bubbles: true,
@@ -18589,6 +18601,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18589
18601
  form.details.apiErrors = result.errors;
18590
18602
  return result;
18591
18603
  }
18604
+ form.details.apiErrors = [];
18592
18605
  if (field) field.value = "";
18593
18606
  form.dispatchEvent(new Event("go-success", {
18594
18607
  bubbles: true,
@@ -14464,7 +14464,7 @@ var allFields = {
14464
14464
  placeholder: "",
14465
14465
  description: "",
14466
14466
  autocomplete: "language",
14467
- options: () => shop.locales.map((c) => ({
14467
+ options: () => (shop.locales ?? []).map((c) => ({
14468
14468
  label: shop.t(`languages.${c.locale}`),
14469
14469
  value: c.id
14470
14470
  }))
@@ -14488,6 +14488,16 @@ var allFields = {
14488
14488
  autocomplete: "off",
14489
14489
  validator: string().date()
14490
14490
  },
14491
+ dateOfBirth: {
14492
+ key: "dateOfBirth",
14493
+ apiKey: "date_of_birth",
14494
+ type: "date",
14495
+ label: "user.registration.form.dateOfBirth",
14496
+ placeholder: "",
14497
+ description: "",
14498
+ autocomplete: "bday",
14499
+ validator: string().date()
14500
+ },
14491
14501
  token: {
14492
14502
  key: "token",
14493
14503
  apiKey: "id",
@@ -14861,6 +14871,7 @@ var FormDetails = class {
14861
14871
  * @param {string[] | Record<string, string[]>} errors - Errors passed as an array or an object where keys are API field keys and values are arrays of error messages. If an array is provided, it assigns the errors directly. If an object is provided, it maps the errors to the respective fields based on their API keys.
14862
14872
  */
14863
14873
  set apiErrors(errors) {
14874
+ set(this.#apiErrors, [], true);
14864
14875
  this.fields.forEach((f) => f.apiErrors = []);
14865
14876
  if (isArray(errors)) {
14866
14877
  set(this.#apiErrors, errors, true);
@@ -14901,7 +14912,7 @@ var FormDetails = class {
14901
14912
  */
14902
14913
  get fields() {
14903
14914
  const parent = this.form.closest("go-form");
14904
- return Array.from(this.form.querySelectorAll("go-field")).filter((fe) => fe.closest("go-form") === parent).map((fe) => fe.getField?.()).filter((f) => f);
14915
+ return Array.from(this.form.querySelectorAll("go-field")).filter((fe) => fe.closest("go-form") === parent).map((fe) => fe.getField?.()).filter((f) => !!f);
14905
14916
  }
14906
14917
  toString() {
14907
14918
  return `Form: ${this.formId}, Fields: [${this.fields.map((f) => f.key).join(", ")}], Data: ${JSON.stringify(this.formData)}`;
@@ -14969,6 +14980,7 @@ function Form($$anchor, $$props) {
14969
14980
  details?.form?.dispatchEvent(new Event("go-after-validation", event));
14970
14981
  if (details.isValid) {
14971
14982
  details.apiErrors = {};
14983
+ details.successMessage = void 0;
14972
14984
  details?.form?.dispatchEvent(new Event("go-submit", event));
14973
14985
  $$props.$$host.dispatchEvent(new Event("submit", {
14974
14986
  bubbles: true,
@@ -18588,6 +18600,7 @@ function CouponRedemption($$anchor, $$props) {
18588
18600
  form.details.apiErrors = result.errors;
18589
18601
  return result;
18590
18602
  }
18603
+ form.details.apiErrors = [];
18591
18604
  if (field) field.value = "";
18592
18605
  form.dispatchEvent(new Event("go-success", {
18593
18606
  bubbles: true,