@bagelink/vue 1.6.47 → 1.6.51
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/Zoomer.vue.d.ts +0 -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/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/index.cjs +34 -25
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +6668 -5883
- package/dist/plugins/useToast.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -10
- package/src/components/AccordionItem.vue +11 -11
- 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 +20 -13
- 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 +9 -8
- 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/Zoomer.vue +165 -170
- 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/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/AppLayout.vue +2 -2
- package/src/components/layout/AppSidebar.vue +77 -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 +22 -22
- 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/useToast.ts +56 -51
- 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
|
@@ -130,7 +130,7 @@ const { renderField } = useSchemaField<any>({
|
|
|
130
130
|
mode: 'form',
|
|
131
131
|
getFormData: () => formData.value,
|
|
132
132
|
onUpdateModelValue: (field: Field<any>, value: any) => {
|
|
133
|
-
if (!field.id) {return}
|
|
133
|
+
if (!field.id) { return }
|
|
134
134
|
|
|
135
135
|
if (field.id.includes('.')) {
|
|
136
136
|
const [parentId, childId] = field.id.split('.')
|
|
@@ -145,16 +145,16 @@ const { renderField } = useSchemaField<any>({
|
|
|
145
145
|
})
|
|
146
146
|
|
|
147
147
|
function getUniqueSourceValues(fieldId: string): any[] {
|
|
148
|
-
if (!fieldMapping[fieldId] || !fileData.value ||
|
|
148
|
+
if (!fieldMapping[fieldId] || !fileData.value || fileData.value.length === 0) {
|
|
149
149
|
return []
|
|
150
150
|
}
|
|
151
151
|
const allValues = fileData.value
|
|
152
152
|
.map(row => row[fieldMapping[fieldId]])
|
|
153
|
-
.filter(value => value !== undefined &&
|
|
153
|
+
.filter(value => value !== undefined && value !== null && value !== '')
|
|
154
154
|
const uniqueValues = [...new Set(allValues)]
|
|
155
155
|
|
|
156
156
|
return uniqueValues.filter((value) => {
|
|
157
|
-
if (!transformations[fieldId] ||
|
|
157
|
+
if (!transformations[fieldId] || transformations[fieldId].length === 0) {
|
|
158
158
|
return true
|
|
159
159
|
}
|
|
160
160
|
return !transformations[fieldId].some(t => t.sourceValue == value || t.sourceValue === value.toString()
|
|
@@ -177,17 +177,17 @@ const sourceValueOptions = computed(() => {
|
|
|
177
177
|
})
|
|
178
178
|
|
|
179
179
|
function findMatchingTargetValue(sourceValue: string, options: Option[]): string | null {
|
|
180
|
-
if (!sourceValue || !options || !Array.isArray(options) ||
|
|
180
|
+
if (!sourceValue || !options || !Array.isArray(options) || options.length === 0) { return null }
|
|
181
181
|
const lowerSourceValue = String(sourceValue).toLowerCase().trim()
|
|
182
182
|
const exactMatch = options.find((option) => {
|
|
183
|
-
const optionObj = 'object'
|
|
184
|
-
if (!optionObj) {return false}
|
|
183
|
+
const optionObj = typeof option === 'object' && option !== null ? option : { value: String(option), label: String(option) }
|
|
184
|
+
if (!optionObj) { return false }
|
|
185
185
|
const optionLabel = `${optionObj.label}`.toLowerCase().trim()
|
|
186
186
|
return optionLabel === lowerSourceValue
|
|
187
187
|
})
|
|
188
188
|
|
|
189
189
|
if (exactMatch) {
|
|
190
|
-
const optionObj = 'object'
|
|
190
|
+
const optionObj = typeof exactMatch === 'object' && exactMatch !== null
|
|
191
191
|
? exactMatch
|
|
192
192
|
: { value: String(exactMatch), label: String(exactMatch) }
|
|
193
193
|
return String(optionObj.value)
|
|
@@ -195,8 +195,8 @@ function findMatchingTargetValue(sourceValue: string, options: Option[]): string
|
|
|
195
195
|
|
|
196
196
|
// Try more flexible matching if exact match fails
|
|
197
197
|
const fuzzyMatch = options.find((option) => {
|
|
198
|
-
const optionObj = 'object'
|
|
199
|
-
if (!optionObj ||
|
|
198
|
+
const optionObj = typeof option === 'object' && option !== null ? option : { value: String(option), label: String(option) }
|
|
199
|
+
if (!optionObj || typeof optionObj.label !== 'string') { return false }
|
|
200
200
|
|
|
201
201
|
const optionLabel = `${optionObj.label}`.toLowerCase().trim()
|
|
202
202
|
|
|
@@ -204,7 +204,7 @@ function findMatchingTargetValue(sourceValue: string, options: Option[]): string
|
|
|
204
204
|
})
|
|
205
205
|
|
|
206
206
|
if (fuzzyMatch) {
|
|
207
|
-
const optionObj = 'object'
|
|
207
|
+
const optionObj = typeof fuzzyMatch === 'object' && fuzzyMatch !== null
|
|
208
208
|
? fuzzyMatch
|
|
209
209
|
: { value: String(fuzzyMatch), label: String(fuzzyMatch) }
|
|
210
210
|
return String(optionObj.value)
|
|
@@ -231,7 +231,7 @@ function addTransformation(fieldId: string) {
|
|
|
231
231
|
const existingIndex = transformations[fieldId].findIndex(t => t.sourceValue === selectedSourceValue.value
|
|
232
232
|
)
|
|
233
233
|
|
|
234
|
-
if (
|
|
234
|
+
if (existingIndex >= 0) {
|
|
235
235
|
transformations[fieldId][existingIndex].targetValue = selectedTargetValue.value
|
|
236
236
|
} else {
|
|
237
237
|
transformations[fieldId].push({
|
|
@@ -246,7 +246,7 @@ function addTransformation(fieldId: string) {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
function getAllFields(schema: any[]): any[] {
|
|
249
|
-
if (!schema || !Array.isArray(schema)) {return []}
|
|
249
|
+
if (!schema || !Array.isArray(schema)) { return [] }
|
|
250
250
|
|
|
251
251
|
const allFields: any[] = []
|
|
252
252
|
const seenIds = new Set() // Keep track of field IDs we've already added
|
|
@@ -262,7 +262,7 @@ function getAllFields(schema: any[]): any[] {
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
// Extract options if they exist in attrs
|
|
265
|
-
if (field.attrs && field.attrs.options &&
|
|
265
|
+
if (field.attrs && field.attrs.options && field.attrs.options.length > 0) {
|
|
266
266
|
field.options = field.attrs.options
|
|
267
267
|
}
|
|
268
268
|
|
|
@@ -279,7 +279,7 @@ function getAllFields(schema: any[]): any[] {
|
|
|
279
279
|
if (item && item.children && Array.isArray(item.children)) {
|
|
280
280
|
item.children.forEach((child: any) => {
|
|
281
281
|
if (child && child.id && child.label) {
|
|
282
|
-
if ('array'
|
|
282
|
+
if (child.$el === 'array' && child.attrs && child.attrs.schema) {
|
|
283
283
|
addFieldIfNew(child)
|
|
284
284
|
if (Array.isArray(child.attrs.schema)) {
|
|
285
285
|
child.attrs.schema.forEach((schemaItem: SchemaItem) => {
|
|
@@ -318,9 +318,9 @@ function isFieldRequired(field: any): boolean {
|
|
|
318
318
|
return false
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
return (field.attrs &&
|
|
322
|
-
|| (
|
|
323
|
-
|| (field.attrs && field.attrs.attrs &&
|
|
321
|
+
return (field.attrs && field.attrs.required === true)
|
|
322
|
+
|| (field.required === true)
|
|
323
|
+
|| (field.attrs && field.attrs.attrs && field.attrs.attrs.required === true)
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
function getFieldDescription(field: any): { description: string, isConditional: boolean } {
|
|
@@ -353,7 +353,7 @@ async function parseFile(file: File) {
|
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
async function loadSheetData() {
|
|
356
|
-
if (!file.value || !selectedSheet.value) {return}
|
|
356
|
+
if (!file.value || !selectedSheet.value) { return }
|
|
357
357
|
isLoading.value = true
|
|
358
358
|
try {
|
|
359
359
|
const { headers, data } = await readSheetData(file.value, selectedSheet.value, hasHeaders.value)
|
|
@@ -376,7 +376,7 @@ function checkArrayFieldConflicts() {
|
|
|
376
376
|
Object.keys(fieldMapping).forEach((fieldId: string) => {
|
|
377
377
|
const field = schemaFields.value.find(f => f.id === fieldId)
|
|
378
378
|
if (field) {
|
|
379
|
-
if ('array'
|
|
379
|
+
if (field.$el === 'array') {
|
|
380
380
|
mappedArrayParents.add(field.id)
|
|
381
381
|
} else if (field.isArrayField && field.parentField) {
|
|
382
382
|
if (!mappedArrayChildren.has(field.parentField)) {
|
|
@@ -396,7 +396,7 @@ function checkArrayFieldConflicts() {
|
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
for (const [parentId, childIds] of mappedArrayChildren.entries()) {
|
|
399
|
-
if (
|
|
399
|
+
if (childIds.size > 0) {
|
|
400
400
|
const parentField = schemaFields.value.find(f => f.id === parentId)
|
|
401
401
|
if (parentField) {
|
|
402
402
|
parentField.disabled = true
|
|
@@ -417,7 +417,7 @@ function resetMapping() {
|
|
|
417
417
|
})
|
|
418
418
|
|
|
419
419
|
// Try to auto-map fields based on similar names
|
|
420
|
-
if (
|
|
420
|
+
if (fileHeaders.value.length > 0) {
|
|
421
421
|
schemaFields.value.forEach((field: any) => {
|
|
422
422
|
// Format variations of field id and label for comparison
|
|
423
423
|
const fieldIdCamel = formatString(field.id, 'camel')
|
|
@@ -462,22 +462,22 @@ function resetMapping() {
|
|
|
462
462
|
}
|
|
463
463
|
|
|
464
464
|
function checkMappingComplete() {
|
|
465
|
-
if (!file.value || (
|
|
465
|
+
if (!file.value || (Object.keys(fieldMapping).length === 0 && Object.keys(defaultValues).length === 0)) {
|
|
466
466
|
mappingComplete.value = false
|
|
467
467
|
return
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
const requiredFields = schemaFields.value.filter((field) => {
|
|
471
|
-
if (field.isArrayField && field.parentField) {return false}
|
|
471
|
+
if (field.isArrayField && field.parentField) { return false }
|
|
472
472
|
|
|
473
|
-
return (field.attrs &&
|
|
474
|
-
|| (
|
|
475
|
-
|| (field.attrs && field.attrs.attrs &&
|
|
473
|
+
return (field.attrs && field.attrs.required === true)
|
|
474
|
+
|| (field.required === true)
|
|
475
|
+
|| (field.attrs && field.attrs.attrs && field.attrs.attrs.required === true)
|
|
476
476
|
})
|
|
477
477
|
|
|
478
|
-
if (
|
|
478
|
+
if (requiredFields.length === 0) {
|
|
479
479
|
mappingComplete.value = Object.keys(fieldMapping).some(key => !!fieldMapping[key])
|
|
480
|
-
||
|
|
480
|
+
|| Object.keys(defaultValues).length > 0
|
|
481
481
|
return
|
|
482
482
|
}
|
|
483
483
|
mappingComplete.value = requiredFields.every(field => !!fieldMapping[field.id] || hasDefaultValue(field.id))
|
|
@@ -492,13 +492,13 @@ function showPreview() {
|
|
|
492
492
|
const mappedRow: MappedRow = {}
|
|
493
493
|
|
|
494
494
|
schemaFields.value.forEach((field) => {
|
|
495
|
-
if (field.isArrayField || 'array'
|
|
495
|
+
if (field.isArrayField || field.$el === 'array') { return }
|
|
496
496
|
let value: any = null
|
|
497
497
|
let useDefault = false
|
|
498
498
|
|
|
499
499
|
if (fieldMapping[field.id] && sourceRow[fieldMapping[field.id]] !== undefined) {
|
|
500
500
|
value = sourceRow[fieldMapping[field.id]]
|
|
501
|
-
if (
|
|
501
|
+
if (value === '' && defaultValues[field.id] !== undefined) {
|
|
502
502
|
value = defaultValues[field.id]
|
|
503
503
|
useDefault = true
|
|
504
504
|
}
|
|
@@ -507,9 +507,9 @@ function showPreview() {
|
|
|
507
507
|
useDefault = true
|
|
508
508
|
}
|
|
509
509
|
|
|
510
|
-
if (
|
|
510
|
+
if (value === null) { return }
|
|
511
511
|
|
|
512
|
-
if (!useDefault && transformations[field.id] &&
|
|
512
|
+
if (!useDefault && transformations[field.id] && transformations[field.id].length > 0) {
|
|
513
513
|
const transform = transformations[field.id].find(t => t.sourceValue == value || t.sourceValue === String(value)
|
|
514
514
|
)
|
|
515
515
|
if (transform) {
|
|
@@ -546,14 +546,14 @@ function showPreview() {
|
|
|
546
546
|
|
|
547
547
|
arrayChildFields.forEach((childField) => {
|
|
548
548
|
const [parentId, childId] = childField.id.split('.')
|
|
549
|
-
if (!parentId || !childId) {return}
|
|
549
|
+
if (!parentId || !childId) { return }
|
|
550
550
|
|
|
551
551
|
let value: any = null
|
|
552
552
|
let useDefault = false
|
|
553
553
|
|
|
554
554
|
if (fieldMapping[childField.id] && sourceRow[fieldMapping[childField.id]] !== undefined) {
|
|
555
555
|
value = sourceRow[fieldMapping[childField.id]]
|
|
556
|
-
if (
|
|
556
|
+
if (value === '' && defaultValues[childField.id] !== undefined) {
|
|
557
557
|
value = defaultValues[childField.id]
|
|
558
558
|
useDefault = true
|
|
559
559
|
}
|
|
@@ -562,7 +562,7 @@ function showPreview() {
|
|
|
562
562
|
useDefault = true
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
-
if (
|
|
565
|
+
if (value === null) {
|
|
566
566
|
return
|
|
567
567
|
}
|
|
568
568
|
|
|
@@ -570,7 +570,7 @@ function showPreview() {
|
|
|
570
570
|
mappedRow[parentId] = []
|
|
571
571
|
}
|
|
572
572
|
|
|
573
|
-
if (!useDefault && transformations[childField.id] &&
|
|
573
|
+
if (!useDefault && transformations[childField.id] && transformations[childField.id].length > 0) {
|
|
574
574
|
const transform = transformations[childField.id].find(t => t.sourceValue == value || t.sourceValue === String(value)
|
|
575
575
|
)
|
|
576
576
|
if (transform) {
|
|
@@ -592,7 +592,7 @@ function showPreview() {
|
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
const parentKeyValue = sourceRow[parentKeyField[fieldId]]
|
|
595
|
-
if (!parentKeyValue) {return}
|
|
595
|
+
if (!parentKeyValue) { return }
|
|
596
596
|
|
|
597
597
|
if (!mappedRow[fieldId]) {
|
|
598
598
|
mappedRow[fieldId] = []
|
|
@@ -607,7 +607,7 @@ function showPreview() {
|
|
|
607
607
|
|
|
608
608
|
if (selectedRelationField.value?.attrs?.schema) {
|
|
609
609
|
selectedRelationField.value.attrs.schema.forEach((schemaItem: SchemaItem) => {
|
|
610
|
-
if (!schemaItem.id) {return}
|
|
610
|
+
if (!schemaItem.id) { return }
|
|
611
611
|
|
|
612
612
|
let value: any = null
|
|
613
613
|
let useDefault = false
|
|
@@ -615,7 +615,7 @@ function showPreview() {
|
|
|
615
615
|
if (relatedFileMappings[fieldId][schemaItem.id]
|
|
616
616
|
&& matchingRow[relatedFileMappings[fieldId][schemaItem.id]] !== undefined) {
|
|
617
617
|
value = matchingRow[relatedFileMappings[fieldId][schemaItem.id]]
|
|
618
|
-
if (
|
|
618
|
+
if (value === '' && relatedDefaultValues[fieldId][schemaItem.id] !== undefined) {
|
|
619
619
|
value = relatedDefaultValues[fieldId][schemaItem.id]
|
|
620
620
|
useDefault = true
|
|
621
621
|
}
|
|
@@ -624,11 +624,11 @@ function showPreview() {
|
|
|
624
624
|
useDefault = true
|
|
625
625
|
}
|
|
626
626
|
|
|
627
|
-
if (
|
|
627
|
+
if (value === null) { return }
|
|
628
628
|
|
|
629
629
|
if (!useDefault
|
|
630
630
|
&& relatedTransformations[fieldId][schemaItem.id]
|
|
631
|
-
&&
|
|
631
|
+
&& relatedTransformations[fieldId][schemaItem.id].length > 0) {
|
|
632
632
|
const transform = relatedTransformations[fieldId][schemaItem.id].find(t => t.sourceValue == value || t.sourceValue === String(value)
|
|
633
633
|
)
|
|
634
634
|
if (transform) {
|
|
@@ -644,16 +644,16 @@ function showPreview() {
|
|
|
644
644
|
})
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
if (
|
|
647
|
+
if (Object.keys(mappedItem).length > 0) {
|
|
648
648
|
mappedRow[fieldId].push(mappedItem)
|
|
649
649
|
}
|
|
650
650
|
})
|
|
651
651
|
})
|
|
652
652
|
|
|
653
653
|
const hasData = Object.values(mappedRow).some((value) => {
|
|
654
|
-
if (
|
|
655
|
-
if (
|
|
656
|
-
if (Array.isArray(value) &&
|
|
654
|
+
if (value === null || value === undefined) { return false }
|
|
655
|
+
if (value === '') { return false }
|
|
656
|
+
if (Array.isArray(value) && value.length === 0) { return false }
|
|
657
657
|
return true
|
|
658
658
|
})
|
|
659
659
|
|
|
@@ -669,7 +669,7 @@ function showPreview() {
|
|
|
669
669
|
function createSpreadsheetColumns() {
|
|
670
670
|
return schemaFields.value
|
|
671
671
|
.filter((field) => {
|
|
672
|
-
return 'array'
|
|
672
|
+
return field.$el !== 'array'
|
|
673
673
|
})
|
|
674
674
|
.map((field) => {
|
|
675
675
|
return {
|
|
@@ -682,12 +682,12 @@ function createSpreadsheetColumns() {
|
|
|
682
682
|
|
|
683
683
|
function formatArrayChildValue(value: any, row: any, fieldId: string): string {
|
|
684
684
|
const field = schemaFields.value.find(f => f.id === fieldId)
|
|
685
|
-
if (!field || !field.isArrayField || !field.parentField) {return value}
|
|
685
|
+
if (!field || !field.isArrayField || !field.parentField) { return value }
|
|
686
686
|
|
|
687
687
|
const [parentId, childId] = fieldId.split('.')
|
|
688
688
|
const parentArray = row[parentId]
|
|
689
689
|
|
|
690
|
-
if (Array.isArray(parentArray) &&
|
|
690
|
+
if (Array.isArray(parentArray) && parentArray.length > 0) {
|
|
691
691
|
return parentArray
|
|
692
692
|
.map(item => item[childId])
|
|
693
693
|
.filter(val => val !== undefined)
|
|
@@ -717,7 +717,7 @@ function updateFieldMapping(fieldId: string, value: string) {
|
|
|
717
717
|
fieldMapping[fieldId] = value
|
|
718
718
|
const field = schemaFields.value.find(f => f.id === fieldId)
|
|
719
719
|
if (field) {
|
|
720
|
-
if ('array'
|
|
720
|
+
if (field.$el === 'array') {
|
|
721
721
|
const childFields = schemaFields.value.filter(f => f.parentField === field.id)
|
|
722
722
|
childFields.forEach((child) => {
|
|
723
723
|
child.disabled = true
|
|
@@ -747,7 +747,7 @@ function handleSelectChange(event: Event, fieldId: string) {
|
|
|
747
747
|
|
|
748
748
|
async function handleFilesUploaded(files: FileList) {
|
|
749
749
|
file.value = files[0]
|
|
750
|
-
if (!file.value) {return}
|
|
750
|
+
if (!file.value) { return }
|
|
751
751
|
isLoading.value = true
|
|
752
752
|
|
|
753
753
|
try {
|
|
@@ -767,8 +767,8 @@ watchEffect(() => {
|
|
|
767
767
|
|
|
768
768
|
function hasDefaultValue(fieldId: string): boolean {
|
|
769
769
|
return defaultValues[fieldId] !== undefined
|
|
770
|
-
&&
|
|
771
|
-
&&
|
|
770
|
+
&& defaultValues[fieldId] !== null
|
|
771
|
+
&& defaultValues[fieldId] !== ''
|
|
772
772
|
}
|
|
773
773
|
|
|
774
774
|
function openTransformDialog(field: SchemaItem) {
|
|
@@ -803,14 +803,14 @@ function openRelatedDialog(field: SchemaItem) {
|
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
async function processRelatedFile(fieldId: string, files: File[] | FileList) {
|
|
806
|
-
if (!files) {return}
|
|
806
|
+
if (!files) { return }
|
|
807
807
|
const file = files[0]
|
|
808
808
|
|
|
809
809
|
relatedFiles[fieldId] = file
|
|
810
810
|
|
|
811
811
|
try {
|
|
812
812
|
const sheets = await getSheetNames(file)
|
|
813
|
-
const selectedSheet =
|
|
813
|
+
const selectedSheet = sheets.length > 0 ? sheets[0] : ''
|
|
814
814
|
|
|
815
815
|
const { data } = await readSheetData(file, selectedSheet, true)
|
|
816
816
|
relatedFileData[fieldId] = data
|
|
@@ -833,7 +833,7 @@ function autoPopulateTransformations(fieldId: string) {
|
|
|
833
833
|
|
|
834
834
|
let fieldOptions = field.options || (field.attrs && field.attrs.options)
|
|
835
835
|
|
|
836
|
-
if (!fieldMapping[fieldId] || !fileData.value ||
|
|
836
|
+
if (!fieldMapping[fieldId] || !fileData.value || fileData.value.length === 0) {
|
|
837
837
|
console.warn('No data or mapping found for field:', fieldId)
|
|
838
838
|
return
|
|
839
839
|
}
|
|
@@ -865,7 +865,7 @@ function autoPopulateTransformations(fieldId: string) {
|
|
|
865
865
|
const existingIndex = transformations[fieldId].findIndex(t => t.sourceValue === strSourceValue
|
|
866
866
|
)
|
|
867
867
|
|
|
868
|
-
if (
|
|
868
|
+
if (existingIndex >= 0) {
|
|
869
869
|
transformations[fieldId][existingIndex].targetValue = matchedValue
|
|
870
870
|
} else {
|
|
871
871
|
transformations[fieldId].push({
|
|
@@ -881,7 +881,7 @@ function autoPopulateTransformations(fieldId: string) {
|
|
|
881
881
|
}
|
|
882
882
|
})
|
|
883
883
|
|
|
884
|
-
if (
|
|
884
|
+
if (matchCount === 0) {
|
|
885
885
|
alert(`No automatic matches found. Try creating transformations manually.`)
|
|
886
886
|
} else {
|
|
887
887
|
alert(`Automatically created ${matchCount} transformations by matching source values to target labels.\n\n${unmatchedValues.length} values could not be automatically matched.`)
|
|
@@ -910,7 +910,7 @@ function detectDateFormat(value: string): RegExp | null {
|
|
|
910
910
|
}
|
|
911
911
|
|
|
912
912
|
function parseDate(value: string): Date | null {
|
|
913
|
-
if (!value) {return null}
|
|
913
|
+
if (!value) { return null }
|
|
914
914
|
|
|
915
915
|
const isoDate = new Date(value)
|
|
916
916
|
if (!Number.isNaN(isoDate.getTime())) {
|
|
@@ -921,7 +921,7 @@ function parseDate(value: string): Date | null {
|
|
|
921
921
|
if (/^\d{2}\/\d{2}\/\d{4}$/.test(value)) {
|
|
922
922
|
const [month, day, year] = value.split('/').map(Number)
|
|
923
923
|
return new Date(year, month - 1, day)
|
|
924
|
-
}if (/^\d{2}\.\d{2}\.\d{4}$/.test(value)) {
|
|
924
|
+
} if (/^\d{2}\.\d{2}\.\d{4}$/.test(value)) {
|
|
925
925
|
const [day, month, year] = value.split('.').map(Number)
|
|
926
926
|
return new Date(year, month - 1, day)
|
|
927
927
|
} else if (/^\d{1,2}\s[a-z]{3,9}\s\d{4}$/i.test(value)) {
|
|
@@ -933,7 +933,7 @@ function parseDate(value: string): Date | null {
|
|
|
933
933
|
}
|
|
934
934
|
|
|
935
935
|
function convertValueByType(value: any, dataType: string): any {
|
|
936
|
-
if (
|
|
936
|
+
if (value === null || value === undefined || value === '') {
|
|
937
937
|
return null
|
|
938
938
|
}
|
|
939
939
|
try {
|
|
@@ -947,11 +947,11 @@ function convertValueByType(value: any, dataType: string): any {
|
|
|
947
947
|
}
|
|
948
948
|
|
|
949
949
|
case DATA_TYPES.BOOLEAN:
|
|
950
|
-
if ('boolean'
|
|
951
|
-
if ('string'
|
|
950
|
+
if (typeof value === 'boolean') { return value }
|
|
951
|
+
if (typeof value === 'string') {
|
|
952
952
|
const lowercased = value.toLowerCase().trim()
|
|
953
|
-
if (['true', 'yes', '1', 'on'].includes(lowercased)) {return true}
|
|
954
|
-
if (['false', 'no', '0', 'off'].includes(lowercased)) {return false}
|
|
953
|
+
if (['true', 'yes', '1', 'on'].includes(lowercased)) { return true }
|
|
954
|
+
if (['false', 'no', '0', 'off'].includes(lowercased)) { return false }
|
|
955
955
|
}
|
|
956
956
|
return Boolean(value)
|
|
957
957
|
case DATA_TYPES.DATE:
|
|
@@ -960,7 +960,7 @@ function convertValueByType(value: any, dataType: string): any {
|
|
|
960
960
|
const date = excelSerialDateToJSDate(value)
|
|
961
961
|
return formatDate(date, dataType === DATA_TYPES.DATETIME)
|
|
962
962
|
}
|
|
963
|
-
if ('string'
|
|
963
|
+
if (typeof value === 'string') {
|
|
964
964
|
const dateObj = parseDate(value)
|
|
965
965
|
if (dateObj) {
|
|
966
966
|
return formatDate(dateObj, dataType === DATA_TYPES.DATETIME)
|
|
@@ -982,23 +982,23 @@ function convertValueByType(value: any, dataType: string): any {
|
|
|
982
982
|
}
|
|
983
983
|
|
|
984
984
|
function detectDataType(value: any): string {
|
|
985
|
-
if (
|
|
985
|
+
if (value === null || value === undefined) {
|
|
986
986
|
return DATA_TYPES.STRING
|
|
987
987
|
}
|
|
988
|
-
if ('number'
|
|
988
|
+
if (typeof value === 'number' || (typeof value === 'string' && !Number.isNaN(Number(value)))) {
|
|
989
989
|
if (isExcelSerialDate(Number(value))) {
|
|
990
990
|
return DATA_TYPES.DATE
|
|
991
991
|
}
|
|
992
992
|
return DATA_TYPES.NUMBER
|
|
993
993
|
}
|
|
994
|
-
if ('boolean'
|
|
994
|
+
if (typeof value === 'boolean' || (typeof value === 'string' && ['true', 'false', 'yes', 'no'].includes(value.toLowerCase()))) {
|
|
995
995
|
return DATA_TYPES.BOOLEAN
|
|
996
996
|
}
|
|
997
997
|
if (value instanceof Date) {
|
|
998
998
|
return DATA_TYPES.DATETIME
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
|
-
if ('string'
|
|
1001
|
+
if (typeof value === 'string') {
|
|
1002
1002
|
if (detectDateFormat(value) || !Number.isNaN(new Date(value).getTime())) {
|
|
1003
1003
|
return DATA_TYPES.DATE
|
|
1004
1004
|
}
|
|
@@ -1012,9 +1012,9 @@ function guessDataTypes(): void {
|
|
|
1012
1012
|
const sampleValues = fileData.value
|
|
1013
1013
|
.slice(0, 5)
|
|
1014
1014
|
.map(row => row[fieldMapping[field.id]])
|
|
1015
|
-
.filter(value => value !== undefined &&
|
|
1015
|
+
.filter(value => value !== undefined && value !== null && value !== '')
|
|
1016
1016
|
|
|
1017
|
-
if (
|
|
1017
|
+
if (sampleValues.length > 0) {
|
|
1018
1018
|
const types = sampleValues.map(detectDataType)
|
|
1019
1019
|
const typeCount: Record<string, number> = {}
|
|
1020
1020
|
|
|
@@ -1077,19 +1077,19 @@ function openRelatedTransformDialog(parentId: string, field: SchemaItem) {
|
|
|
1077
1077
|
function getRelatedUniqueSourceValues(parentId: string, fieldId: string): any[] {
|
|
1078
1078
|
if (!relatedFileMappings[parentId][fieldId]
|
|
1079
1079
|
|| !relatedFileData[parentId]
|
|
1080
|
-
||
|
|
1080
|
+
|| relatedFileData[parentId].length === 0) {
|
|
1081
1081
|
return []
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
1084
|
const allValues = relatedFileData[parentId]
|
|
1085
1085
|
.map(row => row[relatedFileMappings[parentId][fieldId]])
|
|
1086
|
-
.filter(value => value !== undefined &&
|
|
1086
|
+
.filter(value => value !== undefined && value !== null && value !== '')
|
|
1087
1087
|
|
|
1088
1088
|
const uniqueValues = [...new Set(allValues)]
|
|
1089
1089
|
|
|
1090
1090
|
return uniqueValues.filter((value) => {
|
|
1091
1091
|
if (!relatedTransformations[parentId][fieldId]
|
|
1092
|
-
||
|
|
1092
|
+
|| relatedTransformations[parentId][fieldId].length === 0) {
|
|
1093
1093
|
return true
|
|
1094
1094
|
}
|
|
1095
1095
|
return !relatedTransformations[parentId][fieldId].some(t => t.sourceValue == value || t.sourceValue === value.toString()
|
|
@@ -1127,7 +1127,7 @@ function addRelatedTransformation(parentId: string, fieldId: string) {
|
|
|
1127
1127
|
t => t.sourceValue === selectedRelatedSourceValue.value
|
|
1128
1128
|
)
|
|
1129
1129
|
|
|
1130
|
-
if (
|
|
1130
|
+
if (existingIndex >= 0) {
|
|
1131
1131
|
relatedTransformations[parentId][fieldId][existingIndex].targetValue = selectedRelatedTargetValue.value
|
|
1132
1132
|
} else {
|
|
1133
1133
|
relatedTransformations[parentId][fieldId].push({
|
|
@@ -1160,7 +1160,7 @@ function autoPopulateRelatedTransformations(parentId: string, fieldId: string) {
|
|
|
1160
1160
|
|
|
1161
1161
|
if (!relatedFileMappings[parentId][fieldId]
|
|
1162
1162
|
|| !relatedFileData[parentId]
|
|
1163
|
-
||
|
|
1163
|
+
|| relatedFileData[parentId].length === 0) {
|
|
1164
1164
|
console.warn('No data or mapping found for related field:', fieldId)
|
|
1165
1165
|
return
|
|
1166
1166
|
}
|
|
@@ -1198,7 +1198,7 @@ function autoPopulateRelatedTransformations(parentId: string, fieldId: string) {
|
|
|
1198
1198
|
t => t.sourceValue === strSourceValue
|
|
1199
1199
|
)
|
|
1200
1200
|
|
|
1201
|
-
if (
|
|
1201
|
+
if (existingIndex >= 0) {
|
|
1202
1202
|
// Update existing transformation
|
|
1203
1203
|
relatedTransformations[parentId][fieldId][existingIndex].targetValue = matchedValue
|
|
1204
1204
|
} else {
|
|
@@ -1215,7 +1215,7 @@ function autoPopulateRelatedTransformations(parentId: string, fieldId: string) {
|
|
|
1215
1215
|
unmatchedValues.push(strSourceValue)
|
|
1216
1216
|
}
|
|
1217
1217
|
})
|
|
1218
|
-
if (
|
|
1218
|
+
if (matchCount === 0) {
|
|
1219
1219
|
alert(`No automatic matches found. Try creating transformations manually.`)
|
|
1220
1220
|
} else {
|
|
1221
1221
|
alert(`Automatically created ${matchCount} transformations by matching source values to target labels.\n\n${unmatchedValues.length} values could not be automatically matched.`)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import type { IconType } from '@bagelink/vue'
|
|
3
3
|
import { Avatar, Icon } from '@bagelink/vue'
|
|
4
|
+
import { computed } from 'vue'
|
|
4
5
|
|
|
5
6
|
const props = withDefaults(
|
|
6
7
|
defineProps<{
|
|
@@ -30,25 +31,25 @@ const props = withDefaults(
|
|
|
30
31
|
}
|
|
31
32
|
)
|
|
32
33
|
|
|
33
|
-
const isComponent =
|
|
34
|
-
if (props.to) { return 'router-link' }
|
|
35
|
-
if (props.href) { return 'a' }
|
|
36
|
-
if (props.onClick) { return 'button' }
|
|
34
|
+
const isComponent = computed(() => {
|
|
35
|
+
if (props.to !== undefined && props.to !== '') { return 'router-link' }
|
|
36
|
+
if (props.href !== undefined && props.href !== '') { return 'a' }
|
|
37
|
+
if (props.onClick !== undefined) { return 'button' }
|
|
37
38
|
return 'div'
|
|
38
39
|
})
|
|
39
40
|
|
|
40
|
-
const isClickable =
|
|
41
|
-
return props.to || props.href || props.onClick
|
|
41
|
+
const isClickable = computed(() => {
|
|
42
|
+
return (props.to !== undefined && props.to !== '') || (props.href !== undefined && props.href !== '') || (props.onClick !== undefined)
|
|
42
43
|
})
|
|
43
44
|
|
|
44
|
-
const bind =
|
|
45
|
+
const bind = computed(() => {
|
|
45
46
|
const obj: { [key: string]: any } = {}
|
|
46
|
-
if (props.to) { obj.to = props.to }
|
|
47
|
-
else if (props.href) { obj.href = props.href }
|
|
48
|
-
if (props.target && (props.to || props.href)) { obj.target = props.target }
|
|
47
|
+
if (props.to !== undefined && props.to !== '') { obj.to = props.to }
|
|
48
|
+
else if (props.href !== undefined && props.href !== '') { obj.href = props.href }
|
|
49
|
+
if (props.target !== undefined && props.target !== undefined && ((props.to !== undefined && props.to !== '') || (props.href !== undefined && props.href !== ''))) { obj.target = props.target }
|
|
49
50
|
|
|
50
51
|
obj.class = {
|
|
51
|
-
'notClickable': !(props.to || props.onClick),
|
|
52
|
+
'notClickable': !((props.to !== undefined && props.to !== '') || (props.onClick !== undefined)),
|
|
52
53
|
'no-border-list': props.flat,
|
|
53
54
|
}
|
|
54
55
|
if (props.disabled) { obj.disabled = true }
|
|
@@ -80,7 +81,10 @@ const bind = $computed(() => {
|
|
|
80
81
|
{{ title }}
|
|
81
82
|
<slot />
|
|
82
83
|
</p>
|
|
83
|
-
<p
|
|
84
|
+
<p
|
|
85
|
+
v-if="subtitle" class="txt12 m-0 m-0 py-0 ps-0 pe-1-5 opacity-7 me-2"
|
|
86
|
+
:class="{ 'ellipsis-1': ellipsis }"
|
|
87
|
+
>
|
|
84
88
|
{{ subtitle }}
|
|
85
89
|
<slot name="subtitle" />
|
|
86
90
|
</p>
|
|
@@ -89,7 +93,10 @@ const bind = $computed(() => {
|
|
|
89
93
|
</component>
|
|
90
94
|
<slot name="end">
|
|
91
95
|
<Icon v-if="iconEnd" :icon="iconEnd" class="transition-400" />
|
|
92
|
-
<p
|
|
96
|
+
<p
|
|
97
|
+
v-if="end" class="txt12 m-0 py-0 ps-0 pe-1-5 opacity-7 " :class="{ 'ellipsis-1': ellipsis }"
|
|
98
|
+
v-text="end"
|
|
99
|
+
/>
|
|
93
100
|
</slot>
|
|
94
101
|
</div>
|
|
95
102
|
</template>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { SizeUnit, SizeType } from '../types/BtnOptions'
|
|
3
|
+
import { computed } from 'vue'
|
|
3
4
|
import { standardSize } from '../utils/sizeParsing'
|
|
4
5
|
|
|
5
6
|
type LoadingType = 'ring' | 'ellipsis' | 'bar'
|
|
@@ -14,21 +15,21 @@ const { type: theme = 'ring', size = 50, thickness, duration = 1.2, color, progr
|
|
|
14
15
|
}>()
|
|
15
16
|
|
|
16
17
|
// Computed Values
|
|
17
|
-
const computedSize =
|
|
18
|
-
const animationDuration =
|
|
19
|
-
const computedBorder =
|
|
20
|
-
const borderValue = thickness ?? Math.max(Number.parseInt(computedSize, 10) / 9, 2)
|
|
18
|
+
const computedSize = computed(() => standardSize(size))
|
|
19
|
+
const animationDuration = computed(() => `${duration}s`)
|
|
20
|
+
const computedBorder = computed(() => {
|
|
21
|
+
const borderValue = thickness ?? Math.max(Number.parseInt(computedSize.value, 10) / 9, 2)
|
|
21
22
|
return standardSize(borderValue)
|
|
22
23
|
})
|
|
23
24
|
|
|
24
25
|
// SVG progress calculations
|
|
25
|
-
const svgStrokeWidth =
|
|
26
|
-
const borderNumeric = Number.parseFloat(computedBorder)
|
|
27
|
-
const sizeNumeric = Number.parseFloat(computedSize)
|
|
26
|
+
const svgStrokeWidth = computed(() => {
|
|
27
|
+
const borderNumeric = Number.parseFloat(computedBorder.value)
|
|
28
|
+
const sizeNumeric = Number.parseFloat(computedSize.value)
|
|
28
29
|
return Math.round((borderNumeric / sizeNumeric) * 100) * 0.9
|
|
29
30
|
})
|
|
30
|
-
const svgRadius =
|
|
31
|
-
const svgCircumference =
|
|
31
|
+
const svgRadius = computed(() => 50 - (svgStrokeWidth.value / 2))
|
|
32
|
+
const svgCircumference = computed(() => Math.PI * 2 * svgRadius.value)
|
|
32
33
|
</script>
|
|
33
34
|
|
|
34
35
|
<template>
|