@bagelink/vue 1.4.109 → 1.4.115
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/bin/generateFormSchema.ts +12 -12
- package/dist/components/Card.vue.d.ts.map +1 -1
- package/dist/components/ImportData.vue.d.ts.map +1 -1
- package/dist/components/ListItem.vue.d.ts +6 -1
- package/dist/components/ListItem.vue.d.ts.map +1 -1
- package/dist/components/analytics/BarChart.vue.d.ts +39 -0
- package/dist/components/analytics/BarChart.vue.d.ts.map +1 -0
- package/dist/components/analytics/KpiCard.vue.d.ts +24 -0
- package/dist/components/analytics/KpiCard.vue.d.ts.map +1 -0
- package/dist/components/analytics/LineChart.vue.d.ts +26 -0
- package/dist/components/analytics/LineChart.vue.d.ts.map +1 -0
- package/dist/components/analytics/PieChart.vue.d.ts +24 -0
- package/dist/components/analytics/PieChart.vue.d.ts.map +1 -0
- package/dist/components/analytics/index.d.ts +5 -0
- package/dist/components/analytics/index.d.ts.map +1 -0
- package/dist/components/calendar/Index.vue.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/views/MonthView.vue.d.ts.map +1 -1
- package/dist/components/calendar/views/WeekView.vue.d.ts.map +1 -1
- package/dist/components/dataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +2 -0
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RadioGroup.vue.d.ts +6 -10
- package/dist/components/form/inputs/RadioGroup.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/utils/media.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts +2 -2
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/layout/AppContent.vue.d.ts +34 -0
- package/dist/components/layout/AppContent.vue.d.ts.map +1 -0
- package/dist/components/layout/AppLayout.vue.d.ts +27 -0
- package/dist/components/layout/AppLayout.vue.d.ts.map +1 -0
- package/dist/components/layout/AppSidebar.vue.d.ts +44 -0
- package/dist/components/layout/AppSidebar.vue.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/composables/useFormField.d.ts.map +1 -1
- package/dist/composables/useSchemaField.d.ts +2 -2
- package/dist/composables/useSchemaField.d.ts.map +1 -1
- package/dist/index.cjs +19 -19
- package/dist/index.mjs +10 -10
- package/dist/style.css +1 -1
- package/dist/types/BagelForm.d.ts +25 -13
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts +11 -8
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/dist/utils/calendar/dateUtils.d.ts +21 -0
- package/dist/utils/calendar/dateUtils.d.ts.map +1 -1
- package/dist/utils/elementUtils.d.ts +5 -0
- package/dist/utils/elementUtils.d.ts.map +1 -1
- package/dist/utils/useSearch.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Card.vue +1 -2
- package/src/components/DataPreview.vue +1 -1
- package/src/components/ImportData.vue +94 -88
- package/src/components/ListItem.vue +32 -24
- package/src/components/analytics/BarChart.vue +153 -0
- package/src/components/analytics/KpiCard.vue +84 -0
- package/src/components/analytics/LineChart.vue +267 -0
- package/src/components/analytics/PieChart.vue +183 -0
- package/src/components/analytics/index.ts +4 -0
- package/src/components/calendar/Index.vue +15 -35
- package/src/components/calendar/views/MonthView.vue +84 -88
- package/src/components/calendar/views/WeekView.vue +143 -89
- package/src/components/dataTable/DataTable.vue +2 -3
- package/src/components/form/BagelForm.vue +27 -6
- package/src/components/form/inputs/DateInput.vue +2 -2
- package/src/components/form/inputs/DatePicker.vue +42 -48
- package/src/components/form/inputs/RadioGroup.vue +60 -35
- package/src/components/form/inputs/RichText/utils/media.ts +1 -2
- package/src/components/form/inputs/SelectInput.vue +94 -101
- package/src/components/form/inputs/Upload/upload.css +135 -138
- package/src/components/layout/AppContent.vue +125 -0
- package/src/components/layout/AppLayout.vue +124 -0
- package/src/components/layout/AppSidebar.vue +271 -0
- package/src/components/layout/index.ts +5 -0
- package/src/composables/useFormField.ts +6 -0
- package/src/composables/useSchemaField.ts +38 -10
- package/src/styles/inputs.css +9 -0
- package/src/styles/theme.css +2 -2
- package/src/types/BagelForm.ts +68 -13
- package/src/utils/BagelFormUtils.ts +49 -52
- package/src/utils/calendar/dateUtils.ts +71 -17
- package/src/utils/elementUtils.ts +23 -4
- package/src/utils/useSearch.ts +14 -7
- /package/src/components/{dialog → calendar}/index.ts +0 -0
|
@@ -43,6 +43,7 @@ const isDirty = computed(() => {
|
|
|
43
43
|
// Initialize on mount
|
|
44
44
|
onMounted(() => {
|
|
45
45
|
if (props.modelValue) initialFormData.value = clone(props.modelValue)
|
|
46
|
+
applyDefaultValues()
|
|
46
47
|
})
|
|
47
48
|
|
|
48
49
|
// Watch for model changes
|
|
@@ -50,6 +51,29 @@ watch(() => props.modelValue, (val) => {
|
|
|
50
51
|
if (val !== undefined) formData.value = clone(val)
|
|
51
52
|
}, { immediate: true, deep: true })
|
|
52
53
|
|
|
54
|
+
function applyDefaultValues() {
|
|
55
|
+
const schema = resolvedSchema.value as unknown as Array<BaseBagelField<T, any>> | undefined
|
|
56
|
+
if (!schema) return
|
|
57
|
+
|
|
58
|
+
const walk = (nodes: any[]) => {
|
|
59
|
+
for (const node of nodes) {
|
|
60
|
+
if (!node || typeof node !== 'object') continue
|
|
61
|
+
const hasId = typeof node.id === 'string' && node.id.length > 0
|
|
62
|
+
const hasDefault = Object.prototype.hasOwnProperty.call(node, 'defaultValue') && node.defaultValue !== undefined
|
|
63
|
+
if (hasId && hasDefault) {
|
|
64
|
+
const current = getNestedValue(formData.value as any, node.id as string, undefined)
|
|
65
|
+
if (current === undefined || current === '') {
|
|
66
|
+
updateFormData({ fieldId: node.id, value: node.defaultValue })
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (Array.isArray(node.children) && node.children.length) walk(node.children)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
walk(schema as any[])
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
watch(resolvedSchema, () => { applyDefaultValues() }, { deep: true })
|
|
76
|
+
|
|
53
77
|
// Update form data
|
|
54
78
|
function updateFormData({ fieldId, value }: { fieldId?: string, value: any }) {
|
|
55
79
|
const keys = fieldId?.split('.') || []
|
|
@@ -90,12 +114,9 @@ async function handleSubmit() {
|
|
|
90
114
|
}
|
|
91
115
|
|
|
92
116
|
// Field renderingks
|
|
93
|
-
const { renderField } = useSchemaField<T
|
|
117
|
+
const { renderField } = useSchemaField<T>({
|
|
94
118
|
mode: 'form',
|
|
95
|
-
getFormData: () =>
|
|
96
|
-
...formData.value,
|
|
97
|
-
get: (path: string) => getNestedValue(formData.value, path, '')
|
|
98
|
-
}),
|
|
119
|
+
getFormData: () => formData.value,
|
|
99
120
|
onUpdateModelValue: (field, value) => {
|
|
100
121
|
if (!field.id) return
|
|
101
122
|
|
|
@@ -104,7 +125,7 @@ const { renderField } = useSchemaField<T, P>({
|
|
|
104
125
|
}
|
|
105
126
|
})
|
|
106
127
|
|
|
107
|
-
const renderSchemaField = (field: any) => renderField(field as BaseBagelField<T,
|
|
128
|
+
const renderSchemaField = (field: any) => renderField(field as BaseBagelField<T, Path<T>>)
|
|
108
129
|
|
|
109
130
|
// Add new method to handle slot input changes
|
|
110
131
|
function handleSlotInputChange(event: Event) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ModeType } from '../../../utils/calendar/typings'
|
|
3
|
-
import { TextInput, Dropdown,
|
|
3
|
+
import { TextInput, Dropdown, formatDate } from '@bagelink/vue'
|
|
4
4
|
import { onClickOutside } from '@vueuse/core'
|
|
5
5
|
import { ref, onMounted } from 'vue'
|
|
6
6
|
import { WEEK_START_DAY } from '../../../utils/calendar/time'
|
|
@@ -47,7 +47,7 @@ const isOpen = ref(false)
|
|
|
47
47
|
function useFormatting() {
|
|
48
48
|
const formatDisplayDate = (date: Date | string | undefined): string => {
|
|
49
49
|
if (!date) return ''
|
|
50
|
-
return
|
|
50
|
+
return formatDate(date, { fmt: props.enableTime ? 'DD.MM.YY HH:mm' : 'DD.MM.YY' })
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const parseUserInput = (input: string): Date | null => {
|
|
@@ -15,18 +15,21 @@ const props = withDefaults(
|
|
|
15
15
|
locale?: string
|
|
16
16
|
enableTime?: boolean
|
|
17
17
|
highlightedDates?: MaybeRefOrGetter<(string | Date)[]>
|
|
18
|
+
disabledDates?: MaybeRefOrGetter<(string | Date)[]>
|
|
19
|
+
autoSize?: boolean
|
|
18
20
|
}>(),
|
|
19
21
|
{
|
|
20
22
|
mode: () => ({ mode: 'day' }),
|
|
21
23
|
firstDayOfWeek: WEEK_START_DAY.SUNDAY,
|
|
22
24
|
locale: '',
|
|
23
|
-
enableTime: false
|
|
25
|
+
enableTime: false,
|
|
24
26
|
},
|
|
25
27
|
)
|
|
26
28
|
|
|
27
29
|
const emit = defineEmits(['update:modelValue'])
|
|
28
30
|
|
|
29
31
|
const computedHighlightedDates = $computed(() => toValue(props.highlightedDates))
|
|
32
|
+
const computedDisabledDates = $computed(() => toValue(props.disabledDates))
|
|
30
33
|
|
|
31
34
|
// State
|
|
32
35
|
const currentMonth = ref(new Date())
|
|
@@ -49,8 +52,24 @@ function useDateValidation() {
|
|
|
49
52
|
const minDate = parseDate(props.min)
|
|
50
53
|
const maxDate = parseDate(props.max)
|
|
51
54
|
|
|
55
|
+
// Check if date is in min/max range
|
|
52
56
|
if (minDate && date < minDate) return true
|
|
53
57
|
if (maxDate && date > maxDate) return true
|
|
58
|
+
|
|
59
|
+
// Check if date is in the disabled dates array
|
|
60
|
+
if (Array.isArray(computedDisabledDates) && computedDisabledDates.length > 0) {
|
|
61
|
+
const isInDisabledDates = computedDisabledDates.some((disabledDate) => {
|
|
62
|
+
const parsedDisabledDate = parseDate(disabledDate)
|
|
63
|
+
if (!parsedDisabledDate) return false
|
|
64
|
+
|
|
65
|
+
// Compare year, month, and day
|
|
66
|
+
return date.getFullYear() === parsedDisabledDate.getFullYear()
|
|
67
|
+
&& date.getMonth() === parsedDisabledDate.getMonth()
|
|
68
|
+
&& date.getDate() === parsedDisabledDate.getDate()
|
|
69
|
+
})
|
|
70
|
+
if (isInDisabledDates) return true
|
|
71
|
+
}
|
|
72
|
+
|
|
54
73
|
return false
|
|
55
74
|
}
|
|
56
75
|
|
|
@@ -309,7 +328,7 @@ function selectDate(date: Date | null) {
|
|
|
309
328
|
</script>
|
|
310
329
|
|
|
311
330
|
<template>
|
|
312
|
-
<div class="ltr
|
|
331
|
+
<div class="ltr gap-075 m_flex-wrap calendar-container justify-content-center h-100p" :class="{ flex: !autoSize }">
|
|
313
332
|
<div class="calendar-section m_border-none px-05 m_p-0">
|
|
314
333
|
<div class="flex space-between pb-1">
|
|
315
334
|
<template v-if="currentView === 'days'">
|
|
@@ -332,18 +351,12 @@ function selectDate(date: Date | null) {
|
|
|
332
351
|
</div>
|
|
333
352
|
|
|
334
353
|
<div v-if="currentView === 'days'" class="calendar-grid grid gap-025">
|
|
335
|
-
<div
|
|
336
|
-
v-for="day in weekDays"
|
|
337
|
-
:key="day"
|
|
338
|
-
class="txt-center txt-12 opacity-6"
|
|
339
|
-
>
|
|
354
|
+
<div v-for="day in weekDays" :key="day" class="txt-center txt-12 opacity-6">
|
|
340
355
|
{{ day }}
|
|
341
356
|
</div>
|
|
342
357
|
|
|
343
358
|
<button
|
|
344
|
-
v-for="date in currentMonthDays"
|
|
345
|
-
:key="date?.toISOString()"
|
|
346
|
-
type="button"
|
|
359
|
+
v-for="date in currentMonthDays" :key="date?.toISOString()" type="button"
|
|
347
360
|
class="day aspect-ratio-1 flex align-items-center justify-content-center pointer round txt14 p-0"
|
|
348
361
|
:class="{
|
|
349
362
|
'selected': isSelected(date),
|
|
@@ -351,9 +364,7 @@ function selectDate(date: Date | null) {
|
|
|
351
364
|
'disabled': isDateDisabled(date),
|
|
352
365
|
'not-in-month': isNotInMonth(date),
|
|
353
366
|
'highlighted': isHighlighted(date),
|
|
354
|
-
}"
|
|
355
|
-
:disabled="isDateDisabled(date)"
|
|
356
|
-
@click="selectDate(date)"
|
|
367
|
+
}" :disabled="isDateDisabled(date)" @click="selectDate(date)"
|
|
357
368
|
>
|
|
358
369
|
{{ date?.getDate() }}
|
|
359
370
|
</button>
|
|
@@ -361,52 +372,34 @@ function selectDate(date: Date | null) {
|
|
|
361
372
|
|
|
362
373
|
<div v-else-if="currentView === 'months'" class="month-grid grid gap-05 p-05">
|
|
363
374
|
<Btn
|
|
364
|
-
v-for="month in months"
|
|
365
|
-
:
|
|
366
|
-
thin
|
|
367
|
-
:flat="month.value !== currentMonthValue.month"
|
|
368
|
-
:disabled="month.disabled"
|
|
369
|
-
:value="month.name"
|
|
370
|
-
@click="selectMonth(month.value)"
|
|
375
|
+
v-for="month in months" :key="month.value" thin :flat="month.value !== currentMonthValue.month"
|
|
376
|
+
:disabled="month.disabled" :value="month.name" @click="selectMonth(month.value)"
|
|
371
377
|
/>
|
|
372
378
|
</div>
|
|
373
379
|
|
|
374
380
|
<div v-else class="year-grid grid gap-05 p-0">
|
|
375
381
|
<Btn
|
|
376
|
-
v-for="year in years"
|
|
377
|
-
:
|
|
378
|
-
:flat="year.value !== currentMonthValue.year"
|
|
379
|
-
:disabled="year.disabled"
|
|
380
|
-
:value="year.value.toString()"
|
|
381
|
-
@click="selectYear(year.value)"
|
|
382
|
+
v-for="year in years" :key="year.value" thin :flat="year.value !== currentMonthValue.year"
|
|
383
|
+
:disabled="year.disabled" :value="year.value.toString()" @click="selectYear(year.value)"
|
|
382
384
|
/>
|
|
383
385
|
</div>
|
|
384
386
|
</div>
|
|
385
387
|
|
|
386
|
-
<div
|
|
388
|
+
<div
|
|
389
|
+
v-if="enableTime && currentView === 'days'"
|
|
390
|
+
class="time-picker border-start flex column gap-1 w-120px px-025"
|
|
391
|
+
>
|
|
387
392
|
<div class="flex gap-025">
|
|
388
393
|
<NumberInput
|
|
389
|
-
center
|
|
390
|
-
:modelValue="
|
|
391
|
-
:disabled="!selectedDate"
|
|
392
|
-
:min="0"
|
|
393
|
-
:max="23"
|
|
394
|
-
layout="vertical"
|
|
395
|
-
:padZero="2"
|
|
396
|
-
@update:modelValue="handleHourInput"
|
|
394
|
+
center :modelValue="hours" :disabled="!selectedDate" :min="0" :max="23" layout="vertical"
|
|
395
|
+
:padZero="2" @update:modelValue="handleHourInput"
|
|
397
396
|
/>
|
|
398
397
|
<p class="pb-075">
|
|
399
398
|
:
|
|
400
399
|
</p>
|
|
401
400
|
<NumberInput
|
|
402
|
-
center
|
|
403
|
-
:modelValue="
|
|
404
|
-
:disabled="!selectedDate"
|
|
405
|
-
:min="0"
|
|
406
|
-
:max="59"
|
|
407
|
-
:padZero="2"
|
|
408
|
-
layout="vertical"
|
|
409
|
-
@update:modelValue="handleMinuteInput"
|
|
401
|
+
center :modelValue="minutes" :disabled="!selectedDate" :min="0" :max="59" :padZero="2"
|
|
402
|
+
layout="vertical" @update:modelValue="handleMinuteInput"
|
|
410
403
|
/>
|
|
411
404
|
</div>
|
|
412
405
|
</div>
|
|
@@ -477,6 +470,7 @@ function selectDate(date: Date | null) {
|
|
|
477
470
|
color: var(--bgl-text-color);
|
|
478
471
|
outline: 1px solid var(--border-color);
|
|
479
472
|
}
|
|
473
|
+
|
|
480
474
|
.day:hover:not(.disabled).selected {
|
|
481
475
|
filter: var(--bgl-hover-filter);
|
|
482
476
|
background-color: var(--bgl-primary);
|
|
@@ -503,16 +497,16 @@ function selectDate(date: Date | null) {
|
|
|
503
497
|
}
|
|
504
498
|
|
|
505
499
|
.day.highlighted:not(.selected) {
|
|
506
|
-
|
|
507
|
-
|
|
500
|
+
background-color: var(--bgl-secondary-light, rgba(var(--bgl-primary-rgb, 0, 123, 255), 0.15));
|
|
501
|
+
font-weight: 500;
|
|
508
502
|
}
|
|
509
503
|
|
|
510
504
|
.day.highlighted.selected {
|
|
511
|
-
|
|
512
|
-
|
|
505
|
+
/* Add a subtle ring effect for dates that are both selected and highlighted */
|
|
506
|
+
box-shadow: 0 0 0 2px var(--bgl-secondary, rgba(var(--bgl-primary-rgb, 0, 123, 255), 0.5));
|
|
513
507
|
}
|
|
514
508
|
|
|
515
509
|
.day.highlighted:not(.selected):hover {
|
|
516
|
-
|
|
510
|
+
background-color: var(--bgl-secondary-light-hover, rgba(var(--bgl-primary-rgb, 0, 123, 255), 0.25));
|
|
517
511
|
}
|
|
518
512
|
</style>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts" generic="ContextObjType extends { [key: string]: any }">
|
|
2
2
|
import { Btn } from '@bagelink/vue'
|
|
3
|
+
import { watch } from 'vue'
|
|
3
4
|
|
|
4
5
|
export interface RadioOption<T> {
|
|
5
6
|
imgAlt?: string
|
|
@@ -11,15 +12,26 @@ export interface RadioOption<T> {
|
|
|
11
12
|
value: any
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
type RadioOptionsSource<T> = RadioOption<T>[] | (() => Promise<RadioOption<T>[]>)
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<{
|
|
19
|
+
id?: string
|
|
20
|
+
groupName?: string
|
|
21
|
+
options: RadioOptionsSource<ContextObjType>
|
|
22
|
+
deletable?: boolean
|
|
23
|
+
required?: boolean
|
|
24
|
+
error?: string
|
|
25
|
+
disabled?: boolean
|
|
26
|
+
thin?: boolean
|
|
27
|
+
flat?: boolean
|
|
28
|
+
invertedActive?: boolean
|
|
29
|
+
align?: 'start' | 'center' | 'end' | 'top' | 'bottom'
|
|
30
|
+
}>(),
|
|
31
|
+
{
|
|
32
|
+
align: 'center'
|
|
33
|
+
}
|
|
34
|
+
)
|
|
23
35
|
|
|
24
36
|
const emit = defineEmits(['delete', 'focus', 'blur', 'change'])
|
|
25
37
|
|
|
@@ -31,6 +43,23 @@ const name = $computed(
|
|
|
31
43
|
)
|
|
32
44
|
)
|
|
33
45
|
const selectedOption = defineModel('modelValue')
|
|
46
|
+
let loadedOptions = $ref<any[]>([])
|
|
47
|
+
const visibleOptions = $computed(() => Array.isArray(props.options) ? (props.options as any[]) : (loadedOptions as any[]))
|
|
48
|
+
|
|
49
|
+
async function loadOptionsIfNeeded() {
|
|
50
|
+
if (typeof props.options === 'function') {
|
|
51
|
+
try {
|
|
52
|
+
loadedOptions = await props.options()
|
|
53
|
+
} catch {
|
|
54
|
+
loadedOptions = []
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
watch(() => props.options, () => {
|
|
60
|
+
loadedOptions = []
|
|
61
|
+
loadOptionsIfNeeded()
|
|
62
|
+
}, { immediate: true, deep: true })
|
|
34
63
|
let isFocused = $ref(false)
|
|
35
64
|
|
|
36
65
|
const containerClasses = $computed(() => ({
|
|
@@ -57,60 +86,56 @@ function handleChange() {
|
|
|
57
86
|
<template>
|
|
58
87
|
<div :class="containerClasses">
|
|
59
88
|
<label
|
|
60
|
-
v-for="(opt, index) in
|
|
61
|
-
|
|
62
|
-
class="border rounded p-1 flex bg-gray-light mb-05 gap-075 active-list-item hover"
|
|
89
|
+
v-for="(opt, index) in visibleOptions" :key="opt.id || `${name}-${index}`"
|
|
90
|
+
class="border rounded flex mb-05 active-list-item hover"
|
|
63
91
|
:for="opt.id || `${name}-${index}`"
|
|
92
|
+
:class="{ 'p-05 gap-025': thin, 'py-1 gap-075': !thin, 'bg-gray-light': !flat, 'align-items-start': align === 'start' || align === 'top', 'align-items-center': align === 'center', 'align-items-end': align === 'end' || align === 'bottom', invertedActive }"
|
|
64
93
|
>
|
|
65
94
|
<input
|
|
66
|
-
:id="opt.id || `${name}-${index}`"
|
|
67
|
-
|
|
68
|
-
:disabled
|
|
69
|
-
class="radio-input-list"
|
|
70
|
-
type="radio"
|
|
71
|
-
:name
|
|
72
|
-
:value="opt.value"
|
|
73
|
-
:required="required"
|
|
74
|
-
@focus="handleFocus"
|
|
75
|
-
@blur="handleBlur"
|
|
95
|
+
:id="opt.id || `${name}-${index}`" v-model="selectedOption" :disabled class="radio-input-list"
|
|
96
|
+
type="radio" :name :value="opt.value" :required="required" @focus="handleFocus" @blur="handleBlur"
|
|
76
97
|
@change="handleChange"
|
|
98
|
+
:class="{
|
|
99
|
+
'mt-025': align === 'start' || align === 'top',
|
|
100
|
+
'mb-025': align === 'end' || align === 'bottom'
|
|
101
|
+
}"
|
|
77
102
|
>
|
|
78
103
|
<div class="flex w-100 gap-1 flex-wrap m_gap-05 m_gap-row-025">
|
|
79
104
|
<img
|
|
80
|
-
v-if="opt.imgSrc"
|
|
81
|
-
class="bg-popup shadow-light py-025 radius-05 m_w40"
|
|
82
|
-
width="60"
|
|
83
|
-
:src="opt.imgSrc"
|
|
105
|
+
v-if="opt.imgSrc" class="bg-popup shadow-light py-025 radius-05 m_w40" height="40" :src="opt.imgSrc"
|
|
84
106
|
:alt="opt.imgAlt"
|
|
85
107
|
>
|
|
86
108
|
<div class="">
|
|
87
|
-
<p v-if="opt.label" class="m-0 m_txt-14">{{ opt.label }}</p>
|
|
109
|
+
<p v-if="opt.label" class="m-0 m_txt-14 line-height-14 pb-025">{{ opt.label }}</p>
|
|
88
110
|
<p v-if="opt.subLabel" class="txt-gray txt-12 m-0">{{ opt.subLabel }}</p>
|
|
89
111
|
</div>
|
|
90
112
|
<slot name="radioItem" v-bind="opt" />
|
|
91
113
|
</div>
|
|
92
|
-
<Btn
|
|
93
|
-
v-if="deletable"
|
|
94
|
-
class="ms-auto"
|
|
95
|
-
flat thin icon="delete"
|
|
96
|
-
@click="$emit('delete', opt)"
|
|
97
|
-
/>
|
|
114
|
+
<Btn v-if="deletable" class="ms-auto" flat thin icon="delete" @click="$emit('delete', opt)" />
|
|
98
115
|
</label>
|
|
99
116
|
</div>
|
|
100
117
|
</template>
|
|
101
118
|
|
|
102
119
|
<style scoped>
|
|
103
|
-
.radio-input-list{
|
|
120
|
+
.radio-input-list {
|
|
104
121
|
width: auto;
|
|
105
122
|
transform: scale(1.4);
|
|
106
123
|
margin-inline-end: 0.6rem;
|
|
107
124
|
|
|
108
125
|
}
|
|
109
|
-
|
|
126
|
+
|
|
127
|
+
.active-list-item:has(:checked) {
|
|
110
128
|
background: var(--bgl-primary-light) !important;
|
|
111
129
|
border-color: var(--bgl-primary) !important;
|
|
112
130
|
accent-color: var(--bgl-accent-color);
|
|
113
131
|
}
|
|
132
|
+
.invertedActive:has(:checked) {
|
|
133
|
+
background: var(--bgl-primary) !important;
|
|
134
|
+
border-color: var(--bgl-primary) !important;
|
|
135
|
+
color: var(--bgl-white);
|
|
136
|
+
accent-color: var(--bgl-white);
|
|
137
|
+
|
|
138
|
+
}
|
|
114
139
|
|
|
115
140
|
.has-error .active-list-item {
|
|
116
141
|
border-color: var(--bgl-red) !important;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { BaseBagelField } from '@bagelink/vue'
|
|
2
1
|
import type { ModalApi } from '../../../../../plugins/useModal'
|
|
3
2
|
|
|
4
3
|
import type { EditorState } from '../richTextTypes'
|
|
@@ -90,7 +89,7 @@ export function insertEmbed(modal: ModalApi, state: EditorState) {
|
|
|
90
89
|
bglFrmUtil.numField('width', 'Width', { min: 200, placeholder: '560' }),
|
|
91
90
|
bglFrmUtil.numField('height', 'Height', { min: 200, placeholder: '315' })
|
|
92
91
|
),
|
|
93
|
-
{ id: 'allowFullscreen', $el: 'check', label: 'Allow Fullscreen', value: true }
|
|
92
|
+
{ id: 'allowFullscreen', $el: 'check', label: 'Allow Fullscreen', attrs: { value: true } },
|
|
94
93
|
],
|
|
95
94
|
onSubmit: (data: { url: string, width?: number, height?: number, allowFullscreen?: boolean }) => {
|
|
96
95
|
if (!data.url) return
|