@bagelink/vue 1.21.26 → 1.21.32

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.
Files changed (39) hide show
  1. package/dist/{StructuredEditor-BQEjrMDP.js → StructuredEditor-78Df0ADI.js} +4 -2
  2. package/dist/{StructuredEditor-UdsxFbg_.cjs → StructuredEditor-MXkv4nok.cjs} +2 -2
  3. package/dist/StructuredEditor.css +1 -1
  4. package/dist/components/Card.vue.d.ts +4 -0
  5. package/dist/components/Card.vue.d.ts.map +1 -1
  6. package/dist/components/form/inputs/ArrayInput.vue.d.ts +15 -0
  7. package/dist/components/form/inputs/ArrayInput.vue.d.ts.map +1 -1
  8. package/dist/components/form/inputs/Checkbox.vue.d.ts +13 -2
  9. package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
  10. package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -1
  11. package/dist/components/form/inputs/CodeEditor/StructuredEditor.vue.d.ts.map +1 -1
  12. package/dist/core.css +2 -2
  13. package/dist/form-flow/FormFlow.vue.d.ts +2 -0
  14. package/dist/form-flow/FormFlow.vue.d.ts.map +1 -1
  15. package/dist/form-flow/form-flow.d.ts +34 -0
  16. package/dist/form-flow/form-flow.d.ts.map +1 -1
  17. package/dist/i18n/index.d.ts +30 -0
  18. package/dist/i18n/index.d.ts.map +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.mjs +1 -1
  21. package/dist/{src-C0qYUY7s.js → src-CeEsGKN7.js} +10076 -9882
  22. package/dist/src-Duj4FrLr.cjs +764 -0
  23. package/dist/src.css +1 -1
  24. package/dist/style.css +2 -2
  25. package/package.json +2 -2
  26. package/src/components/Card.vue +32 -0
  27. package/src/components/form/inputs/ArrayInput.vue +274 -73
  28. package/src/components/form/inputs/Checkbox.vue +75 -22
  29. package/src/components/form/inputs/CodeEditor/Index.vue +7 -0
  30. package/src/components/form/inputs/CodeEditor/StructuredEditor.vue +12 -0
  31. package/src/form-flow/FormFlow.vue +31 -3
  32. package/src/form-flow/form-flow.ts +34 -0
  33. package/src/i18n/locales/en.json +6 -1
  34. package/src/i18n/locales/es.json +6 -1
  35. package/src/i18n/locales/fr.json +6 -1
  36. package/src/i18n/locales/he.json +6 -1
  37. package/src/i18n/locales/it.json +6 -1
  38. package/src/i18n/locales/ru.json +6 -1
  39. package/dist/src-pIF2XEoP.cjs +0 -764
