@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.
- package/dist/components/form/FieldArray.vue.d.ts +3 -2
- package/dist/components/form/FieldArray.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PhoneInput.vue.d.ts +116 -0
- package/dist/components/form/inputs/PhoneInput.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/index.d.ts +1 -1
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/directives/pattern.d.ts.map +1 -1
- package/dist/index.cjs +9832 -9920
- package/dist/index.mjs +9832 -9920
- package/dist/style.css +666 -411
- package/dist/types/BagelForm.d.ts +1 -1
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/TableSchema.d.ts +1 -1
- package/dist/types/TableSchema.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts +2 -1
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/DataTable/useTableData.ts +2 -2
- package/src/components/form/FieldArray.vue +89 -48
- package/src/components/form/inputs/PhoneInput.vue +352 -0
- package/src/components/form/inputs/index.ts +1 -1
- package/src/composables/index.ts +8 -15
- package/src/directives/pattern.ts +1 -0
- package/src/styles/inputs.css +139 -140
- package/src/styles/layout.css +226 -113
- package/src/styles/mobilLayout.css +226 -113
- package/src/types/BagelForm.ts +1 -1
- package/src/types/TableSchema.ts +1 -1
- package/src/utils/BagelFormUtils.ts +7 -2
|
@@ -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
|
-
|
|
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
|
|
313
|
+
attrs,
|
|
309
314
|
}
|
|
310
315
|
}
|
|
311
316
|
|