@bagelink/vue 1.15.192 → 1.15.196

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.15.192",
4
+ "version": "1.15.196",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -6,7 +6,7 @@ export type { FilterField, QueryOption, OptionsSource }
6
6
  <script setup lang="ts" generic="T extends Record<string, any>">
7
7
  import type { ComparisonOperator, LogicalOperator, QueryConditions } from '../utils/queryFilter'
8
8
  import { parseQuery } from '../utils/queryFilter'
9
- import { Btn, DateInput, Dropdown, Icon, SelectInput, TextInput, useI18n, useDebounceFn } from '@bagelink/vue'
9
+ import { Btn, Card, DateInput, Dropdown, Icon, SelectInput, TextInput, useI18n, useDebounceFn } from '@bagelink/vue'
10
10
  import { computed, getCurrentInstance, ref } from 'vue'
11
11
 
12
12
  interface UICondition {
@@ -373,7 +373,7 @@ function onConnectorChange(id: string, connector: LogicalOperator) {
373
373
  flat placement="bottom-end" icon="filter_alt"
374
374
  :value="activeFiltersCount > 0 ? `${currentTexts.filter} (${activeFiltersCount})` : currentTexts.filter" thin
375
375
  >
376
- <div class="p-1 m_p-05">
376
+ <Card class="p-05">
377
377
  <div class="p-025 bg-bg radius-1 mb-05 m_max-h-300px m_overflow m_border">
378
378
  <!-- Empty state -->
379
379
  <div v-if="conditions.length === 0" class="opacity-3 flex gap-05 p-025 min-w-450px m_min-0">
@@ -507,7 +507,7 @@ function onConnectorChange(id: string, connector: LogicalOperator) {
507
507
  />
508
508
  </div>
509
509
  </div>
510
- </div>
510
+ </Card>
511
511
  </Dropdown>
512
512
  </template>
513
513
 
@@ -48,7 +48,7 @@ const props = withDefaults(
48
48
  inline?: boolean
49
49
  } & BagelInputShellProps>(),
50
50
  {
51
- align: 'center'
51
+ align: 'center',
52
52
  }
53
53
  )
54
54
 
@@ -187,7 +187,7 @@ function handleChange() {
187
187
  'hideRadio': hideRadio,
188
188
  }" @focus="handleFocus" @blur="handleBlur" @change="handleChange">
189
189
  <div class="flex w-100 gap-1 flex-wrap m_gap-05 m_gap-row-025"
190
- :class="{ 'txt-center justify-content-center mx-auto': textAlign === 'center', 'txt-end justify-content-end': textAlign === 'right', 'txt-start justify-content-start': textAlign === 'left' }"
190
+ :class="{ 'txt-center justify-content-center mx-auto': textAlign === 'center', 'radio-option-content--centered-image': textAlign === 'center' && opt.imgSrc, 'txt-end justify-content-end': textAlign === 'right', 'txt-start justify-content-start': textAlign === 'left' }"
191
191
  :style="{ color: textColor }">
192
192
  <img v-if="opt.imgSrc" class="py-025 radius-05 m_w40 object-fit" height="40" width="40" :src="opt.imgSrc" :alt="opt.imgAlt || opt.label || ''">
193
193
  <Icon v-else-if="opt.icon" :icon="opt.icon" :size="1" />
@@ -250,6 +250,17 @@ margin-bottom: 0 !important;
250
250
  width: auto;
251
251
  }
252
252
 
253
+ .radio-option-content--centered-image {
254
+ flex-direction: column;
255
+ flex-wrap: nowrap;
256
+ align-items: center;
257
+ width: 100%;
258
+ }
259
+
260
+ .radio-group-wrap--inline > label > .radio-option-content--centered-image {
261
+ width: 100%;
262
+ }
263
+
253
264
  .is-option-disabled {
254
265
  opacity: 0.5;
255
266
  cursor: not-allowed;
@@ -241,7 +241,6 @@ outline: 1px solid var(--bgl-border-color);
241
241
  }
242
242
  .app-sidebar{
243
243
  --bgl-scrollbar-size: .5rem;
244
- --bgl-btn-height: 44px
245
244
  }
246
245
 
247
246
  .sidebar-logo-dark {
@@ -352,6 +351,7 @@ transition:
352
351
  .sidebar-footer {
353
352
  width: 100%;
354
353
  margin-inline: auto;
354
+ padding-block: 0.25rem;
355
355
  }
356
356
 
357
357
  .app-sidebar ::-webkit-scrollbar-track {
@@ -781,6 +781,8 @@ interface JSONSchemaProperty {
781
781
  allowDelete?: boolean
782
782
  component?: string
783
783
  componentProps?: Record<string, any>
784
+ radioAlign?: 'start' | 'center' | 'end'
785
+ radioTextAlign?: 'left' | 'center' | 'right'
784
786
  }
785
787
  // Flat `x-*` extensions produced by the FormBuilder designer
786
788
  // (schema-fields.ts `fieldsToSchema`). fromJSONSchema honors these too so a
@@ -790,6 +792,8 @@ interface JSONSchemaProperty {
790
792
  'x-placeholder'?: string
791
793
  'x-select-multiselect'?: boolean
792
794
  'x-radio-inline'?: boolean
795
+ 'x-radio-align'?: 'start' | 'center' | 'end'
796
+ 'x-radio-text-align'?: 'left' | 'center' | 'right'
793
797
  }
794
798
 
795
799
  interface JSONSchemaObject {
@@ -959,6 +963,8 @@ function createFieldFromProperty(
959
963
  // designer renders with the same options in the player. Only the props each
960
964
  // input actually reads are forwarded.
961
965
  applyDesignerConfig(config, resolvedProp)
966
+ if (xUi.radioAlign !== undefined) config.align = xUi.radioAlign
967
+ if (xUi.radioTextAlign !== undefined) config.textAlign = xUi.radioTextAlign
962
968
  if (xUi.disabled) config.disabled = xUi.disabled
963
969
  if (xUi.readonly) config.readonly = xUi.readonly
964
970
  if (xUi.autoheight) config.autoheight = xUi.autoheight
@@ -1080,6 +1086,7 @@ function applyDesignerConfig(config: Record<string, any>, prop: JSONSchemaProper
1080
1086
  if (p['x-radio-thin']) config.thin = true
1081
1087
  if (p['x-radio-hide-radio']) config.hideRadio = true
1082
1088
  set('align', 'x-radio-align')
1089
+ set('textAlign', 'x-radio-text-align')
1083
1090
  // Select
1084
1091
  if (p['x-select-multiselect']) config.multiple = true
1085
1092
  // Textarea
@@ -1167,9 +1174,11 @@ export {
1167
1174
  DEFAULT_COL_SPAN,
1168
1175
  DEFAULT_ROW_SPAN,
1169
1176
  colSpanToClass,
1177
+ colStartToClass,
1170
1178
  mColSpanToClass,
1171
1179
  rowSpanToClass,
1172
1180
  classToColSpan,
1181
+ classToColStart,
1173
1182
  classToMColSpan,
1174
1183
  classToRowSpan,
1175
1184
  classToGridSpans,
@@ -6,6 +6,7 @@
6
6
  * classes defined in styles/inputs.css + styles/layout.css:
7
7
  *
8
8
  * Desktop column span: col-{1..12}/12 (e.g. col-6/12 = span 6)
9
+ * Desktop column start: start-col-{1..12}
9
10
  * Mobile column span: m_col-{1..12}/12
10
11
  * Row span: span-row-{1..12} (e.g. span-row-2 = span 2 rows)
11
12
  *
@@ -20,6 +21,7 @@ export const DEFAULT_COL_SPAN = 12
20
21
  export const DEFAULT_ROW_SPAN = 1
21
22
 
22
23
  const COL_RE = /^col-(\d{1,2})\/12$/
24
+ const COL_START_RE = /^start-col-(\d{1,2})$/
23
25
  const M_COL_RE = /^m_col-(\d{1,2})\/12$/
24
26
  const ROW_RE = /^(?:grid-)?span-row-(\d{1,2})$/
25
27
 
@@ -53,6 +55,11 @@ export function colSpanToClass(span: number): string {
53
55
  return `col-${clampSpan(span)}/12`
54
56
  }
55
57
 
58
+ /** Desktop starting column -> canonical class (e.g. 3 -> "start-col-3"). */
59
+ export function colStartToClass(start: number): string {
60
+ return `start-col-${clampSpan(start)}`
61
+ }
62
+
56
63
  /** Mobile column span -> canonical class (e.g. 6 -> "m_col-6/12"). */
57
64
  export function mColSpanToClass(span: number): string {
58
65
  return `m_col-${clampSpan(span)}/12`
@@ -77,6 +84,16 @@ export function classToColSpan(cls: string | undefined): number | undefined {
77
84
  return undefined
78
85
  }
79
86
 
87
+ /** Parse the first desktop starting column found in a class string, if any. */
88
+ export function classToColStart(cls: string | undefined): number | undefined {
89
+ if (!cls) return undefined
90
+ for (const token of cls.split(/\s+/)) {
91
+ const m = token.match(COL_START_RE)
92
+ if (m) return clampSpan(Number(m[1]))
93
+ }
94
+ return undefined
95
+ }
96
+
80
97
  /** Parse the first mobile column span found in a class string, if any. */
81
98
  export function classToMColSpan(cls: string | undefined): number | undefined {
82
99
  if (!cls) return undefined
@@ -108,6 +125,7 @@ export function stripGridClasses(cls: string | undefined): string {
108
125
  .filter(Boolean)
109
126
  .filter(t =>
110
127
  !COL_RE.test(t)
128
+ && !COL_START_RE.test(t)
111
129
  && !M_COL_RE.test(t)
112
130
  && !ROW_RE.test(t)
113
131
  && !(t in FRACTION_TO_SPAN)
@@ -118,6 +136,7 @@ export function stripGridClasses(cls: string | undefined): string {
118
136
 
119
137
  export interface GridSpans {
120
138
  colSpan?: number
139
+ colStart?: number
121
140
  rowSpan?: number
122
141
  mColSpan?: number
123
142
  }
@@ -133,6 +152,9 @@ export function applyGridClasses(cls: string | undefined, spans: GridSpans): str
133
152
  if (spans.colSpan !== undefined && spans.colSpan !== DEFAULT_COL_SPAN) {
134
153
  parts.push(colSpanToClass(spans.colSpan))
135
154
  }
155
+ if (spans.colStart !== undefined) {
156
+ parts.push(colStartToClass(spans.colStart))
157
+ }
136
158
  if (spans.rowSpan !== undefined && spans.rowSpan !== DEFAULT_ROW_SPAN) {
137
159
  parts.push(rowSpanToClass(spans.rowSpan))
138
160
  }
@@ -146,6 +168,7 @@ export function applyGridClasses(cls: string | undefined, spans: GridSpans): str
146
168
  export function classToGridSpans(cls: string | undefined): GridSpans {
147
169
  return {
148
170
  colSpan: classToColSpan(cls),
171
+ colStart: classToColStart(cls),
149
172
  rowSpan: classToRowSpan(cls),
150
173
  mColSpan: classToMColSpan(cls),
151
174
  }
@@ -9,6 +9,7 @@ import { computed, type Ref } from 'vue'
9
9
  import {
10
10
  applyGridClasses,
11
11
  classToColSpan,
12
+ classToColStart,
12
13
  classToMColSpan,
13
14
  classToRowSpan,
14
15
  stripGridClasses,
@@ -50,6 +51,8 @@ export interface FormField {
50
51
  required?: boolean
51
52
  /** Desktop column span (1-12, default 12). Persisted as `col-N/12`. */
52
53
  colSpan?: number
54
+ /** Desktop starting column (1-12). Persisted as `start-col-N`. */
55
+ colStart?: number
53
56
  /** Row span (1-12, default 1). Persisted as `span-row-N`. */
54
57
  rowSpan?: number
55
58
  /** Mobile column span (1-12, default 12). Persisted as `m_col-N/12`. */
@@ -226,6 +229,7 @@ export function schemaToFields(schema: JSONSchemaObject | undefined): FormField[
226
229
  description: prop.description,
227
230
  required: requiredSet.has(key) || undefined,
228
231
  colSpan: classToColSpan(uiClass) ?? 12,
232
+ colStart: classToColStart(uiClass),
229
233
  rowSpan: classToRowSpan(uiClass) ?? defaultRowSpan(type),
230
234
  mColSpan: classToMColSpan(uiClass) ?? 12,
231
235
  class: stripGridClasses(uiClass) || undefined,
@@ -255,7 +259,7 @@ export function schemaToFields(schema: JSONSchemaObject | undefined): FormField[
255
259
  radioAlign: prop['x-ui']?.radioAlign ?? prop['x-radio-align'],
256
260
  radioInline: prop['x-radio-inline'],
257
261
  radioSize: prop['x-radio-size'],
258
- radioTextAlign: prop['x-ui']?.radioTextAlign ?? prop['x-radio-text-align'],
262
+ radioTextAlign: prop['x-ui']?.radioTextAlign ?? prop['x-radio-text-align'] ?? 'center',
259
263
  textIcon: prop['x-text-icon'],
260
264
  textIconStart: prop['x-text-icon-start'],
261
265
  validation: Object.keys(validation).length > 0 ? validation : undefined,
@@ -359,6 +363,7 @@ export function fieldsToSchema(fields: FormField[]): JSONSchemaObject {
359
363
  // with any user-authored classes. Row default is field-type dependent.
360
364
  const layoutClass = applyGridClasses(field.class, {
361
365
  colSpan: field.colSpan,
366
+ colStart: field.colStart,
362
367
  rowSpan: field.rowSpan === defaultRowSpan(field.type) ? undefined : field.rowSpan,
363
368
  mColSpan: field.mColSpan,
364
369
  })
@@ -484,60 +484,85 @@ select {
484
484
  }
485
485
 
486
486
  .col-1\/12 {
487
- grid-column: span 1 !important;
487
+ grid-column-start: auto !important;
488
+ grid-column-end: span 1 !important;
488
489
  }
489
490
 
490
491
  .col-1\/6,
491
492
  .col-2\/12 {
492
- grid-column: span 2 !important;
493
+ grid-column-start: auto !important;
494
+ grid-column-end: span 2 !important;
493
495
  }
494
496
 
495
497
  .col-1\/4,
496
498
  .col-3\/12 {
497
- grid-column: span 3 !important;
499
+ grid-column-start: auto !important;
500
+ grid-column-end: span 3 !important;
498
501
  }
499
502
 
500
503
  .col-1\/3,
501
504
  .col-4\/12 {
502
- grid-column: span 4 !important;
505
+ grid-column-start: auto !important;
506
+ grid-column-end: span 4 !important;
503
507
  }
504
508
 
505
509
  .col-5\/12 {
506
- grid-column: span 5 !important;
510
+ grid-column-start: auto !important;
511
+ grid-column-end: span 5 !important;
507
512
  }
508
513
 
509
514
  .col-1\/2,
510
515
  .col-6\/12 {
511
- grid-column: span 6 !important;
516
+ grid-column-start: auto !important;
517
+ grid-column-end: span 6 !important;
512
518
  }
513
519
 
514
520
  .col-7\/12 {
515
- grid-column: span 7 !important;
521
+ grid-column-start: auto !important;
522
+ grid-column-end: span 7 !important;
516
523
  }
517
524
 
518
525
  .col-2\/3,
519
526
  .col-8\/12 {
520
- grid-column: span 8 !important;
527
+ grid-column-start: auto !important;
528
+ grid-column-end: span 8 !important;
521
529
  }
522
530
 
523
531
  .col-3\/4,
524
532
  .col-9\/12 {
525
- grid-column: span 9 !important;
533
+ grid-column-start: auto !important;
534
+ grid-column-end: span 9 !important;
526
535
  }
527
536
 
528
537
  .col-5\/6,
529
538
  .col-10\/12 {
530
- grid-column: span 10 !important;
539
+ grid-column-start: auto !important;
540
+ grid-column-end: span 10 !important;
531
541
  }
532
542
 
533
543
  .col-11\/12 {
534
- grid-column: span 11 !important;
544
+ grid-column-start: auto !important;
545
+ grid-column-end: span 11 !important;
535
546
  }
536
547
 
537
548
  .col-full,
538
549
  .col-12\/12 {
539
- grid-column: span 12 !important;
540
- }
550
+ grid-column-start: auto !important;
551
+ grid-column-end: span 12 !important;
552
+ }
553
+
554
+ .start-col-1 { grid-column-start: 1 !important; }
555
+ .start-col-2 { grid-column-start: 2 !important; }
556
+ .start-col-3 { grid-column-start: 3 !important; }
557
+ .start-col-4 { grid-column-start: 4 !important; }
558
+ .start-col-5 { grid-column-start: 5 !important; }
559
+ .start-col-6 { grid-column-start: 6 !important; }
560
+ .start-col-7 { grid-column-start: 7 !important; }
561
+ .start-col-8 { grid-column-start: 8 !important; }
562
+ .start-col-9 { grid-column-start: 9 !important; }
563
+ .start-col-10 { grid-column-start: 10 !important; }
564
+ .start-col-11 { grid-column-start: 11 !important; }
565
+ .start-col-12 { grid-column-start: 12 !important; }
541
566
 
542
567
  .pixel {
543
568
  width: 0 !important;
@@ -587,6 +612,21 @@ select {
587
612
  grid-column: 1 / -1 !important;
588
613
  }
589
614
 
615
+ .start-col-1,
616
+ .start-col-2,
617
+ .start-col-3,
618
+ .start-col-4,
619
+ .start-col-5,
620
+ .start-col-6,
621
+ .start-col-7,
622
+ .start-col-8,
623
+ .start-col-9,
624
+ .start-col-10,
625
+ .start-col-11,
626
+ .start-col-12 {
627
+ grid-column-start: 1 !important;
628
+ }
629
+
590
630
  .m_col-1\/12 {
591
631
  grid-column: span 1 !important;
592
632
  }