@bagelink/vue 1.15.188 → 1.15.192
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/form/inputs/RadioGroup.vue.d.ts.map +1 -1
- package/dist/components/layout/AppContent.vue.d.ts.map +1 -1
- package/dist/components/layout/AppLayout.vue.d.ts +37 -13
- package/dist/components/layout/AppLayout.vue.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.vue.d.ts.map +1 -1
- package/dist/components/layout/SidebarNavItem.vue.d.ts.map +1 -1
- package/dist/components/layout/appLayoutContext.d.ts +22 -2
- package/dist/components/layout/appLayoutContext.d.ts.map +1 -1
- package/dist/form-flow/schema-fields.d.ts +11 -0
- package/dist/form-flow/schema-fields.d.ts.map +1 -1
- package/dist/index.cjs +31 -31
- package/dist/index.mjs +7507 -7437
- package/dist/style.css +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/inputs/RadioGroup.vue +39 -5
- package/src/components/layout/AppContent.vue +3 -1
- package/src/components/layout/AppLayout.vue +198 -45
- package/src/components/layout/AppSidebar.vue +114 -152
- package/src/components/layout/SidebarNavItem.vue +54 -73
- package/src/components/layout/appLayoutContext.ts +22 -2
- package/src/form-flow/schema-fields.ts +17 -2
- package/src/utils/index.ts +11 -4
|
@@ -12,14 +12,34 @@ export interface RegionState {
|
|
|
12
12
|
/** Expanded (reserves full `size`) vs collapsed/hidden (reserves `collapsedSize`). */
|
|
13
13
|
open: boolean
|
|
14
14
|
/**
|
|
15
|
-
* push →
|
|
16
|
-
*
|
|
15
|
+
* push → AppLayout renders a real IN-FLOW, reserved-width box in the row and
|
|
16
|
+
* the child fills it (`width/height: 100%`). Single source of truth for
|
|
17
|
+
* the size; AppLayout owns the box + resize. No `fixed`/margin trick.
|
|
18
|
+
* overlay → the child floats `position: fixed` above the center and reserves
|
|
19
|
+
* nothing (mobile sidebar drawer, floating/full chat).
|
|
17
20
|
*/
|
|
18
21
|
mode: 'push' | 'overlay'
|
|
19
22
|
/** Inline-size for start/end, block-size for top/bottom. Any CSS length. */
|
|
20
23
|
size: string
|
|
21
24
|
/** Size when `open === false`. `'0'` fully collapses the region away. */
|
|
22
25
|
collapsedSize: string
|
|
26
|
+
/**
|
|
27
|
+
* What kind of thing occupies this region. Lets consumers tell an actual
|
|
28
|
+
* navigation sidebar apart from another panel that merely docks into the same
|
|
29
|
+
* rail (e.g. a chat dock in `start`). AppContent's menu-toggle only appears for
|
|
30
|
+
* a real `'sidebar'`. Default undefined (treated as a sidebar for back-compat).
|
|
31
|
+
*/
|
|
32
|
+
role?: 'sidebar' | 'dock'
|
|
33
|
+
/**
|
|
34
|
+
* Opt in to drag-resize (start/end only). AppLayout renders a thin handle on
|
|
35
|
+
* the region's inner edge and mutates `size` live during the drag, clamped to
|
|
36
|
+
* `[minSize, maxSize]`. `size` MUST be a px value (e.g. '440px') while resizable.
|
|
37
|
+
*/
|
|
38
|
+
resizable?: boolean
|
|
39
|
+
/** Min resize bound (px string, e.g. '320px'). Defaults to '0'. */
|
|
40
|
+
minSize?: string
|
|
41
|
+
/** Max resize bound (px string, e.g. '900px'). Defaults to '100vw' worth of px. */
|
|
42
|
+
maxSize?: string
|
|
23
43
|
}
|
|
24
44
|
|
|
25
45
|
export type RegionPatch = Partial<RegionState>
|
|
@@ -27,6 +27,7 @@ export type FormFieldType =
|
|
|
27
27
|
export interface SelectOption {
|
|
28
28
|
label: string
|
|
29
29
|
value: string
|
|
30
|
+
imgSrc?: string
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export interface FormFieldValidation {
|
|
@@ -83,6 +84,10 @@ export interface FormField {
|
|
|
83
84
|
radioAlign?: 'start' | 'center' | 'end'
|
|
84
85
|
/** Lay radio options out horizontally (inline) instead of stacked. */
|
|
85
86
|
radioInline?: boolean
|
|
87
|
+
/** Size of radio options. */
|
|
88
|
+
radioSize?: 's' | 'm' | 'l'
|
|
89
|
+
/** Align the content inside inline radio options. */
|
|
90
|
+
radioTextAlign?: 'left' | 'center' | 'right'
|
|
86
91
|
textIcon?: string
|
|
87
92
|
textIconStart?: string
|
|
88
93
|
validation?: FormFieldValidation
|
|
@@ -110,6 +115,10 @@ export interface JSONSchemaProperty {
|
|
|
110
115
|
condition?: string
|
|
111
116
|
/** Field kept in form data / submitted but never displayed. */
|
|
112
117
|
hidden?: boolean
|
|
118
|
+
/** Vertical alignment of radio option content. */
|
|
119
|
+
radioAlign?: 'start' | 'center' | 'end'
|
|
120
|
+
/** Horizontal alignment of radio option text. */
|
|
121
|
+
radioTextAlign?: 'left' | 'center' | 'right'
|
|
113
122
|
[key: string]: any
|
|
114
123
|
}
|
|
115
124
|
'x-field-type'?: FormFieldType
|
|
@@ -136,6 +145,8 @@ export interface JSONSchemaProperty {
|
|
|
136
145
|
'x-radio-hide-radio'?: boolean
|
|
137
146
|
'x-radio-align'?: 'start' | 'center' | 'end'
|
|
138
147
|
'x-radio-inline'?: boolean
|
|
148
|
+
'x-radio-size'?: 's' | 'm' | 'l'
|
|
149
|
+
'x-radio-text-align'?: 'left' | 'center' | 'right'
|
|
139
150
|
'x-text-icon'?: string
|
|
140
151
|
'x-text-icon-start'?: string
|
|
141
152
|
'x-hide-label'?: boolean
|
|
@@ -241,8 +252,10 @@ export function schemaToFields(schema: JSONSchemaObject | undefined): FormField[
|
|
|
241
252
|
rangeMulti: prop['x-range-multi'],
|
|
242
253
|
radioThin: prop['x-radio-thin'],
|
|
243
254
|
radioHideRadio: prop['x-radio-hide-radio'],
|
|
244
|
-
radioAlign: prop['x-radio-align'],
|
|
255
|
+
radioAlign: prop['x-ui']?.radioAlign ?? prop['x-radio-align'],
|
|
245
256
|
radioInline: prop['x-radio-inline'],
|
|
257
|
+
radioSize: prop['x-radio-size'],
|
|
258
|
+
radioTextAlign: prop['x-ui']?.radioTextAlign ?? prop['x-radio-text-align'],
|
|
246
259
|
textIcon: prop['x-text-icon'],
|
|
247
260
|
textIconStart: prop['x-text-icon-start'],
|
|
248
261
|
validation: Object.keys(validation).length > 0 ? validation : undefined,
|
|
@@ -377,8 +390,10 @@ export function fieldsToSchema(fields: FormField[]): JSONSchemaObject {
|
|
|
377
390
|
if (field.rangeMulti === true) prop['x-range-multi'] = true
|
|
378
391
|
if (field.radioThin === true) prop['x-radio-thin'] = true
|
|
379
392
|
if (field.radioHideRadio === true) prop['x-radio-hide-radio'] = true
|
|
380
|
-
if (field.radioAlign) prop['x-
|
|
393
|
+
if (field.radioAlign) prop['x-ui'] = { ...prop['x-ui'], radioAlign: field.radioAlign }
|
|
381
394
|
if (field.radioInline === true) prop['x-radio-inline'] = true
|
|
395
|
+
if (field.radioSize) prop['x-radio-size'] = field.radioSize
|
|
396
|
+
if (field.radioTextAlign) prop['x-ui'] = { ...prop['x-ui'], radioTextAlign: field.radioTextAlign }
|
|
382
397
|
if (field.textIcon) prop['x-text-icon'] = field.textIcon
|
|
383
398
|
if (field.textIconStart) prop['x-text-icon-start'] = field.textIconStart
|
|
384
399
|
|
package/src/utils/index.ts
CHANGED
|
@@ -259,6 +259,15 @@ export type { ShowdownConverter, ShowdownOptions } from './showdown'
|
|
|
259
259
|
|
|
260
260
|
const URL_REGEX = /^https?:\/\/|^\/\/|^blob:|^data:/
|
|
261
261
|
|
|
262
|
+
// Base URL for uploaded files. Defaults to the public file server, but can be
|
|
263
|
+
// overridden per-app (e.g. to '/files' to route through a dev/prod proxy).
|
|
264
|
+
let fileBaseUrl = 'https://files.bagel.design'
|
|
265
|
+
|
|
266
|
+
/** Override the base URL used to resolve uploaded file path keys. */
|
|
267
|
+
export function setFileBaseUrl(baseUrl: string): void {
|
|
268
|
+
fileBaseUrl = baseUrl.replace(/\/$/, '')
|
|
269
|
+
}
|
|
270
|
+
|
|
262
271
|
export function pathKeyToURL(pathKey?: string | null): string | undefined {
|
|
263
272
|
if (pathKey == null || pathKey === '') {
|
|
264
273
|
return undefined
|
|
@@ -284,10 +293,8 @@ export function pathKeyToURL(pathKey?: string | null): string | undefined {
|
|
|
284
293
|
return `/${pathKey}`
|
|
285
294
|
}
|
|
286
295
|
|
|
287
|
-
// For uploaded files, use the
|
|
288
|
-
|
|
289
|
-
const baseUrl = 'https://files.bagel.design'
|
|
290
|
-
return `${baseUrl}/${pathKey}`
|
|
296
|
+
// For uploaded files, use the configured file server (see setFileBaseUrl)
|
|
297
|
+
return `${fileBaseUrl}/${pathKey}`
|
|
291
298
|
}
|
|
292
299
|
|
|
293
300
|
export function getNestedValue(obj: any, path?: string, defaultValue: any = undefined): any {
|