@bagelink/vue 1.21.1 → 1.21.5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.21.1",
4
+ "version": "1.21.5",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -63,7 +63,7 @@
63
63
  "@types/signature_pad": "^4.0.0",
64
64
  "vue": "^3.5.43",
65
65
  "vue-component-type-helpers": "^2.2.12",
66
- "@bagelink/sdk": "1.21.1"
66
+ "@bagelink/sdk": "1.21.5"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@bagelink/sdk": "*",
@@ -178,12 +178,26 @@ function onUpdate(value: T, i: number) {
178
178
  updateModel()
179
179
  }
180
180
 
181
+ function isNestedFormFlow(vnode: VNode): boolean {
182
+ const type = vnode.type as { name?: string, __name?: string, __file?: string } | string | symbol
183
+ if (!type || typeof type === 'string' || typeof type === 'symbol') return false
184
+ return type.__name === 'FormFlow'
185
+ || type.name === 'FormFlow'
186
+ || Boolean(type.__file?.includes('FormFlow.vue'))
187
+ }
188
+
181
189
  const isSimple = computed(() => {
182
- if (props.simple) return true
190
+ // Explicit opt-in/out wins. Nested multi-field schemas must be able to force
191
+ // `simple: false` so field labels inside each row stay visible.
192
+ if (props.simple != null) return !!props.simple
183
193
  if (!slots.default) return false
184
194
  const dummyItem = computed({ get: () => undefined as T, set: () => { } })
185
195
  const vnodes = slots.default({ item: dummyItem, index: 0 }) as VNode[]
186
- return vnodes.filter(vn => typeof vn.type !== 'symbol').length === 1
196
+ const content = vnodes.filter(vn => typeof vn.type !== 'symbol')
197
+ // A single nested FormFlow is one vnode but contains many labeled fields —
198
+ // never treat that as "simple" (which hides `.label-text`).
199
+ if (content.length === 1 && isNestedFormFlow(content[0]!)) return false
200
+ return content.length === 1
187
201
  })
188
202
 
189
203
  // Create a writable computed ref for each item
@@ -651,7 +651,8 @@ defineExpose({
651
651
  >
652
652
  <!-- Array field with nested schema -->
653
653
  <template v-if="field._type === 'array' && field._config.schema?._isSchema">
654
- <ArrayInput v-bind="getFieldProps(field, key)" :create-item="() => createArrayItem(field)">
654
+ <!-- Force simple=false: nested FormFlow is one vnode but needs field labels. -->
655
+ <ArrayInput v-bind="getFieldProps(field, key)" :simple="false" :create-item="() => createArrayItem(field)">
655
656
  <template #default="{ item }">
656
657
  <!-- @vue-ignore -->
657
658
  <FormFlow