@@ -35,10 +35,10 @@ You can create a new component that adapts the interface of the original compone
3535
3636 declare module '@sjsf/form' {
3737 interface ComponentProps {
38- anyTagsField : FieldCommonProps<SchemaArrayValue>;
38+ arrayTagsField : FieldCommonProps<SchemaArrayValue>;
3939 }
4040 interface ComponentBindings {
41- anyTagsField : 'value';
41+ arrayTagsField : 'value';
4242 }
4343 }
4444</script>
@@ -49,7 +49,7 @@ You can create a new component that adapts the interface of the original compone
4949
5050 import { assertStrings } from '$lib/form/cast';
5151
52- let { value = $bindable(), ...rest }: ComponentProps['arrayField '] = $props();
52+ let { value = $bindable(), ...rest }: ComponentProps['arrayTagsField '] = $props();
5353</script>
5454
5555<TagsField
@@ -65,11 +65,16 @@ You can create a new component that adapts the interface of the original compone
6565```
6666
6767Why is this needed? Throwing an error when data formats don't match
68- is only one possible approach.
69- You should decide on the adaptation strategy and implement it yourself for now,
70- but in the future the library may provide ready-made adapted components.
68+ is only one possible approach.
69+ You should decide on the adaptation strategy and implement it yourself.
70+ However, if you're fine with the ` assert ` -based approach,
71+ you can use the following prebuilt field components:
72+ - ` array-files `
73+ - ` array-native-files `
74+ - ` array-tags `
75+ - ` unknown-native-file `
7176
72- You can reduce boilerplate code by using the ` cast ` utility from ` @sjsf/form/lib/component ` :
77+ You can also reduce boilerplate code by using the ` cast ` utility from ` @sjsf/form/lib/component ` :
7378
7479:::caution
7580
@@ -87,14 +92,14 @@ import { assertStrings } from '$lib/form/cast';
8792
8893declare module " @sjsf/form" {
8994 interface ComponentProps {
90- tagsFieldWrapper : FieldCommonProps <SchemaArrayValue >;
95+ arrayTagsField : FieldCommonProps <SchemaArrayValue >;
9196 }
9297 interface ComponentBinding {
93- tagsFieldWrapper : " value" ;
98+ arrayTagsField : " value" ;
9499 }
95100}
96101
97- const tagsFieldWrapper = cast (TagsField , {
102+ const arrayTagsField = cast (TagsField , {
98103 value: {
99104 transform(props ) {
100105 assertStrings (props .value );
0 commit comments