@bagelink/vue 1.0.43 → 1.0.50

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.
@@ -294,18 +294,23 @@ interface ArrayFieldOptions extends InputOptions {
294
294
  add?: boolean
295
295
  }
296
296
 
297
+ type ArrayType = 'number' | 'text'
298
+
297
299
  export function arrField<T extends { [key: string]: any }>(
298
300
  id: DotNotation<T> | string,
299
301
  label: string,
300
- schema: BglFormSchemaT,
302
+ schemaOrType: BglFormSchemaT | ArrayType,
301
303
  options?: ArrayFieldOptions
302
304
  ): Field<T> {
305
+ const attrs: Record<string, any> = { delete: true, add: true, ...options }
306
+ if (typeof schemaOrType === 'string') attrs.type = schemaOrType
307
+ else attrs.schema = schemaOrType
303
308
  return {
304
309
  label,
305
310
  id,
306
311
  $el: 'array',
307
312
  vIf: options?.vIf,
308
- attrs: { schema, delete: true, add: true, ...options },
313
+ attrs,
309
314
  }
310
315
  }
311
316