@@ -135,12 +135,19 @@ watch(() => props.modelValue, value => {
135
135
  <style scoped>
136
136
  .code-editor-container {
137
137
  margin-bottom: 0.5rem;
138
+ width: 100%;
139
+ max-width: 100%;
138
140
  height: 100%;
141
+ min-width: 0;
139
142
  min-height: 0;
143
+ /* Keep long unwrapped lines inside the host — don't let content widen the parent. */
144
+ overflow: hidden;
140
145
  }
141
146
  .code-editor-container > :deep(.structured-editor) {
142
147
  flex: 1;
148
+ min-width: 0;
143
149
  min-height: 0;
150
+ width: 100%;
144
151
  }
145
152
  /* Focus ring only while the CodeMirror surface is focused — not toolbar buttons (e.g. Copy). */
146
153
  .code-editor-container:not(.frame):not(.bgl-outline):not(.terminal):not(.single-line) > :deep(.structured-editor:not(.toolbar-hover):has(.cm-focused) .structured-editor-host),
@@ -123,6 +123,8 @@ function extensions(): Extension[] {
123
123
  EditorView.theme({
124
124
  '&': {
125
125
  height: '100%',
126
+ width: '100%',
127
+ maxWidth: '100%',
126
128
  ...(props.terminal ? { backgroundColor: 'transparent' } : {}),
127
129
  },
128
130
  '.cm-scroller': {
@@ -335,7 +337,9 @@ onBeforeUnmount(() => {
335
337
  position: relative;
336
338
  display: flex;
337
339
  flex-direction: column;
340
+ width: 100%;
338
341
  height: 100%;
342
+ min-width: 0;
339
343
  min-height: 0;
340
344
  max-height: var(--code-max-height, none);
341
345
  overflow: hidden;
@@ -344,9 +348,17 @@ onBeforeUnmount(() => {
344
348
  }
345
349
  .structured-editor-host {
346
350
  flex: 1;
351
+ min-width: 0;
347
352
  min-height: 0;
353
+ width: 100%;
348
354
  overflow: auto;
349
355
  }
356
+ /* CodeMirror grows with long lines by default; pin it to the host width. */
357
+ .structured-editor-host :deep(.cm-editor) {
358
+ width: 100%;
359
+ max-width: 100%;
360
+ height: 100%;
361
+ }
350
362
  /* Bar mode: chrome (label/language/actions) sits above; the code surface is the rounded input. */
351
363
  .structured-editor:not(.toolbar-hover):not(.terminal):not(.single-line) .structured-editor-host {
352
364
  border-radius: var(--code-border-radius, 0.25rem);
@@ -42,6 +42,8 @@ export interface Props<T extends Record<string, any> = Record<string, any>> {
42
42
  errors?: Record<string, string>
43
43
  /** Async submit handler — FormFlow awaits it and manages formState. */
44
44
  onSubmit?: (data: T) => Promise<void> | void
45
+ /** Disable every field. Nested array rows inherit this. */
46
+ disabled?: boolean
45
47
  }
46
48
 
47
49
  type FormFlowSlots<T> = {
@@ -419,6 +421,10 @@ const mergedErrors = computed(() => {
419
421
  return resolved
420
422
  })
421
423
 
424
+ function fieldLocked(field: FieldBuilder): boolean {
425
+ return Boolean(props.disabled || field._config.disabled || field._config.readonly)
426
+ }
427
+
422
428
  function getFieldProps(field: FieldBuilder, key: string) {
423
429
  const label = generateLabel(key, field)
424
430
  const { helpText, ...configRest } = field._config
@@ -476,6 +482,11 @@ function getFieldProps(field: FieldBuilder, key: string) {
476
482
  baseProps.language = baseProps.language ?? 'json'
477
483
  }
478
484
 
485
+ if (props.disabled) {
486
+ baseProps.disabled = true
487
+ baseProps.readonly = true
488
+ }
489
+
479
490
  if (field._type === 'array') {
480
491
  // `default` / `schema` are form-schema metadata — never pass them through to ArrayInput
481
492
  // (and the earlier config spread may have already set them).
@@ -493,6 +504,10 @@ function getFieldProps(field: FieldBuilder, key: string) {
493
504
  baseProps['onUpdate:modelValue'] = (val: any) => { updateField(key, val, field) }
494
505
  baseProps.allowAdd = baseProps.allowAdd ?? true
495
506
  baseProps.allowDelete = baseProps.allowDelete ?? true
507
+ if (props.disabled) {
508
+ baseProps.disabled = true
509
+ baseProps.readonly = true
510
+ }
496
511
  }
497
512
  return baseProps
498
513
  }
@@ -651,14 +666,21 @@ defineExpose({
651
666
  >
652
667
  <!-- Array field with nested schema -->
653
668
  <template v-if="field._type === 'array' && field._config.schema?._isSchema">
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)">
669
+ <!-- Nested FormFlow defaults to simple=false (keep inner field labels),
670
+ but honor an explicit schema `simple: true` for single-field rows
671
+ (e.g. emails/phones) that should render as one compact line. -->
672
+ <ArrayInput
673
+ v-bind="getFieldProps(field, key)"
674
+ :simple="field._config.simple ?? false"
675
+ :create-item="() => createArrayItem(field)"
676
+ >
656
677
  <template #default="{ item }">
657
678
  <!-- @vue-ignore -->
658
679
  <FormFlow
659
680
  :model-value="(item.value as any)"
660
681
  :schema="(field._config.schema as any)"
661
682
  :components="components"
683
+ :disabled="fieldLocked(field)"
662
684
  @update:model-value="(val: any) => { item.value = val }"
663
685
  />
664
686
  </template>
@@ -672,6 +694,7 @@ defineExpose({
672
694
  <component
673
695
  :is="getFieldComponent(field._config.schema as string)"
674
696
  :model-value="(item.value as string | number | undefined)"
697
+ :disabled="fieldLocked(field)"
675
698
  @update:model-value="(val: any) => { item.value = val }"
676
699
  />
677
700
  </template>
@@ -682,7 +705,11 @@ defineExpose({
682
705
  <template v-else-if="field._type === 'array' && field._config.schema">
683
706
  <ArrayInput v-bind="getFieldProps(field, key)" :create-item="() => createArrayItem(field)">
684
707
  <template #default="{ item }">
685
- <component :is="resolveComponent(field._config.schema)" v-model="item.value" />
708
+ <component
709
+ :is="resolveComponent(field._config.schema)"
710
+ v-model="item.value"
711
+ :disabled="fieldLocked(field)"
712
+ />
686
713
  </template>
687
714
  </ArrayInput>
688
715
  </template>
@@ -694,6 +721,7 @@ defineExpose({
694
721
  <component
695
722
  :is="getFieldComponent(field._config.itemType)"
696
723
  :model-value="(item.value as string | number | undefined)"
724
+ :disabled="fieldLocked(field)"
697
725
  @update:model-value="(val: any) => { item.value = val }"
698
726
  />
699
727
  </template>
@@ -454,6 +454,23 @@ export const $ = {
454
454
  max?: number
455
455
  simple?: boolean
456
456
  reorderOnly?: boolean
457
+ itemLabel?: string
458
+ addText?: string
459
+ emptyText?: string
460
+ /** Show `(n)` next to the field label. Opt-in. */
461
+ showCount?: boolean
462
+ /** Show per-row numbers/labels in non-collapsible mode. Opt-in. */
463
+ showItemNumbers?: boolean
464
+ /** Light border around each non-collapsible row. Opt-in. */
465
+ separated?: boolean
466
+ /** Show EmptyState when the list is empty. Opt-in. */
467
+ showEmptyState?: boolean
468
+ /** Derive Add label from `itemLabel` / “add another…”. Opt-in. */
469
+ smartAddText?: boolean
470
+ /** Border around the whole list (via BagelInputShell `outline`). */
471
+ outline?: boolean
472
+ /** Border around the list that highlights on focus-within (via BagelInputShell `frame`). */
473
+ frame?: boolean
457
474
  /** Row insertion order and Add button placement: 'newest-first' (default) or 'oldest-first'. */
458
475
  sortOrder?: 'newest-first' | 'oldest-first'
459
476
  }),
@@ -466,6 +483,23 @@ export const $ = {
466
483
  max?: number
467
484
  simple?: boolean
468
485
  reorderOnly?: boolean
486
+ itemLabel?: string
487
+ addText?: string
488
+ emptyText?: string
489
+ /** Show `(n)` next to the field label. Opt-in. */
490
+ showCount?: boolean
491
+ /** Show per-row numbers/labels in non-collapsible mode. Opt-in. */
492
+ showItemNumbers?: boolean
493
+ /** Light border around each non-collapsible row. Opt-in. */
494
+ separated?: boolean
495
+ /** Show EmptyState when the list is empty. Opt-in. */
496
+ showEmptyState?: boolean
497
+ /** Derive Add label from `itemLabel` / “add another…”. Opt-in. */
498
+ smartAddText?: boolean
499
+ /** Border around the whole list (via BagelInputShell `outline`). */
500
+ outline?: boolean
501
+ /** Border around the list that highlights on focus-within (via BagelInputShell `frame`). */
502
+ frame?: boolean
469
503
  /** Row insertion order and Add button placement: 'newest-first' (default) or 'oldest-first'. */
470
504
  sortOrder?: 'newest-first' | 'oldest-first'
471
505
  }
@@ -66,7 +66,12 @@
66
66
  "loadDefault": "Load Default {label}"
67
67
  },
68
68
  "arrayInput": {
69
- "item": "Item"
69
+ "item": "Item",
70
+ "empty": "No items yet",
71
+ "add": "Add",
72
+ "addItem": "Add {item}",
73
+ "addAnother": "Add another",
74
+ "addAnotherItem": "Add another {item}"
70
75
  },
71
76
  "btn": {
72
77
  "loading": "Loading..."
@@ -65,7 +65,12 @@
65
65
  "loadDefault": "Cargar {label} predeterminado"
66
66
  },
67
67
  "arrayInput": {
68
- "item": "Elemento"
68
+ "item": "Elemento",
69
+ "empty": "Aún no hay elementos",
70
+ "add": "Añadir",
71
+ "addItem": "Añadir {item}",
72
+ "addAnother": "Añadir otro",
73
+ "addAnotherItem": "Añadir otro {item}"
69
74
  },
70
75
  "btn": {
71
76
  "loading": "Cargando..."
@@ -65,7 +65,12 @@
65
65
  "loadDefault": "Charger {label} par défaut"
66
66
  },
67
67
  "arrayInput": {
68
- "item": "Élément"
68
+ "item": "Élément",
69
+ "empty": "Aucun élément pour le moment",
70
+ "add": "Ajouter",
71
+ "addItem": "Ajouter {item}",
72
+ "addAnother": "Ajouter un autre",
73
+ "addAnotherItem": "Ajouter un autre {item}"
69
74
  },
70
75
  "btn": {
71
76
  "loading": "Chargement..."
@@ -66,7 +66,12 @@
66
66
  "loadDefault": "טען {label} ברירת מחדל"
67
67
  },
68
68
  "arrayInput": {
69
- "item": "פריט"
69
+ "item": "פריט",
70
+ "empty": "אין פריטים עדיין",
71
+ "add": "הוסף",
72
+ "addItem": "הוסף {item}",
73
+ "addAnother": "הוסף עוד",
74
+ "addAnotherItem": "הוסף עוד {item}"
70
75
  },
71
76
  "btn": {
72
77
  "loading": "טוען..."
@@ -65,7 +65,12 @@
65
65
  "loadDefault": "Carica {label} predefinito"
66
66
  },
67
67
  "arrayInput": {
68
- "item": "Elemento"
68
+ "item": "Elemento",
69
+ "empty": "Nessun elemento ancora",
70
+ "add": "Aggiungi",
71
+ "addItem": "Aggiungi {item}",
72
+ "addAnother": "Aggiungi un altro",
73
+ "addAnotherItem": "Aggiungi un altro {item}"
69
74
  },
70
75
  "btn": {
71
76
  "loading": "Caricamento..."
@@ -65,7 +65,12 @@
65
65
  "loadDefault": "Загрузить {label} по умолчанию"
66
66
  },
67
67
  "arrayInput": {
68
- "item": "Элемент"
68
+ "item": "Элемент",
69
+ "empty": "Пока нет элементов",
70
+ "add": "Добавить",
71
+ "addItem": "Добавить {item}",
72
+ "addAnother": "Добавить ещё",
73
+ "addAnotherItem": "Добавить ещё {item}"
69
74
  },
70
75
  "btn": {
71
76
  "loading": "Загрузка..."