@bagelink/vue 0.0.1224 → 0.0.1227
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/BglComponent.vue.d.ts.map +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Spreadsheet/Index.vue.d.ts +1 -0
- package/dist/components/Spreadsheet/Index.vue.d.ts.map +1 -1
- package/dist/components/form/BagelForm.vue.d.ts +1 -0
- package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
- package/dist/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/components/lightbox/lightbox.types.d.ts +2 -1
- package/dist/components/lightbox/lightbox.types.d.ts.map +1 -1
- package/dist/composables/useSchemaField.d.ts +9 -5
- package/dist/composables/useSchemaField.d.ts.map +1 -1
- package/dist/index.cjs +69 -35
- package/dist/index.mjs +70 -36
- package/dist/style.css +73 -70
- package/dist/types/BagelForm.d.ts +2 -1
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +3 -0
- package/src/components/Spreadsheet/Index.vue +41 -17
- package/src/components/form/BagelForm.vue +6 -2
- package/src/components/lightbox/Lightbox.vue +5 -5
- package/src/components/lightbox/lightbox.types.ts +2 -1
- package/src/composables/useSchemaField.ts +36 -12
- package/src/types/BagelForm.ts +2 -1
- package/src/utils/BagelFormUtils.ts +2 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SelectInput, TextInput } from '..';
|
|
2
|
+
import { VNode } from 'vue';
|
|
2
3
|
export type AttributeValue = string | number | boolean | undefined | undefined | {
|
|
3
4
|
[key: string]: any;
|
|
4
5
|
};
|
|
@@ -24,7 +25,7 @@ export interface BaseBagelField<T = {
|
|
|
24
25
|
'id'?: keyof T extends string ? keyof T : string;
|
|
25
26
|
'label'?: string;
|
|
26
27
|
'placeholder'?: string;
|
|
27
|
-
'children'?: (Field<T> | string)[];
|
|
28
|
+
'children'?: (Field<T> | string | VNode)[];
|
|
28
29
|
'class'?: AttributeValue | AttributeFn<T>;
|
|
29
30
|
'attrs'?: Attributes<T>;
|
|
30
31
|
'required'?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BagelForm.d.ts","sourceRoot":"","sources":["../../src/types/BagelForm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"BagelForm.d.ts","sourceRoot":"","sources":["../../src/types/BagelForm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAEhC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAEvG,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,cAAc,CAAA;AAE5F,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;CAC9C;AAED,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI,CAC3D,MAAM,GACJ,CACD;IACC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB,GACC,MAAM,GACN,MAAM,GACN;IAAE,CAAC,GAAG,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,KAAK,GAAG,SAAS,CAUvF;AAED,UAAU,iBAAkB,SAAQ,YAAY;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;CACb;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EACxD,EAAE,EAAE,MAAM,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,EAC7C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,iBAAiB,GACzB,KAAK,CAAC,CAAC,CAAC,CAQV"}
|
package/package.json
CHANGED
package/src/components/Btn.vue
CHANGED
|
@@ -239,6 +239,9 @@ a {
|
|
|
239
239
|
[dir="rtl"] .bgl_btn-icon{
|
|
240
240
|
transform: rotateY(180deg);
|
|
241
241
|
}
|
|
242
|
+
[dir="rtl"] .ltr .bgl_btn-icon{
|
|
243
|
+
transform: rotateY(0deg);
|
|
244
|
+
}
|
|
242
245
|
|
|
243
246
|
.bgl_btn-border, .bgl_btn-icon.bgl_btn_flat.bgl_btn-border {
|
|
244
247
|
border: 1px solid var(--btn-flat-color);
|
|
@@ -14,6 +14,7 @@ interface ColumnConfig {
|
|
|
14
14
|
width?: string
|
|
15
15
|
fixed?: boolean
|
|
16
16
|
hidden?: boolean
|
|
17
|
+
defaultValue?: any
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
// Define props interface with column configuration
|
|
@@ -119,7 +120,8 @@ const columns = computed(() => {
|
|
|
119
120
|
format: configuredColumn?.format ?? 'text',
|
|
120
121
|
width: configuredColumn?.width,
|
|
121
122
|
fixed: configuredColumn?.fixed ?? false,
|
|
122
|
-
hidden: configuredColumn?.hidden ?? false
|
|
123
|
+
hidden: configuredColumn?.hidden ?? false,
|
|
124
|
+
defaultValue: configuredColumn?.defaultValue
|
|
123
125
|
} as ColumnConfig
|
|
124
126
|
})
|
|
125
127
|
})
|
|
@@ -352,7 +354,8 @@ function updateCell(rowIndex: number, key: string, newValue: string | boolean) {
|
|
|
352
354
|
|
|
353
355
|
saveState('cell')
|
|
354
356
|
const parsedValue = parseValueForFormat(newValue, column?.format)
|
|
355
|
-
|
|
357
|
+
// If the parsed value is null/undefined, use the default value
|
|
358
|
+
localRows.value[rowIndex][key] = parsedValue ?? column?.defaultValue ?? (column?.format === 'boolean' ? false : '')
|
|
356
359
|
emitUpdate()
|
|
357
360
|
}
|
|
358
361
|
|
|
@@ -365,12 +368,16 @@ const scrollableColumns = computed(() => {
|
|
|
365
368
|
return columns.value.filter(col => !col.fixed && !col.hidden)
|
|
366
369
|
})
|
|
367
370
|
|
|
368
|
-
// Update createEmptyRow to
|
|
371
|
+
// Update createEmptyRow to use defaultValue from column config
|
|
369
372
|
function createEmptyRow(): Record<string, any> {
|
|
370
373
|
const newRow: Record<string, any> = {}
|
|
371
374
|
columns.value.forEach((col) => {
|
|
372
|
-
//
|
|
373
|
-
|
|
375
|
+
// Use defaultValue if provided, otherwise use format-specific defaults
|
|
376
|
+
if (col.defaultValue !== undefined) {
|
|
377
|
+
newRow[col.key] = col.defaultValue
|
|
378
|
+
} else {
|
|
379
|
+
newRow[col.key] = col.format === 'boolean' ? false : ''
|
|
380
|
+
}
|
|
374
381
|
})
|
|
375
382
|
return newRow
|
|
376
383
|
}
|
|
@@ -460,7 +467,7 @@ async function pasteSelection() {
|
|
|
460
467
|
// Add a variable to track the original value before editing
|
|
461
468
|
const editingOriginalValue = ref<string | null>(null)
|
|
462
469
|
|
|
463
|
-
// Update the startEditing function to
|
|
470
|
+
// Update the startEditing function to handle focus properly
|
|
464
471
|
function startEditing(row: number, col: number, initialKey?: string) {
|
|
465
472
|
const columnKey = columns.value[col]?.key
|
|
466
473
|
if (!columnKey) return
|
|
@@ -474,11 +481,17 @@ function startEditing(row: number, col: number, initialKey?: string) {
|
|
|
474
481
|
if (initialKey !== undefined) {
|
|
475
482
|
updateCell(row, columnKey, initialKey)
|
|
476
483
|
}
|
|
484
|
+
|
|
485
|
+
// Focus the input on the next tick after Vue has updated the DOM
|
|
477
486
|
nextTick(() => {
|
|
478
487
|
const inputKey = `cell-${row}-${col}`
|
|
479
488
|
const input = editInputRef.value.get(inputKey)
|
|
480
489
|
if (input) {
|
|
481
490
|
input.focus()
|
|
491
|
+
// If we have an initial key, set the selection to the end
|
|
492
|
+
if (initialKey !== undefined) {
|
|
493
|
+
input.value = initialKey
|
|
494
|
+
}
|
|
482
495
|
}
|
|
483
496
|
})
|
|
484
497
|
}
|
|
@@ -494,7 +507,20 @@ function stopEditing(cancelled = false) {
|
|
|
494
507
|
}
|
|
495
508
|
editingCell.value = null
|
|
496
509
|
editingOriginalValue.value = null
|
|
497
|
-
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// Update the handleStopEditingAndBlur function
|
|
513
|
+
function handleStopEditingAndBlur(cancelled = false) {
|
|
514
|
+
nextTick(() => {
|
|
515
|
+
stopEditing(cancelled)
|
|
516
|
+
nextTick(() => {
|
|
517
|
+
// Force focus back to the main spreadsheet container
|
|
518
|
+
const spreadsheet = document.querySelector('.spreadsheet') as HTMLElement
|
|
519
|
+
if (spreadsheet) {
|
|
520
|
+
spreadsheet.focus()
|
|
521
|
+
}
|
|
522
|
+
})
|
|
523
|
+
})
|
|
498
524
|
}
|
|
499
525
|
|
|
500
526
|
window.addEventListener('mouseup', handleMouseUp)
|
|
@@ -619,7 +645,7 @@ const filteredRows = computed(() => {
|
|
|
619
645
|
locked: !isCellEditable(col.key),
|
|
620
646
|
}"
|
|
621
647
|
:style="{ width: col.width }"
|
|
622
|
-
tabindex="0"
|
|
648
|
+
:tabindex="col.hidden ? undefined : 0"
|
|
623
649
|
@mousedown="handleMouseDown(rowIndex, fixedColumns.indexOf(col))"
|
|
624
650
|
@mouseover="handleMouseOver(rowIndex, fixedColumns.indexOf(col))"
|
|
625
651
|
@focusin="handleMouseOver(rowIndex, fixedColumns.indexOf(col))"
|
|
@@ -632,11 +658,10 @@ const filteredRows = computed(() => {
|
|
|
632
658
|
:value="row[col.key]"
|
|
633
659
|
type="text"
|
|
634
660
|
class="spreadsheet-input"
|
|
635
|
-
autofocus
|
|
636
661
|
@input="(e: Event) => updateCell(rowIndex, col.key, (e.target as HTMLInputElement).value)"
|
|
637
|
-
@blur="
|
|
638
|
-
@keydown.
|
|
639
|
-
@keydown.
|
|
662
|
+
@blur="handleStopEditingAndBlur(false)"
|
|
663
|
+
@keydown.enter.prevent="handleStopEditingAndBlur(false)"
|
|
664
|
+
@keydown.esc.prevent="handleStopEditingAndBlur(true)"
|
|
640
665
|
@mousedown.stop
|
|
641
666
|
>
|
|
642
667
|
<span class="spreadsheet-cell spreadsheetCellPlaceHolder">{{ formatCellValue(row[col.key], col.format) }}</span>
|
|
@@ -695,7 +720,7 @@ const filteredRows = computed(() => {
|
|
|
695
720
|
locked: !isCellEditable(col.key),
|
|
696
721
|
}"
|
|
697
722
|
:style="{ width: col.width }"
|
|
698
|
-
tabindex="0"
|
|
723
|
+
:tabindex="col.hidden ? undefined : 0"
|
|
699
724
|
@mousedown="handleMouseDown(rowIndex, fixedColumns.length + colIndex)"
|
|
700
725
|
@mouseover="handleMouseOver(rowIndex, fixedColumns.length + colIndex)"
|
|
701
726
|
@focusin="handleMouseOver(rowIndex, fixedColumns.length + colIndex)"
|
|
@@ -708,11 +733,10 @@ const filteredRows = computed(() => {
|
|
|
708
733
|
:value="row[col.key]"
|
|
709
734
|
type="text"
|
|
710
735
|
class="spreadsheet-input"
|
|
711
|
-
autofocus
|
|
712
736
|
@input="(e: Event) => updateCell(rowIndex, col.key, (e.target as HTMLInputElement).value)"
|
|
713
|
-
@blur="
|
|
714
|
-
@keydown.
|
|
715
|
-
@keydown.
|
|
737
|
+
@blur="handleStopEditingAndBlur(false)"
|
|
738
|
+
@keydown.enter.prevent="handleStopEditingAndBlur(false)"
|
|
739
|
+
@keydown.esc.prevent="handleStopEditingAndBlur(true)"
|
|
716
740
|
@mousedown.stop
|
|
717
741
|
>
|
|
718
742
|
<span class="spreadsheet-cell spreadsheetCellPlaceHolder">{{ formatCellValue(row[col.key], col.format) }}</span>
|
|
@@ -31,7 +31,7 @@ onMounted(() => {
|
|
|
31
31
|
}
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
const formState = ref<'success' | 'error' | 'idle'>('idle')
|
|
34
|
+
const formState = ref<'success' | 'error' | 'idle' | 'submitting'>('idle')
|
|
35
35
|
|
|
36
36
|
watch(() => props.modelValue, (newValue) => {
|
|
37
37
|
if (newValue !== undefined) {
|
|
@@ -60,9 +60,13 @@ function updateFormData(fieldId: string, value: any) {
|
|
|
60
60
|
|
|
61
61
|
async function handleSubmit() {
|
|
62
62
|
try {
|
|
63
|
+
if (formState.value === 'submitting') return
|
|
64
|
+
formState.value = 'submitting'
|
|
63
65
|
await props.onSubmit?.(formData.value)
|
|
64
66
|
initialFormData.value = structuredClone(formData.value)
|
|
65
67
|
formState.value = 'success'
|
|
68
|
+
// Notify parent window of successful submission
|
|
69
|
+
window.parent.postMessage({ type: 'BAGEL_FORM_SUCCESS', data: formData.value }, '*')
|
|
66
70
|
} catch (error) {
|
|
67
71
|
formState.value = 'error'
|
|
68
72
|
}
|
|
@@ -98,7 +102,7 @@ defineExpose({ form, isDirty, validateForm })
|
|
|
98
102
|
</template>
|
|
99
103
|
</template>
|
|
100
104
|
<slot v-else />
|
|
101
|
-
<slot name="submit" :submit="handleSubmit" :isDirty="isDirty" :validateForm="validateForm" />
|
|
105
|
+
<slot name="submit" :submit="handleSubmit" :isDirty="isDirty" :validateForm="validateForm" :formState="formState" />
|
|
102
106
|
<slot v-if="formState === 'success'" name="success" />
|
|
103
107
|
<slot v-if="formState === 'error'" name="error" />
|
|
104
108
|
</form>
|
|
@@ -100,13 +100,13 @@ defineExpose({ open, close })
|
|
|
100
100
|
<Btn flat class="color-white" icon="add" :disabled="zoom === 3" @click="zoom++" />
|
|
101
101
|
</div>
|
|
102
102
|
<Btn
|
|
103
|
-
v-if="currentItem?.openFile" class="color-white" round thin flat iconEnd="arrow_outward"
|
|
103
|
+
v-if="currentItem?.openFile && currentItem?.src" class="color-white" round thin flat iconEnd="arrow_outward"
|
|
104
104
|
value="Open File"
|
|
105
105
|
:href="currentItem?.src"
|
|
106
106
|
target="_blank"
|
|
107
107
|
/>
|
|
108
108
|
<Btn
|
|
109
|
-
v-if="currentItem?.download" class="color-white" round thin flat icon="download"
|
|
109
|
+
v-if="currentItem?.download && currentItem?.src" class="color-white" round thin flat icon="download"
|
|
110
110
|
value="Download File"
|
|
111
111
|
:href="upgradeHeaders(currentItem?.src)"
|
|
112
112
|
download
|
|
@@ -117,11 +117,11 @@ defineExpose({ open, close })
|
|
|
117
117
|
<Carousel v-model:index="currentIndex" :items="1" class="bgl-lightbox-item" :class="{ zoomed: zoom > 1 }" :freeDrag="zoom === 1">
|
|
118
118
|
<template v-for="item in group" :key="item.src">
|
|
119
119
|
<Zoomer v-if="item.type === 'image'" v-model:zoom="zoom" :disabled="!item?.enableZoom" :mouse-wheel-to-zoom="false">
|
|
120
|
-
<Image :draggable="false" :src="item?.src" alt="Preview" class="vw90 lightbox-image" />
|
|
120
|
+
<Image :draggable="false" :src="item?.src" :pathKey="item?.pathKey" alt="Preview" class="vw90 lightbox-image" />
|
|
121
121
|
</Zoomer>
|
|
122
122
|
|
|
123
123
|
<BglVideo
|
|
124
|
-
v-else-if="item?.type === 'video'"
|
|
124
|
+
v-else-if="item?.type === 'video' && item?.src"
|
|
125
125
|
:src="item?.src"
|
|
126
126
|
autoplay
|
|
127
127
|
controls
|
|
@@ -129,7 +129,7 @@ defineExpose({ open, close })
|
|
|
129
129
|
/>
|
|
130
130
|
|
|
131
131
|
<embed
|
|
132
|
-
v-else-if="item?.type === 'pdf'"
|
|
132
|
+
v-else-if="item?.type === 'pdf' && item?.src"
|
|
133
133
|
:src="normalizeURL(item?.src)"
|
|
134
134
|
type="application/pdf"
|
|
135
135
|
width="100%"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VNode } from 'vue'
|
|
2
|
-
import type { BaseBagelField } from '../types/BagelForm'
|
|
2
|
+
import type { BaseBagelField, BglFormSchemaT } from '../types/BagelForm'
|
|
3
3
|
import {
|
|
4
4
|
TextInput,
|
|
5
5
|
NumberInput,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
classify,
|
|
18
18
|
keyToLabel
|
|
19
19
|
} from '@bagelink/vue'
|
|
20
|
-
import { h } from 'vue'
|
|
20
|
+
import { h, isVNode } from 'vue'
|
|
21
21
|
|
|
22
22
|
const SLOT_VALUE_COMPONENTS = new Set(['div', 'span', 'p'])
|
|
23
23
|
|
|
@@ -30,6 +30,12 @@ export interface UseSchemaFieldOptions<T> {
|
|
|
30
30
|
includeUnset?: boolean
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
// Add type for supported child types
|
|
34
|
+
type SupportedChild<T> = BaseBagelField<T> | string | VNode
|
|
35
|
+
interface SlotProps<T> { row: T, field: BaseBagelField<T> }
|
|
36
|
+
type SlotFunction<T> = (props: SlotProps<T>) => any
|
|
37
|
+
type SupportedSlot<T> = BglFormSchemaT<T> | VNode | SlotFunction<T>
|
|
38
|
+
|
|
33
39
|
export function useSchemaField<T extends { [key: string]: any }>(options: UseSchemaFieldOptions<T>) {
|
|
34
40
|
const { mode = 'form', getRowData, onUpdate, includeUnset = false } = options
|
|
35
41
|
|
|
@@ -57,9 +63,19 @@ export function useSchemaField<T extends { [key: string]: any }>(options: UseSch
|
|
|
57
63
|
return typeof field.$el === 'object' ? field.$el : componentMap[field.$el as keyof typeof componentMap] ?? field.$el ?? 'div'
|
|
58
64
|
}
|
|
59
65
|
|
|
66
|
+
function isSlotFunction<T>(slot: unknown): slot is SlotFunction<T> {
|
|
67
|
+
return typeof slot === 'function'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function renderChild(child: SupportedChild<T>, slots?: Record<string, SupportedSlot<T>>): any {
|
|
71
|
+
if (typeof child === 'string') return child
|
|
72
|
+
if (isVNode(child)) return child
|
|
73
|
+
return renderField(child, slots)
|
|
74
|
+
}
|
|
75
|
+
|
|
60
76
|
function renderField(
|
|
61
77
|
field: BaseBagelField<T>,
|
|
62
|
-
slots?: Record<string,
|
|
78
|
+
slots?: Record<string, SupportedSlot<T>>
|
|
63
79
|
): VNode | null {
|
|
64
80
|
const Component = getComponent(field)
|
|
65
81
|
if (!Component) return null
|
|
@@ -169,10 +185,7 @@ export function useSchemaField<T extends { [key: string]: any }>(options: UseSch
|
|
|
169
185
|
// Add default slot if there are children
|
|
170
186
|
if (children?.length) {
|
|
171
187
|
componentSlots.default = () => children
|
|
172
|
-
.map(
|
|
173
|
-
if (typeof child === 'string') return child
|
|
174
|
-
return renderField(child, slots)
|
|
175
|
-
})
|
|
188
|
+
.map(child => renderChild(child, slots))
|
|
176
189
|
.filter(Boolean) // Filter out null results from vIf
|
|
177
190
|
}
|
|
178
191
|
|
|
@@ -181,18 +194,29 @@ export function useSchemaField<T extends { [key: string]: any }>(options: UseSch
|
|
|
181
194
|
componentSlots.default = () => transformedValue?.toString() || ''
|
|
182
195
|
}
|
|
183
196
|
|
|
184
|
-
//
|
|
197
|
+
// Handle custom slots from the field
|
|
185
198
|
if (fieldSlots) {
|
|
186
199
|
Object.entries(fieldSlots).forEach(([name, slot]) => {
|
|
187
|
-
componentSlots[name] =
|
|
188
|
-
|
|
189
|
-
|
|
200
|
+
componentSlots[name] = () => {
|
|
201
|
+
if (Array.isArray(slot)) {
|
|
202
|
+
// Handle BglFormSchemaT array
|
|
203
|
+
return slot.map(schemaField => renderField(schemaField as BaseBagelField<T>, slots))
|
|
204
|
+
} else if (isVNode(slot)) {
|
|
205
|
+
// Handle VNode
|
|
206
|
+
return slot
|
|
207
|
+
} else if (typeof slot === 'function') {
|
|
208
|
+
// Handle function slot
|
|
209
|
+
const slotFn = slot as (props: SlotProps<T>) => any
|
|
210
|
+
return slotFn({ row: rowData, field })
|
|
211
|
+
}
|
|
212
|
+
return slot
|
|
213
|
+
}
|
|
190
214
|
})
|
|
191
215
|
}
|
|
192
216
|
|
|
193
217
|
// Handle custom slot content from parent
|
|
194
218
|
const slotContent = field.id && slots?.[field.id]
|
|
195
|
-
? slots[field.id]({ row: rowData, field })
|
|
219
|
+
? (slots[field.id] as SlotFunction<T>)({ row: rowData, field })
|
|
196
220
|
: undefined
|
|
197
221
|
|
|
198
222
|
if (mode === 'preview') {
|
package/src/types/BagelForm.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SelectInput, TextInput } from '@bagelink/vue'
|
|
2
|
+
import type { VNode } from 'vue'
|
|
2
3
|
|
|
3
4
|
export type AttributeValue = string | number | boolean | undefined | undefined | { [key: string]: any }
|
|
4
5
|
|
|
@@ -29,7 +30,7 @@ export interface BaseBagelField<T = { [key: string]: any }> {
|
|
|
29
30
|
'id'?: keyof T extends string ? keyof T : string
|
|
30
31
|
'label'?: string
|
|
31
32
|
'placeholder'?: string
|
|
32
|
-
'children'?: (Field<T> | string)[]
|
|
33
|
+
'children'?: (Field<T> | string | VNode)[]
|
|
33
34
|
'class'?: AttributeValue | AttributeFn<T>
|
|
34
35
|
'attrs'?: Attributes<T>
|
|
35
36
|
'required'?: boolean
|
|
@@ -235,7 +235,8 @@ export function findBglFieldById(id: string, _schema: BglFormSchemaT): Field | u
|
|
|
235
235
|
for (const field of _schema) {
|
|
236
236
|
if (field.id === id) return field
|
|
237
237
|
if (field.children && Number(field.children.length) > 0) {
|
|
238
|
-
const
|
|
238
|
+
const fieldChildren = field.children.filter((c): c is Field => typeof c === 'object' && '$el' in c)
|
|
239
|
+
const child = findBglFieldById(id, fieldChildren)
|
|
239
240
|
if (child) return child
|
|
240
241
|
}
|
|
241
242
|
}
|