@bagelink/vue 1.9.41 → 1.9.45

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.9.41",
4
+ "version": "1.9.45",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -91,6 +91,7 @@
91
91
  "scripts": {
92
92
  "dev": "tsx watch src/index.ts",
93
93
  "build": "vite build",
94
+ "test-build": "pnpm build && node test-build.js",
94
95
  "start": "tsx src/index.ts",
95
96
  "test": "vitest"
96
97
  }
@@ -128,7 +128,7 @@ watch(() => props.modelValue, () => {
128
128
  </script>
129
129
 
130
130
  <template>
131
- <div class="code-editor-container ltr" :style="{ maxHeight }">
131
+ <div class="code-editor-container ltr" :style="{ height: maxHeight }" :class="{ 'mb-2': label }">
132
132
  <label v-if="label" class="label">{{ label }}</label>
133
133
  <div v-if="loaded" ref="editorRef" class="code-editor-grandpa hljs">
134
134
  <div class="editor-content-papa relative">
@@ -174,7 +174,7 @@ watch(() => props.modelValue, () => {
174
174
  .editor-content-papa {
175
175
  position: relative;
176
176
  width: 100%;
177
- padding-bottom: calc(100% - 6.5lh);
177
+ min-height: 100%;
178
178
  }
179
179
 
180
180
  .code-display,
@@ -350,21 +350,17 @@ function usesCustomComponent(field: FieldBuilder): boolean {
350
350
 
351
351
  // Validate all visible fields
352
352
  function validateAll(): boolean {
353
- console.log('[FormFlow] validateAll started')
354
353
  let isValid = true
355
354
  const newErrors: Record<string, string> = {}
356
355
 
357
356
  for (const { key, field } of visibleFields.value) {
358
357
  const value = getFieldValue(key)
359
- console.log(`[FormFlow] Validating field "${key}":`, { value, required: field._config.required, type: field._type })
360
358
 
361
359
  // Check required fields first
362
360
  if (field._config.required === true) {
363
361
  const isEmpty = value == null || value === '' || (Array.isArray(value) && value.length === 0)
364
362
  if (isEmpty) {
365
- const errorMsg = field._config.requiredMessage || 'This field is required'
366
- console.log(`[FormFlow] Field "${key}" is required but empty, error:`, errorMsg)
367
- newErrors[key] = errorMsg
363
+ newErrors[key] = field._config.requiredMessage || 'This field is required'
368
364
  isValid = false
369
365
  continue
370
366
  }
@@ -372,11 +368,9 @@ function validateAll(): boolean {
372
368
 
373
369
  // Run custom validations
374
370
  if (field._validations != null) {
375
- console.log(`[FormFlow] Running ${field._validations.length} custom validations for "${key}"`)
376
371
  for (const validate of field._validations) {
377
372
  const result = validate(value)
378
373
  if (result !== true) {
379
- console.log(`[FormFlow] Field "${key}" failed validation:`, result)
380
374
  newErrors[key] = result
381
375
  isValid = false
382
376
  break
@@ -385,24 +379,19 @@ function validateAll(): boolean {
385
379
  }
386
380
  }
387
381
 
388
- console.log('[FormFlow] validateAll complete:', { isValid, newErrors })
389
382
  validationErrors.value = newErrors
390
383
  return isValid
391
384
  }
392
385
 
393
- // Submit handler for the slot
386
+ // Submit handler for the slot (arrow function preserves closure scope during bundling)
394
387
  function handleSubmit(event?: Event): boolean {
395
- console.log('[FormFlow] handleSubmit called', { event, hasEvent: !!event })
396
-
397
388
  // Prevent default form submission if event is provided
398
389
  if (event) {
399
390
  event.preventDefault()
400
391
  }
401
392
 
402
393
  hasSubmitted.value = true
403
- console.log('[FormFlow] Before validateAll, visibleFields count:', visibleFields.value.length)
404
394
  const isValid = validateAll()
405
- console.log('[FormFlow] After validateAll, isValid:', isValid, 'validationErrors:', validationErrors.value)
406
395
 
407
396
  // If validation fails, scroll to first error
408
397
  if (!isValid) {
@@ -410,7 +399,6 @@ function handleSubmit(event?: Event): boolean {
410
399
 
411
400
  // Find the first field with an error
412
401
  const firstErrorKey = visibleFields.value.find(({ key }) => validationErrors.value[key])?.key
413
- console.log('[FormFlow] Validation failed, firstErrorKey:', firstErrorKey)
414
402
 
415
403
  if (firstErrorKey && formElement.value) {
416
404
  // Find the input element - try multiple strategies
@@ -430,7 +418,6 @@ function handleSubmit(event?: Event): boolean {
430
418
  }
431
419
  }
432
420
  } else {
433
- console.log('[FormFlow] Validation passed, emitting submit with formData:', formData.value)
434
421
  // Emit submit event with form data when validation passes
435
422
  emit('submit', formData.value)
436
423
  }
@@ -443,14 +430,6 @@ defineExpose({
443
430
  validate: validateAll,
444
431
  handleSubmit
445
432
  })
446
-
447
- // Debug logging on mount
448
- console.log('[FormFlow] Component mounted', {
449
- version: '1.9.39-debug',
450
- schemaFields: Object.keys(props.schema._fields).length,
451
- handleSubmitDefined: !!handleSubmit,
452
- validateAllDefined: !!validateAll
453
- })
454
433
  </script>
455
434
 
456
435
  <template>
@@ -517,7 +496,7 @@ console.log('[FormFlow] Component mounted', {
517
496
  <!-- Submit slot -->
518
497
  <slot
519
498
  name="submit" :submit="handleSubmit" :validate="validateAll" :form-data="formData"
520
- :errors="mergedErrors" :debug-info="{ handleSubmitType: typeof handleSubmit, validateAllType: typeof validateAll }"
499
+ :errors="mergedErrors"
521
500
  />
522
501
  </form>
523
502
  </template>
@@ -10,6 +10,14 @@
10
10
  text-align: end;
11
11
  }
12
12
 
13
+ .txt-left {
14
+ text-align: left;
15
+ }
16
+
17
+ .text-right {
18
+ text-align: right;
19
+ }
20
+
13
21
  .txt-justify {
14
22
  text-align: justify;
15
23
  }
@@ -1471,6 +1479,14 @@
1471
1479
  text-align: end;
1472
1480
  }
1473
1481
 
1482
+ .m_txt-left {
1483
+ text-align: left;
1484
+ }
1485
+
1486
+ .m_txt-right {
1487
+ text-align: right;
1488
+ }
1489
+
1474
1490
  .m_txt-justify {
1475
1491
  text-align: justify;
1476
1492
  }
package/vite.config.ts CHANGED
@@ -22,7 +22,7 @@ export default defineConfig(() => ({
22
22
  },
23
23
  // experimental: { enableNativePlugin: true },
24
24
  build: {
25
- minify: false, // Disabled - minification breaks Vue reactive closures in production
25
+ minify: 'esbuild', // Arrow functions should preserve scope even with minification
26
26
  lib: {
27
27
  entry: resolve(indexDir, 'index.ts'),
28
28
  formats: ['es', 'cjs'],