@bagelink/vue 1.6.43 → 1.6.49
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 +18 -19
- package/bin/utils.ts +4 -4
- package/dist/components/AddressSearch.vue.d.ts.map +1 -1
- package/dist/components/Alert.vue.d.ts.map +1 -1
- package/dist/components/BglVideo.vue.d.ts.map +1 -1
- package/dist/components/Card.vue.d.ts.map +1 -1
- package/dist/components/Carousel.vue.d.ts +2 -2
- package/dist/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/Flag.vue.d.ts.map +1 -1
- package/dist/components/IframeVue.vue.d.ts.map +1 -1
- package/dist/components/ListItem.vue.d.ts.map +1 -1
- package/dist/components/Loading.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/ModalForm.vue.d.ts.map +1 -1
- package/dist/components/NavBar.vue.d.ts +1 -1
- package/dist/components/Pill.vue.d.ts.map +1 -1
- package/dist/components/Swiper.vue.d.ts +12 -4
- package/dist/components/Swiper.vue.d.ts.map +1 -1
- package/dist/components/Zoomer.vue.d.ts.map +1 -1
- package/dist/components/analytics/LineChart.vue.d.ts.map +1 -1
- package/dist/components/analytics/PieChart.vue.d.ts +2 -1
- package/dist/components/analytics/PieChart.vue.d.ts.map +1 -1
- package/dist/components/analytics/index.d.ts +1 -1
- package/dist/components/analytics/index.d.ts.map +1 -1
- package/dist/components/calendar/CalendarPopover.vue.d.ts.map +1 -1
- package/dist/components/form/BglMultiStepForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ColorInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RadioGroup.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RangeInput.vue.d.ts +11 -11
- package/dist/components/form/inputs/RichText/components/EditorToolbar.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/components/TableGridSelector.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/utils/commands.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
- package/dist/components/layout/AppContent.vue.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.vue.d.ts +1 -0
- package/dist/components/layout/AppSidebar.vue.d.ts.map +1 -1
- package/dist/components/layout/Layout.vue.d.ts.map +1 -1
- package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
- package/dist/components/layout/index.d.ts +3 -3
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/index.cjs +24 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1530 -1404
- package/dist/plugins/modalTypes.d.ts +1 -8
- package/dist/plugins/modalTypes.d.ts.map +1 -1
- package/dist/plugins/useModal.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -2
- package/src/components/AccordionItem.vue +13 -13
- package/src/components/AddToCalendar.vue +1 -1
- package/src/components/AddressSearch.vue +9 -8
- package/src/components/Alert.vue +2 -1
- package/src/components/Badge.vue +5 -5
- package/src/components/BglVideo.vue +44 -45
- package/src/components/Btn.vue +15 -15
- package/src/components/Card.vue +10 -8
- package/src/components/Carousel.vue +159 -162
- package/src/components/DataPreview.vue +1 -1
- package/src/components/DragOver.vue +6 -6
- package/src/components/Dropdown.vue +39 -38
- package/src/components/Flag.vue +7 -6
- package/src/components/Icon/Icon.vue +22 -22
- package/src/components/IframeVue.vue +5 -5
- package/src/components/Image.vue +17 -17
- package/src/components/ImportData.vue +79 -79
- package/src/components/ListItem.vue +12 -11
- package/src/components/Loading.vue +10 -9
- package/src/components/MapEmbed/Index.vue +24 -24
- package/src/components/Modal.vue +11 -9
- package/src/components/ModalForm.vue +15 -11
- package/src/components/NavBar.vue +6 -6
- package/src/components/Pagination.vue +27 -27
- package/src/components/Pill.vue +11 -12
- package/src/components/Rating.vue +2 -2
- package/src/components/Slider.vue +75 -75
- package/src/components/Spreadsheet/Index.vue +34 -34
- package/src/components/Spreadsheet/SpreadsheetTable.vue +3 -3
- package/src/components/Swiper.vue +4 -4
- package/src/components/Zoomer.vue +282 -182
- package/src/components/analytics/BarChart.vue +6 -6
- package/src/components/analytics/KpiCard.vue +2 -2
- package/src/components/analytics/LineChart.vue +63 -61
- package/src/components/analytics/PieChart.vue +104 -90
- package/src/components/analytics/index.ts +2 -2
- package/src/components/calendar/CalendarPopover.vue +1 -1
- package/src/components/calendar/Index.vue +1 -1
- package/src/components/calendar/views/AgendaView.vue +3 -3
- 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 +4 -4
- package/src/components/dataTable/useSorting.ts +1 -1
- package/src/components/dataTable/useTableData.ts +15 -15
- package/src/components/dataTable/useTableSelection.ts +15 -15
- package/src/components/dataTable/useTableVirtualization.ts +1 -1
- package/src/components/draggable/useDraggable.ts +42 -42
- package/src/components/form/BagelForm.vue +15 -15
- package/src/components/form/BglFieldSet.vue +5 -3
- package/src/components/form/BglMultiStepForm.vue +20 -21
- package/src/components/form/inputs/CheckInput.vue +2 -2
- 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/ColorInput.vue +5 -4
- package/src/components/form/inputs/DateInput.vue +8 -9
- package/src/components/form/inputs/DatePicker.vue +24 -24
- package/src/components/form/inputs/EmailInput.vue +24 -24
- package/src/components/form/inputs/NumberInput.vue +26 -26
- package/src/components/form/inputs/OTP.vue +7 -7
- package/src/components/form/inputs/PasswordInput.vue +3 -2
- package/src/components/form/inputs/RadioGroup.vue +28 -25
- package/src/components/form/inputs/RadioPillsInput.vue +12 -12
- package/src/components/form/inputs/RangeInput.vue +21 -21
- package/src/components/form/inputs/RichText/components/EditorToolbar.vue +107 -92
- package/src/components/form/inputs/RichText/components/TableGridSelector.vue +64 -64
- package/src/components/form/inputs/RichText/components/gridBox.vue +10 -8
- 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 +138 -138
- package/src/components/form/inputs/RichText/utils/commands.ts +84 -85
- 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 +7 -7
- 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 +54 -54
- package/src/components/form/inputs/SignaturePad.vue +40 -40
- package/src/components/form/inputs/TableField.vue +1 -1
- package/src/components/form/inputs/TelInput.vue +54 -53
- package/src/components/form/inputs/TextInput.vue +19 -19
- package/src/components/form/inputs/ToggleInput.vue +2 -2
- package/src/components/form/inputs/Upload/useFileUpload.ts +6 -6
- package/src/components/form/useBagelFormState.ts +5 -5
- package/src/components/layout/AppContent.vue +6 -3
- package/src/components/layout/AppLayout.vue +2 -2
- package/src/components/layout/AppSidebar.vue +83 -16
- package/src/components/layout/Layout.vue +12 -10
- package/src/components/layout/SidebarMenu.vue +4 -4
- package/src/components/layout/TabbedLayout.vue +17 -17
- package/src/components/layout/Tabs.vue +4 -5
- package/src/components/layout/TabsNav.vue +14 -14
- package/src/components/layout/index.ts +3 -5
- package/src/components/lightbox/Lightbox.vue +276 -126
- package/src/components/lightbox/index.ts +8 -8
- package/src/composables/index.ts +8 -8
- package/src/composables/useAddToCalendar.ts +13 -13
- package/src/composables/useDevice.ts +2 -2
- package/src/composables/useFormField.ts +4 -4
- package/src/composables/usePolling.ts +8 -8
- package/src/composables/useSchemaField.ts +38 -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/index.ts +1 -0
- package/src/plugins/bagel.ts +4 -4
- package/src/plugins/modalTypes.ts +1 -8
- package/src/plugins/useModal.ts +43 -18
- package/src/styles/layout.css +1 -1
- package/src/types/index.ts +1 -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/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 +0 -2
|
@@ -38,7 +38,7 @@ function flattenObject(obj: { [key: string]: any }, prefix = ''): { [key: string
|
|
|
38
38
|
const value = obj[key]
|
|
39
39
|
const newKey = prefix ? `${prefix}.${key}` : key
|
|
40
40
|
|
|
41
|
-
if (value && 'object'
|
|
41
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
42
42
|
Object.assign(flattened, flattenObject(value, newKey))
|
|
43
43
|
} else {
|
|
44
44
|
flattened[newKey] = value
|
|
@@ -132,7 +132,7 @@ const columns = computed(() => {
|
|
|
132
132
|
|
|
133
133
|
// Format cell value based on column configuration
|
|
134
134
|
function formatCellValue(value: any, format?: ColumnFormat): string {
|
|
135
|
-
if (
|
|
135
|
+
if (value === null || value === undefined) { return '' }
|
|
136
136
|
|
|
137
137
|
switch (format) {
|
|
138
138
|
case 'image':
|
|
@@ -162,15 +162,15 @@ function formatCellValue(value: any, format?: ColumnFormat): string {
|
|
|
162
162
|
function parseValueForFormat(value: string | boolean, format?: ColumnFormat): any {
|
|
163
163
|
switch (format) {
|
|
164
164
|
case 'boolean':
|
|
165
|
-
return 'boolean'
|
|
165
|
+
return typeof value === 'boolean' ? value : value === 'true'
|
|
166
166
|
case 'number':
|
|
167
167
|
case 'percentage':
|
|
168
168
|
case 'currency':
|
|
169
|
-
if ('boolean'
|
|
170
|
-
return
|
|
169
|
+
if (typeof value === 'boolean') { return null }
|
|
170
|
+
return value === '' ? null : Number(String(value).replace(/[^0-9.-]/g, ''))
|
|
171
171
|
case 'date':
|
|
172
|
-
if ('boolean'
|
|
173
|
-
return
|
|
172
|
+
if (typeof value === 'boolean') { return null }
|
|
173
|
+
return value === '' ? null : new Date(String(value)).toISOString()
|
|
174
174
|
default:
|
|
175
175
|
return String(value)
|
|
176
176
|
}
|
|
@@ -185,10 +185,10 @@ function isCellEditable(columnKey: string): boolean {
|
|
|
185
185
|
// Update the sortByColumn function to preserve column visibility
|
|
186
186
|
function sortByColumn(columnKey: string) {
|
|
187
187
|
const column = columns.value.find(col => col.key === columnKey)
|
|
188
|
-
if (!column?.sortable) {return}
|
|
188
|
+
if (!column?.sortable) { return }
|
|
189
189
|
|
|
190
190
|
if (sortColumn.value === columnKey) {
|
|
191
|
-
sortDirection.value = 'desc'
|
|
191
|
+
sortDirection.value = sortDirection.value === 'desc' ? 'asc' : 'desc'
|
|
192
192
|
} else {
|
|
193
193
|
sortColumn.value = columnKey
|
|
194
194
|
sortDirection.value = 'desc'
|
|
@@ -198,11 +198,11 @@ function sortByColumn(columnKey: string) {
|
|
|
198
198
|
const aVal = a[columnKey]
|
|
199
199
|
const bVal = b[columnKey]
|
|
200
200
|
|
|
201
|
-
if (aVal === bVal) {return 0}
|
|
202
|
-
if (
|
|
203
|
-
if (
|
|
201
|
+
if (aVal === bVal) { return 0 }
|
|
202
|
+
if (aVal === null || aVal === undefined) { return 1 }
|
|
203
|
+
if (bVal === null || bVal === undefined) { return -1 }
|
|
204
204
|
|
|
205
|
-
const modifier = 'desc'
|
|
205
|
+
const modifier = sortDirection.value === 'desc' ? 1 : -1
|
|
206
206
|
return aVal < bVal ? -modifier : modifier
|
|
207
207
|
})
|
|
208
208
|
|
|
@@ -360,12 +360,12 @@ function redo() {
|
|
|
360
360
|
// Update updateCell to use undo stack
|
|
361
361
|
function updateCell(rowIndex: number, key: string, newValue: string | boolean) {
|
|
362
362
|
const column = columns.value.find(col => col.key === key)
|
|
363
|
-
if (column?.locked) {return}
|
|
363
|
+
if (column?.locked) { return }
|
|
364
364
|
|
|
365
365
|
saveState('cell')
|
|
366
366
|
const parsedValue = parseValueForFormat(newValue, column?.format)
|
|
367
367
|
// If the parsed value is null/undefined, use the default value
|
|
368
|
-
localRows.value[rowIndex][key] = parsedValue ?? column?.defaultValue ?? ('boolean'
|
|
368
|
+
localRows.value[rowIndex][key] = parsedValue ?? column?.defaultValue ?? (column?.format === 'boolean' ? false : '')
|
|
369
369
|
emitUpdate()
|
|
370
370
|
}
|
|
371
371
|
|
|
@@ -375,7 +375,7 @@ function updateCell(rowIndex: number, key: string, newValue: string | boolean) {
|
|
|
375
375
|
// After the columns computed property
|
|
376
376
|
// Initialize visibleColumns with all columns when columns change
|
|
377
377
|
watch(() => columns.value, (newColumns) => {
|
|
378
|
-
if (
|
|
378
|
+
if (newColumns.length > 0 && visibleColumns.value.length === 0) {
|
|
379
379
|
visibleColumns.value = newColumns.filter(col => !col.hidden).map(col => col.key)
|
|
380
380
|
}
|
|
381
381
|
})
|
|
@@ -398,7 +398,7 @@ function createEmptyRow(): { [key: string]: any } {
|
|
|
398
398
|
if (col.defaultValue !== undefined) {
|
|
399
399
|
newRow[col.key] = col.defaultValue
|
|
400
400
|
} else {
|
|
401
|
-
newRow[col.key] = 'boolean'
|
|
401
|
+
newRow[col.key] = col.format === 'boolean' ? false : ''
|
|
402
402
|
}
|
|
403
403
|
})
|
|
404
404
|
return newRow
|
|
@@ -415,7 +415,7 @@ function addRow() {
|
|
|
415
415
|
|
|
416
416
|
// Copy function using Navigator Clipboard API
|
|
417
417
|
async function copySelection() {
|
|
418
|
-
if (!selectionStart.value || !selectionEnd.value) {return}
|
|
418
|
+
if (!selectionStart.value || !selectionEnd.value) { return }
|
|
419
419
|
|
|
420
420
|
const startRow = Math.min(selectionStart.value.row, selectionEnd.value.row)
|
|
421
421
|
const endRow = Math.max(selectionStart.value.row, selectionEnd.value.row)
|
|
@@ -454,7 +454,7 @@ function isSearchFocused(): boolean {
|
|
|
454
454
|
|
|
455
455
|
// Update the pasteSelection function to handle search focus
|
|
456
456
|
async function pasteSelection() {
|
|
457
|
-
if (!selectionStart.value) {return}
|
|
457
|
+
if (!selectionStart.value) { return }
|
|
458
458
|
|
|
459
459
|
try {
|
|
460
460
|
const clipboardText = await navigator.clipboard.readText()
|
|
@@ -467,7 +467,7 @@ async function pasteSelection() {
|
|
|
467
467
|
|
|
468
468
|
// Calculate how many new rows we need to add
|
|
469
469
|
const neededRows = startRow + rows.length - localRows.value.length
|
|
470
|
-
if (
|
|
470
|
+
if (neededRows > 0) {
|
|
471
471
|
// Add the required number of new rows
|
|
472
472
|
for (let i = 0; i < neededRows; i++) {
|
|
473
473
|
localRows.value.push(createEmptyRow())
|
|
@@ -479,10 +479,10 @@ async function pasteSelection() {
|
|
|
479
479
|
const targetRow = startRow + rowIndex
|
|
480
480
|
rowData.forEach((cellValue, colIndex) => {
|
|
481
481
|
const targetCol = startCol + colIndex
|
|
482
|
-
if (targetCol >= columns.value.length) {return}
|
|
482
|
+
if (targetCol >= columns.value.length) { return }
|
|
483
483
|
|
|
484
484
|
const columnKey = columns.value[targetCol].key
|
|
485
|
-
if (!isCellEditable(columnKey)) {return}
|
|
485
|
+
if (!isCellEditable(columnKey)) { return }
|
|
486
486
|
|
|
487
487
|
const { format } = columns.value[targetCol]
|
|
488
488
|
localRows.value[targetRow][columnKey] = parseValueForFormat(cellValue, format)
|
|
@@ -501,10 +501,10 @@ const editingOriginalValue = ref<string | null>(null)
|
|
|
501
501
|
// Update the startEditing function to handle focus properly
|
|
502
502
|
function startEditing(row: number, col: number, initialKey?: string) {
|
|
503
503
|
const columnKey = columns.value[col]?.key
|
|
504
|
-
if (!columnKey) {return}
|
|
504
|
+
if (!columnKey) { return }
|
|
505
505
|
|
|
506
506
|
// Only check editability when we're actually going to edit
|
|
507
|
-
if (initialKey !== undefined && !isCellEditable(columnKey)) {return}
|
|
507
|
+
if (initialKey !== undefined && !isCellEditable(columnKey)) { return }
|
|
508
508
|
|
|
509
509
|
editingCell.value = { row, col }
|
|
510
510
|
editingOriginalValue.value = localRows.value[row][columnKey]?.toString() ?? ''
|
|
@@ -529,7 +529,7 @@ function startEditing(row: number, col: number, initialKey?: string) {
|
|
|
529
529
|
|
|
530
530
|
// Update the stopEditing function to handle cancellation
|
|
531
531
|
function stopEditing(cancelled = false) {
|
|
532
|
-
if (cancelled && editingCell.value &&
|
|
532
|
+
if (cancelled && editingCell.value && editingOriginalValue.value !== null) {
|
|
533
533
|
const { row, col } = editingCell.value
|
|
534
534
|
const columnKey = columns.value[col]?.key
|
|
535
535
|
if (columnKey) {
|
|
@@ -567,9 +567,9 @@ function handleCellKeyDown(event: KeyboardEvent, row: number, col: number) {
|
|
|
567
567
|
// If this cell is not already in edit mode
|
|
568
568
|
if (!(editingCell.value && editingCell.value.row === row && editingCell.value.col === col)) {
|
|
569
569
|
// Start editing if a printable character or Enter is pressed
|
|
570
|
-
if ((
|
|
570
|
+
if ((event.key.length === 1 && !event.ctrlKey && !event.metaKey) || event.key === 'Enter') {
|
|
571
571
|
event.preventDefault()
|
|
572
|
-
startEditing(row, col,
|
|
572
|
+
startEditing(row, col, event.key.length === 1 ? event.key : undefined)
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
}
|
|
@@ -577,7 +577,7 @@ function handleCellKeyDown(event: KeyboardEvent, row: number, col: number) {
|
|
|
577
577
|
// Update keyboard shortcuts to include undo/redo
|
|
578
578
|
function handleSpreadsheetKeyDown(event: KeyboardEvent) {
|
|
579
579
|
// Don't intercept keyboard shortcuts when editing a cell
|
|
580
|
-
if (editingCell.value || isSearchFocused()) {return}
|
|
580
|
+
if (editingCell.value || isSearchFocused()) { return }
|
|
581
581
|
console.log('handleSpreadsheetKeyDown', event)
|
|
582
582
|
const isCtrlOrCmd = event.ctrlKey || event.metaKey
|
|
583
583
|
|
|
@@ -608,21 +608,21 @@ function handleSpreadsheetKeyDown(event: KeyboardEvent) {
|
|
|
608
608
|
}
|
|
609
609
|
|
|
610
610
|
// Add computed properties for undo/redo stack state
|
|
611
|
-
const canUndo = computed(() =>
|
|
612
|
-
const canRedo = computed(() =>
|
|
611
|
+
const canUndo = computed(() => undoStack.value.length > 0)
|
|
612
|
+
const canRedo = computed(() => redoStack.value.length > 0)
|
|
613
613
|
|
|
614
614
|
// Add after other ref declarations
|
|
615
615
|
const search = ref('')
|
|
616
616
|
|
|
617
617
|
// Add the filteredRows computed property after the columns computed
|
|
618
618
|
const filteredRows = computed(() => {
|
|
619
|
-
if (!search.value) {return localRows.value}
|
|
619
|
+
if (!search.value) { return localRows.value }
|
|
620
620
|
|
|
621
621
|
const searchTerm = search.value.toLowerCase()
|
|
622
622
|
return localRows.value.filter((row) => {
|
|
623
623
|
// Check all values in the row, including hidden columns
|
|
624
624
|
return Object.values(row).some((value) => {
|
|
625
|
-
if (
|
|
625
|
+
if (value === null || value === undefined) { return false }
|
|
626
626
|
return String(value).toLowerCase().includes(searchTerm)
|
|
627
627
|
})
|
|
628
628
|
})
|
|
@@ -643,7 +643,7 @@ function handleResizeStart(e: MouseEvent, columnKey: string) {
|
|
|
643
643
|
|
|
644
644
|
// Find the column header element
|
|
645
645
|
const columnHeader = (e.target as HTMLElement).closest('th')
|
|
646
|
-
if (!columnHeader) {return}
|
|
646
|
+
if (!columnHeader) { return }
|
|
647
647
|
|
|
648
648
|
// Get the actual computed width of the column
|
|
649
649
|
const computedWidth = columnHeader.getBoundingClientRect().width
|
|
@@ -656,7 +656,7 @@ function handleResizeStart(e: MouseEvent, columnKey: string) {
|
|
|
656
656
|
}
|
|
657
657
|
|
|
658
658
|
function handleResizeMove(e: MouseEvent) {
|
|
659
|
-
if (!isResizing.value || !resizingColumn.value) {return}
|
|
659
|
+
if (!isResizing.value || !resizingColumn.value) { return }
|
|
660
660
|
|
|
661
661
|
e.preventDefault()
|
|
662
662
|
|
|
@@ -54,7 +54,7 @@ const getActualColumnIndex = (localIndex: number) => props.baseColumnIndex + loc
|
|
|
54
54
|
|
|
55
55
|
// Determines if a cell is selected
|
|
56
56
|
function isCellSelected(row: number, localColIndex: number): boolean {
|
|
57
|
-
if (!props.selectionStart || !props.selectionEnd) {return false}
|
|
57
|
+
if (!props.selectionStart || !props.selectionEnd) { return false }
|
|
58
58
|
|
|
59
59
|
const colIndex = getActualColumnIndex(localColIndex)
|
|
60
60
|
const startRow = Math.min(props.selectionStart.row, props.selectionEnd.row)
|
|
@@ -73,14 +73,14 @@ function isCellEditable(columnKey: string): boolean {
|
|
|
73
73
|
|
|
74
74
|
// Check if a cell is currently being edited
|
|
75
75
|
function isEditing(row: number, localColIndex: number): boolean {
|
|
76
|
-
if (!props.editingCell) {return false}
|
|
76
|
+
if (!props.editingCell) { return false }
|
|
77
77
|
const colIndex = getActualColumnIndex(localColIndex)
|
|
78
78
|
return props.editingCell.row === row && props.editingCell.col === colIndex
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// Format cell value based on column configuration
|
|
82
82
|
function formatCellValue(value: any, format?: ColumnConfig['format']): string {
|
|
83
|
-
if (
|
|
83
|
+
if (value === null || value === undefined) { return '' }
|
|
84
84
|
|
|
85
85
|
switch (format) {
|
|
86
86
|
case 'image':
|
|
@@ -116,8 +116,8 @@ const emit = defineEmits<{
|
|
|
116
116
|
|
|
117
117
|
defineSlots<{
|
|
118
118
|
'default'?: (props: { item: T, index: number, currentIndex: number }) => any
|
|
119
|
-
'prev-button'?: () => any
|
|
120
|
-
'next-button'?: () => any
|
|
119
|
+
'prev-button'?: (props: { prev: () => void }) => any
|
|
120
|
+
'next-button'?: (props: { next: () => void }) => any
|
|
121
121
|
'navigation'?: (props: {
|
|
122
122
|
items: T[]
|
|
123
123
|
currentIndex: number
|
|
@@ -434,12 +434,12 @@ defineExpose({
|
|
|
434
434
|
<!-- Default Navigation -->
|
|
435
435
|
<div v-if="navigation" class="swi-ctrl">
|
|
436
436
|
<div class="swi-prev hover" @click="handleSlideNav('prev')">
|
|
437
|
-
<slot name="prev-button">
|
|
437
|
+
<slot name="prev-button" :prev="() => handleSlideNav('prev')">
|
|
438
438
|
<Icon name="chevron_left" class="user-select-none hover z-99 color-primary" :size="2" />
|
|
439
439
|
</slot>
|
|
440
440
|
</div>
|
|
441
441
|
<div class="swi-next hover" @click="handleSlideNav('next')">
|
|
442
|
-
<slot name="next-button">
|
|
442
|
+
<slot name="next-button" :next="() => handleSlideNav('next')">
|
|
443
443
|
<Icon name="chevron_right" class="user-select-none hover z-99 color-primary" :size="2" />
|
|
444
444
|
</slot>
|
|
445
445
|
</div>
|