@functionalcms/svelte-components 4.11.6 → 4.11.8

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.
@@ -66,9 +66,9 @@
66
66
  name={field.name}
67
67
  id={field.name}
68
68
  label={translate(field.name)}
69
- options={mapEntiresToOptions(field)}
69
+ options={mapEntiresToOptions(field, translate)}
70
70
  singleSelected={$form[field.name]}
71
- defaultOptionLabel={t('selectOption')}
71
+ defaultOptionLabel={translate('selectOption')}
72
72
  />
73
73
  {:else if field.type === 'enum'}
74
74
  <ChoiceInput
@@ -8,7 +8,7 @@ export interface Field {
8
8
  export declare function serialize(schema: any): Promise<Field[]>;
9
9
  export declare function createForm(schema: any): Promise<import("sveltekit-superforms").SuperValidated<{}, any, {}>>;
10
10
  export declare function readForm(formRequest: any, schema: any): Promise<import("sveltekit-superforms").SuperValidated<{}, any, {}>>;
11
- export declare function mapEntiresToOptions(field: Field): {
11
+ export declare function mapEntiresToOptions(field: Field, translator: (value: string) => string): {
12
12
  label: string;
13
13
  value: string;
14
14
  }[];
@@ -25,9 +25,9 @@ export async function readForm(formRequest, schema) {
25
25
  const form = await superValidate(formRequest, yup(schema));
26
26
  return form;
27
27
  }
28
- export function mapEntiresToOptions(field) {
28
+ export function mapEntiresToOptions(field, translator) {
29
29
  return (field?.entries?.map((entry) => ({
30
- label: entry,
30
+ label: translator(entry),
31
31
  value: entry,
32
32
  })) ?? []);
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "4.11.6",
3
+ "version": "4.11.8",
4
4
  "watch": {
5
5
  "build": {
6
6
  "patterns": [