@bagelink/vue 1.5.17 → 1.5.22
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/experimentalGenTypedRoutes.ts +15 -15
- package/bin/generateFormSchema.ts +12 -12
- package/bin/utils.ts +4 -4
- package/dist/components/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/calendar/CalendarPopover.vue.d.ts.map +1 -1
- package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
- package/dist/components/form/FieldArray.vue.d.ts +5 -4
- package/dist/components/form/FieldArray.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts +1 -0
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ToggleInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/composables/useFormField.d.ts.map +1 -1
- package/dist/composables/useSchemaField.d.ts.map +1 -1
- package/dist/index.cjs +17 -14
- package/dist/index.mjs +511 -422
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/AccordionItem.vue +2 -2
- package/src/components/AddToCalendar.vue +1 -1
- package/src/components/BglVideo.vue +8 -8
- package/src/components/Btn.vue +9 -9
- package/src/components/Card.vue +4 -4
- package/src/components/Carousel.vue +44 -44
- package/src/components/DataPreview.vue +1 -1
- package/src/components/DragOver.vue +6 -6
- package/src/components/Dropdown.vue +14 -14
- package/src/components/Flag.vue +3 -3
- package/src/components/Icon/Icon.vue +13 -13
- package/src/components/Image.vue +4 -4
- package/src/components/ImportData.vue +79 -79
- package/src/components/ListItem.vue +7 -7
- package/src/components/MapEmbed/Index.vue +6 -6
- package/src/components/Modal.vue +10 -10
- package/src/components/ModalForm.vue +4 -4
- package/src/components/NavBar.vue +2 -2
- package/src/components/Pagination.vue +9 -9
- package/src/components/Pill.vue +1 -1
- package/src/components/Rating.vue +2 -2
- package/src/components/Slider.vue +77 -77
- package/src/components/Spreadsheet/Index.vue +34 -34
- package/src/components/Spreadsheet/SpreadsheetTable.vue +3 -3
- package/src/components/Zoomer.vue +28 -28
- package/src/components/analytics/BarChart.vue +6 -6
- package/src/components/analytics/KpiCard.vue +2 -2
- package/src/components/analytics/LineChart.vue +14 -14
- package/src/components/analytics/PieChart.vue +11 -11
- package/src/components/calendar/CalendarPopover.vue +1 -1
- package/src/components/calendar/Index.vue +1 -1
- package/src/components/calendar/views/AgendaView.vue +2 -2
- package/src/components/calendar/views/DayView.vue +6 -6
- package/src/components/calendar/views/MonthView.vue +2 -2
- package/src/components/calendar/views/WeekView.vue +18 -18
- package/src/components/dataTable/DataTable.vue +3 -3
- package/src/components/dataTable/useSorting.ts +1 -1
- package/src/components/dataTable/useTableData.ts +15 -15
- package/src/components/dataTable/useTableSelection.ts +8 -8
- package/src/components/dataTable/useTableVirtualization.ts +1 -1
- package/src/components/draggable/useDraggable.ts +42 -42
- package/src/components/form/BagelForm.vue +66 -23
- package/src/components/form/BglMultiStepForm.vue +18 -18
- package/src/components/form/FieldArray.vue +177 -67
- package/src/components/form/inputs/CheckInput.vue +2 -1
- package/src/components/form/inputs/CodeEditor/Index.vue +1 -1
- package/src/components/form/inputs/CodeEditor/format.ts +7 -7
- package/src/components/form/inputs/CodeEditor/useHighlight.ts +6 -6
- package/src/components/form/inputs/DateInput.vue +6 -6
- package/src/components/form/inputs/DatePicker.vue +19 -19
- package/src/components/form/inputs/EmailInput.vue +14 -14
- package/src/components/form/inputs/NumberInput.vue +6 -6
- package/src/components/form/inputs/OTP.vue +3 -3
- package/src/components/form/inputs/RadioGroup.vue +1 -1
- package/src/components/form/inputs/RadioPillsInput.vue +8 -8
- package/src/components/form/inputs/RichText/components/EditorToolbar.vue +10 -10
- package/src/components/form/inputs/RichText/components/TableGridSelector.vue +1 -1
- package/src/components/form/inputs/RichText/composables/useCommands.ts +1 -1
- package/src/components/form/inputs/RichText/composables/useEditor.ts +12 -12
- package/src/components/form/inputs/RichText/composables/useEditorKeyboard.ts +1 -1
- package/src/components/form/inputs/RichText/index.vue +143 -134
- package/src/components/form/inputs/RichText/utils/commands.ts +69 -69
- package/src/components/form/inputs/RichText/utils/debug.ts +1 -1
- package/src/components/form/inputs/RichText/utils/formatting.ts +39 -39
- package/src/components/form/inputs/RichText/utils/media.ts +6 -6
- package/src/components/form/inputs/RichText/utils/selection.ts +28 -28
- package/src/components/form/inputs/RichText/utils/table.ts +19 -19
- package/src/components/form/inputs/SelectBtn.vue +1 -1
- package/src/components/form/inputs/SelectInput.vue +50 -26
- package/src/components/form/inputs/SignaturePad.vue +15 -15
- package/src/components/form/inputs/TableField.vue +1 -1
- package/src/components/form/inputs/TelInput.vue +6 -6
- package/src/components/form/inputs/TextInput.vue +5 -5
- package/src/components/form/inputs/ToggleInput.vue +2 -1
- package/src/components/form/inputs/Upload/UploadInput.vue +155 -102
- package/src/components/form/inputs/Upload/upload.ts +1 -1
- package/src/components/form/inputs/Upload/useFileUpload.ts +6 -6
- package/src/components/form/useBagelFormState.ts +5 -5
- package/src/components/layout/AppContent.vue +1 -1
- package/src/components/layout/AppLayout.vue +1 -1
- package/src/components/layout/Layout.vue +4 -4
- package/src/components/layout/TabbedLayout.vue +1 -1
- package/src/components/layout/Tabs.vue +2 -2
- package/src/components/layout/TabsNav.vue +7 -7
- package/src/components/lightbox/Lightbox.vue +8 -8
- package/src/components/lightbox/index.ts +8 -8
- package/src/composables/index.ts +2 -2
- package/src/composables/useAddToCalendar.ts +13 -13
- package/src/composables/useDevice.ts +2 -2
- package/src/composables/useExcel.ts +6 -6
- package/src/composables/useFormField.ts +5 -9
- package/src/composables/usePolling.ts +8 -8
- package/src/composables/useSchemaField.ts +53 -38
- package/src/composables/useTheme.ts +9 -9
- package/src/composables/useValidateFieldValue.ts +2 -2
- package/src/directives/pattern.ts +25 -25
- package/src/directives/ripple.ts +4 -4
- package/src/directives/vResize.ts +6 -6
- package/src/plugins/bagel.ts +4 -4
- package/src/plugins/useModal.ts +3 -3
- package/src/styles/layout.css +7 -1
- package/src/utils/BagelFormUtils.ts +7 -7
- package/src/utils/calendar/Helpers.ts +8 -8
- package/src/utils/calendar/dateUtils.ts +22 -22
- package/src/utils/calendar/time.ts +25 -25
- package/src/utils/calendar/week.ts +25 -25
- package/src/utils/elementUtils.ts +27 -27
- package/src/utils/index.ts +22 -22
- package/src/utils/sizeParsing.ts +2 -2
- package/src/utils/strings.ts +5 -5
- package/src/utils/tapDetector.ts +11 -11
- package/src/utils/useSearch.ts +29 -29
- package/vite.config.ts +1 -1
|
@@ -30,9 +30,9 @@ const props = withDefaults(
|
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
const isComponent = $computed(() => {
|
|
33
|
-
if (props.to) return 'router-link'
|
|
34
|
-
if (props.href) return 'a'
|
|
35
|
-
if (props.onClick) return 'button'
|
|
33
|
+
if (props.to) {return 'router-link'}
|
|
34
|
+
if (props.href) {return 'a'}
|
|
35
|
+
if (props.onClick) {return 'button'}
|
|
36
36
|
return 'div'
|
|
37
37
|
})
|
|
38
38
|
|
|
@@ -42,15 +42,15 @@ const isClickable = $computed(() => {
|
|
|
42
42
|
|
|
43
43
|
const bind = $computed(() => {
|
|
44
44
|
const obj: { [key: string]: any } = {}
|
|
45
|
-
if (props.to) obj.to = props.to
|
|
46
|
-
else if (props.href) obj.href = props.href
|
|
47
|
-
if (props.target && (props.to || props.href)) obj.target = props.target
|
|
45
|
+
if (props.to) {obj.to = props.to}
|
|
46
|
+
else if (props.href) {obj.href = props.href}
|
|
47
|
+
if (props.target && (props.to || props.href)) {obj.target = props.target}
|
|
48
48
|
|
|
49
49
|
obj.class = {
|
|
50
50
|
'notClickable': !(props.to || props.onClick),
|
|
51
51
|
'no-border-list': props.flat,
|
|
52
52
|
}
|
|
53
|
-
if (props.disabled) obj.disabled = true
|
|
53
|
+
if (props.disabled) {obj.disabled = true}
|
|
54
54
|
return obj
|
|
55
55
|
})
|
|
56
56
|
</script>
|
|
@@ -41,7 +41,7 @@ const defaultMarkerSVG = '<svg width="28" height="38" viewBox="0 0 28 38" fill="
|
|
|
41
41
|
const leafletScriptUrl = 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js'
|
|
42
42
|
|
|
43
43
|
async function loadGlobalL() {
|
|
44
|
-
while (!window.L) await sleep(100)
|
|
44
|
+
while (!window.L) {await sleep(100)}
|
|
45
45
|
return window.L
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -69,14 +69,14 @@ async function addMarker(marker: MapMarker) {
|
|
|
69
69
|
const title = Array.isArray(marker) ? marker[2] : marker.title ?? marker.tooltip
|
|
70
70
|
const tooltip = Array.isArray(marker) ? marker[2] : marker.tooltip
|
|
71
71
|
const m = L?.marker(latlng, { title, icon, interactive: true }).addTo(map as Map) as Marker
|
|
72
|
-
if (tooltip) m.bindTooltip(tooltip, { direction: 'top' }) // Use `bindPopup` if you want a click-to-show label
|
|
72
|
+
if (tooltip) {m.bindTooltip(tooltip, { direction: 'top' })} // Use `bindPopup` if you want a click-to-show label
|
|
73
73
|
m.on('click', () => { emit('select', marker) })
|
|
74
74
|
|
|
75
75
|
_markers.push(m)
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function fitMarkers(L: any) {
|
|
79
|
-
if (_markers.length
|
|
79
|
+
if (0 < _markers.length) {
|
|
80
80
|
const latLngs = _markers.map(marker => marker.getLatLng())
|
|
81
81
|
const bounds = L.latLngBounds(latLngs)
|
|
82
82
|
const center = bounds.getCenter()
|
|
@@ -96,12 +96,12 @@ function latLangFromMarker(marker: MapMarker): LatLngExpression {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
async function watchMarkers(markers?: MapMarker[]) {
|
|
99
|
-
if (!L) L = await loadGlobalL()
|
|
99
|
+
if (!L) {L = await loadGlobalL()}
|
|
100
100
|
_markers.forEach(marker => marker.remove())
|
|
101
|
-
if (!markers) return
|
|
101
|
+
if (!markers) {return}
|
|
102
102
|
|
|
103
103
|
for (const marker of markers) {
|
|
104
|
-
if (!map) await initializeMap()
|
|
104
|
+
if (!map) {await initializeMap()}
|
|
105
105
|
addMarker(marker)
|
|
106
106
|
}
|
|
107
107
|
fitMarkers(L)
|
package/src/components/Modal.vue
CHANGED
|
@@ -43,27 +43,27 @@ let isVisible = $ref<boolean>(false)
|
|
|
43
43
|
watch(
|
|
44
44
|
() => props.visible,
|
|
45
45
|
(val) => {
|
|
46
|
-
if (val === isVisible || val === undefined) return
|
|
47
|
-
if (val) openModal()
|
|
48
|
-
else closeModal()
|
|
46
|
+
if (val === isVisible || val === undefined) {return}
|
|
47
|
+
if (val) {openModal()}
|
|
48
|
+
else {closeModal()}
|
|
49
49
|
},
|
|
50
50
|
{ immediate: true },
|
|
51
51
|
)
|
|
52
52
|
|
|
53
53
|
const maxWidth = $computed(() => {
|
|
54
54
|
const { width } = props
|
|
55
|
-
if (width?.match(/px|em|rem|vw|vh|%/)) return { 'max-width': width }
|
|
56
|
-
if (width?.match(/\d+/)) return { 'max-width': `${width}px` }
|
|
55
|
+
if (width?.match(/px|em|rem|vw|vh|%/)) {return { 'max-width': width }}
|
|
56
|
+
if (width?.match(/\d+/)) {return { 'max-width': `${width}px` }}
|
|
57
57
|
return { 'max-width': '720px' }
|
|
58
58
|
})
|
|
59
59
|
|
|
60
60
|
// Computed properties for close button placement
|
|
61
|
-
const isOverlay = $computed(() =>
|
|
62
|
-
const isHeader = $computed(() =>
|
|
63
|
-
const isFooter = $computed(() => props.closePlacement
|
|
61
|
+
const isOverlay = $computed(() => 'overlay' === props.closePlacement || 'overlay-end' === props.closePlacement)
|
|
62
|
+
const isHeader = $computed(() => 'header' === props.closePlacement || 'header-end' === props.closePlacement)
|
|
63
|
+
const isFooter = $computed(() => 'footer' === props.closePlacement)
|
|
64
64
|
|
|
65
65
|
const overlayCloseClass = $computed(() => {
|
|
66
|
-
if (
|
|
66
|
+
if ('overlay-end' === props.closePlacement) {return 'top-1 end-1'}
|
|
67
67
|
return 'top-1 start-1'
|
|
68
68
|
})
|
|
69
69
|
|
|
@@ -75,7 +75,7 @@ function closeModal() {
|
|
|
75
75
|
defineExpose({ closeModal })
|
|
76
76
|
|
|
77
77
|
function escapeKeyClose(e: KeyboardEvent) {
|
|
78
|
-
if (props.dismissable && e.key
|
|
78
|
+
if (props.dismissable && 'Escape' === e.key) {
|
|
79
79
|
closeModal()
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -28,16 +28,16 @@ const closeModal = () => modal?.closeModal()
|
|
|
28
28
|
let submitting = $ref(false)
|
|
29
29
|
|
|
30
30
|
async function runSubmit() {
|
|
31
|
-
if (submitting) return
|
|
32
|
-
if (form?.validateForm()
|
|
31
|
+
if (submitting) {return}
|
|
32
|
+
if (false === form?.validateForm()) {return}
|
|
33
33
|
submitting = true
|
|
34
34
|
try {
|
|
35
35
|
await props.onSubmit?.(formData.value)
|
|
36
36
|
closeModal()
|
|
37
37
|
} catch (err: any) {
|
|
38
38
|
submitting = false
|
|
39
|
-
if (props.onError) props.onError(err)
|
|
40
|
-
else bagel.onError?.(err)
|
|
39
|
+
if (props.onError) {props.onError(err)}
|
|
40
|
+
else {bagel.onError?.(err)}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -23,10 +23,10 @@ withDefaults(
|
|
|
23
23
|
let isOpen = $ref(true)
|
|
24
24
|
|
|
25
25
|
function calcIsOpen() {
|
|
26
|
-
isOpen = window.innerWidth
|
|
26
|
+
isOpen = 1100 > window.innerWidth
|
|
27
27
|
|
|
28
28
|
const storedNavOpenVal = localStorage.getItem('navOpen')
|
|
29
|
-
if (
|
|
29
|
+
if ('true' === storedNavOpenVal || null === storedNavOpenVal) {isOpen = true}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function toggleMenu() {
|
|
@@ -34,7 +34,7 @@ let indicatorWidth = $ref(0)
|
|
|
34
34
|
|
|
35
35
|
// Calculate totalPages from totalItems and perPage if not provided directly
|
|
36
36
|
const computedTotalPages = $computed(() => {
|
|
37
|
-
if (props.totalPages !== undefined) return props.totalPages
|
|
37
|
+
if (props.totalPages !== undefined) {return props.totalPages}
|
|
38
38
|
const { perPage } = props
|
|
39
39
|
return Math.max(1, Math.ceil(props.totalItems / perPage))
|
|
40
40
|
})
|
|
@@ -74,8 +74,8 @@ const visiblePages = $computed(() => {
|
|
|
74
74
|
mustInclude.add(page.value)
|
|
75
75
|
|
|
76
76
|
// Ensure adjacent pages are included for navigation
|
|
77
|
-
if (page.value
|
|
78
|
-
if (page.value < computedTotalPages) mustInclude.add(page.value + 1)
|
|
77
|
+
if (1 < page.value) {mustInclude.add(page.value - 1)}
|
|
78
|
+
if (page.value < computedTotalPages) {mustInclude.add(page.value + 1)}
|
|
79
79
|
|
|
80
80
|
// Always include first and last pages
|
|
81
81
|
mustInclude.add(1)
|
|
@@ -91,7 +91,7 @@ const visiblePages = $computed(() => {
|
|
|
91
91
|
const current = pageArray[i]
|
|
92
92
|
const next = pageArray[i + 1]
|
|
93
93
|
|
|
94
|
-
if (next - current
|
|
94
|
+
if (1 < next - current) {
|
|
95
95
|
// There's a gap - fill in additional pages
|
|
96
96
|
const pagesToAdd = Math.min(next - current - 1, maxVisiblePages + 2 - pageArray.length)
|
|
97
97
|
|
|
@@ -110,10 +110,10 @@ const visiblePages = $computed(() => {
|
|
|
110
110
|
})
|
|
111
111
|
|
|
112
112
|
function updateIndicatorPosition() {
|
|
113
|
-
if (!paginationContainer) return
|
|
113
|
+
if (!paginationContainer) {return}
|
|
114
114
|
|
|
115
115
|
const selectedButton = paginationContainer.querySelector('.selected')
|
|
116
|
-
if (!selectedButton) return
|
|
116
|
+
if (!selectedButton) {return}
|
|
117
117
|
|
|
118
118
|
const containerRect = paginationContainer.getBoundingClientRect()
|
|
119
119
|
const buttonRect = selectedButton.getBoundingClientRect()
|
|
@@ -133,7 +133,7 @@ function updateIndicatorPosition() {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
function handleClick(p: number) {
|
|
136
|
-
if (
|
|
136
|
+
if (1 > p || p > computedTotalPages) {return}
|
|
137
137
|
page.value = p
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -164,9 +164,9 @@ const renderPageButtons = $computed(() => {
|
|
|
164
164
|
const pageNum = visiblePages[i]
|
|
165
165
|
|
|
166
166
|
// Insert ellipsis before this page if needed
|
|
167
|
-
if (
|
|
167
|
+
if (0 < i) {
|
|
168
168
|
const prevPage = visiblePages[i - 1]
|
|
169
|
-
if (pageNum - prevPage
|
|
169
|
+
if (1 < pageNum - prevPage) {
|
|
170
170
|
items.push({
|
|
171
171
|
type: 'ellipsis',
|
|
172
172
|
key: `ellipsis-${i}`
|
package/src/components/Pill.vue
CHANGED
|
@@ -12,10 +12,10 @@ const { rating, totalStars = 5, iconType = 'star', fillColor = '#fabf05', emptyC
|
|
|
12
12
|
}>()
|
|
13
13
|
|
|
14
14
|
function getFillWidth(n: number): string {
|
|
15
|
-
const ratingNumber = typeof rating
|
|
15
|
+
const ratingNumber = 'string' === typeof rating ? Number.parseFloat(rating.replace(',', '.')) : rating
|
|
16
16
|
if (n <= Math.floor(ratingNumber)) {
|
|
17
17
|
return '100%'
|
|
18
|
-
}
|
|
18
|
+
}if (n > Math.ceil(ratingNumber)) {
|
|
19
19
|
return '0%'
|
|
20
20
|
} else {
|
|
21
21
|
return `${(ratingNumber % 1) * 100}%`
|