@bagelink/vue 1.9.83 → 1.9.88
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/Avatar.vue.d.ts +1 -0
- package/dist/components/Avatar.vue.d.ts.map +1 -1
- package/dist/components/Badge.vue.d.ts +0 -1
- package/dist/components/Badge.vue.d.ts.map +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/Loading.vue.d.ts +2 -1
- package/dist/components/Loading.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/form-flow/FormFlow.vue.d.ts.map +1 -1
- package/dist/form-flow/form-flow.d.ts +9 -9
- package/dist/form-flow/form-flow.d.ts.map +1 -1
- package/dist/index.cjs +163 -85
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +25737 -25545
- package/dist/plugins/useToast.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/filterRef.d.ts +15 -0
- package/dist/utils/filterRef.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Avatar.vue +6 -2
- package/src/components/Badge.vue +14 -1084
- package/src/components/Btn.vue +37 -37
- package/src/components/Dropdown.vue +1 -1
- package/src/components/Loading.vue +15 -6
- package/src/components/form/inputs/RichText/index.vue +325 -221
- package/src/form-flow/FormFlow.vue +9 -0
- package/src/form-flow/form-flow.ts +13 -3
- package/src/index.ts +1 -1
- package/src/plugins/useToast.ts +14 -0
- package/src/styles/bagel.css +1 -0
- package/src/styles/base-colors.css +1429 -46
- package/src/styles/text.css +1755 -1755
- package/src/styles/toast-overrides.css +10 -0
- package/src/utils/filterRef.ts +133 -0
- package/src/styles/btnColors.css +0 -847
|
@@ -450,6 +450,15 @@ defineExpose({
|
|
|
450
450
|
</ArrayInput>
|
|
451
451
|
</template>
|
|
452
452
|
|
|
453
|
+
<!-- Array field with primitive item type (e.g. from JSON Schema type: array with items: { type: string }) -->
|
|
454
|
+
<template v-else-if="field._type === 'array' && field._config.itemType">
|
|
455
|
+
<ArrayInput v-bind="getFieldProps(field, key)">
|
|
456
|
+
<template #default="{ item }">
|
|
457
|
+
<component :is="getFieldComponent(field._config.itemType)" :model-value="item.value" @update:model-value="(val: any) => { item.value = val }" />
|
|
458
|
+
</template>
|
|
459
|
+
</ArrayInput>
|
|
460
|
+
</template>
|
|
461
|
+
|
|
453
462
|
<!-- Custom component rendering -->
|
|
454
463
|
<template v-else-if="usesCustomComponent(field)">
|
|
455
464
|
<component
|
|
@@ -71,6 +71,14 @@ interface BaseFieldConfig {
|
|
|
71
71
|
class?: string
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
interface TextFieldConfig {
|
|
75
|
+
multiline?: boolean
|
|
76
|
+
pattern?: string
|
|
77
|
+
icon?: IconType
|
|
78
|
+
rows?: number
|
|
79
|
+
autofocus?: boolean
|
|
80
|
+
}
|
|
81
|
+
|
|
74
82
|
/**
|
|
75
83
|
* Syntactic sugar for required: true
|
|
76
84
|
* @example $.email({ required }) instead of $.email({ required: true })
|
|
@@ -214,8 +222,8 @@ function parseArgs<C extends BaseFieldConfig>(
|
|
|
214
222
|
|
|
215
223
|
export const $ = {
|
|
216
224
|
text(
|
|
217
|
-
labelOrConfig?: string | (BaseFieldConfig &
|
|
218
|
-
config?: BaseFieldConfig &
|
|
225
|
+
labelOrConfig?: string | (BaseFieldConfig & TextFieldConfig),
|
|
226
|
+
config?: BaseFieldConfig & TextFieldConfig
|
|
219
227
|
): FieldBuilder<string> {
|
|
220
228
|
return new Field('text', parseArgs(labelOrConfig, config))
|
|
221
229
|
},
|
|
@@ -680,6 +688,7 @@ interface JSONSchemaProperty {
|
|
|
680
688
|
'minLength'?: number
|
|
681
689
|
'maxLength'?: number
|
|
682
690
|
'$ref'?: string
|
|
691
|
+
'items'?: JSONSchemaProperty
|
|
683
692
|
'anyOf'?: JSONSchemaProperty[]
|
|
684
693
|
'oneOf'?: JSONSchemaProperty[]
|
|
685
694
|
'allOf'?: JSONSchemaProperty[]
|
|
@@ -917,13 +926,14 @@ function createFieldFromProperty(
|
|
|
917
926
|
case 'multiselect':
|
|
918
927
|
field = $.multiselect(resolvedProp.enum || [], config)
|
|
919
928
|
break
|
|
920
|
-
case 'array':
|
|
929
|
+
case 'array': {
|
|
921
930
|
field = $.array(resolvedProp.title || key, undefined, {
|
|
922
931
|
...config,
|
|
923
932
|
allowAdd: xUi.allowAdd,
|
|
924
933
|
allowDelete: xUi.allowDelete,
|
|
925
934
|
})
|
|
926
935
|
break
|
|
936
|
+
}
|
|
927
937
|
case 'display':
|
|
928
938
|
// Display fields with custom components can't be fully restored
|
|
929
939
|
// without the actual component reference
|
package/src/index.ts
CHANGED
package/src/plugins/useToast.ts
CHANGED
|
@@ -38,8 +38,21 @@ export function useToast(): ToastApi {
|
|
|
38
38
|
|
|
39
39
|
export type BagelToastOptions = Partial<ToastOptions>
|
|
40
40
|
|
|
41
|
+
function createToastContainer(): HTMLElement | undefined {
|
|
42
|
+
if (typeof document === 'undefined') return undefined
|
|
43
|
+
const el = document.createElement('div')
|
|
44
|
+
el.setAttribute('popover', 'manual')
|
|
45
|
+
el.setAttribute('id', 'bgl-toast-container')
|
|
46
|
+
document.body.appendChild(el)
|
|
47
|
+
// Promote to top layer so toasts appear above showModal() dialogs
|
|
48
|
+
;(el as any).showPopover?.()
|
|
49
|
+
return el
|
|
50
|
+
}
|
|
51
|
+
|
|
41
52
|
export const ToastPlugin: Plugin<BagelToastOptions[]> = {
|
|
42
53
|
install: (app: App, options: BagelToastOptions = {}) => {
|
|
54
|
+
const container = createToastContainer()
|
|
55
|
+
|
|
43
56
|
const defaultOptions: ToastOptions = {
|
|
44
57
|
position: POSITION.TOP_RIGHT,
|
|
45
58
|
timeout: 5000,
|
|
@@ -58,6 +71,7 @@ export const ToastPlugin: Plugin<BagelToastOptions[]> = {
|
|
|
58
71
|
newestOnTop: true,
|
|
59
72
|
toastClassName: 'custom-toast-wrapper',
|
|
60
73
|
bodyClassName: 'custom-toast-body',
|
|
74
|
+
...(container ? { container } : {}),
|
|
61
75
|
...options,
|
|
62
76
|
}
|
|
63
77
|
|
package/src/styles/bagel.css
CHANGED