Browse Source

Revert "fix: use withDefaults for setting default prop value"

This reverts commit 781a3cd9b3.
pull/7335/head
Pranav C 1 year ago
parent
commit
6d577e9f0a
  1. 2
      packages/nc-gui/components/cell/Duration.vue
  2. 2
      packages/nc-gui/components/cell/YearPicker.vue
  3. 2
      packages/nc-gui/components/dlg/QuickImport.vue
  4. 7
      packages/nc-gui/components/general/Overlay.vue
  5. 17
      packages/nc-gui/components/general/Share.vue
  6. 2
      packages/nc-gui/components/general/Sponsors.vue
  7. 2
      packages/nc-gui/components/general/TruncateText.vue
  8. 6
      packages/nc-gui/components/monaco/Editor.vue
  9. 9
      packages/nc-gui/components/virtual-cell/components/ItemChip.vue
  10. 4
      packages/nc-gui/pages/projects/index/index.vue
  11. 4
      packages/nc-gui/pages/projects/index/list.vue

2
packages/nc-gui/components/cell/Duration.vue

@ -20,7 +20,7 @@ interface Props {
showValidationError?: boolean
}
const { modelValue, showValidationError } = withDefaults(defineProps<Props>(), { showValidationError: true })
const { modelValue, showValidationError = true } = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])

2
packages/nc-gui/components/cell/YearPicker.vue

@ -18,7 +18,7 @@ interface Props {
isPk?: boolean
}
const { modelValue, isPk = false } = withDefaults(defineProps<Props>(), { isPk: false })
const { modelValue, isPk = false } = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])

2
packages/nc-gui/components/dlg/QuickImport.vue

@ -45,7 +45,7 @@ interface Props {
importDataOnly?: boolean
}
const { importType, importDataOnly, sourceId, ...rest } = withDefaults(defineProps<Props>(), { importDataOnly: false })
const { importType, importDataOnly = false, sourceId, ...rest } = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])

7
packages/nc-gui/components/general/Overlay.vue

@ -22,12 +22,7 @@ interface Emits {
(event: 'open'): void
}
const { transition, teleportDisabled, inline, target, zIndex, ...rest } = withDefaults(defineProps<Props>(), {
transition: true,
teleportDisabled: false,
inline: false,
zIndex: 100,
})
const { transition = true, teleportDisabled = false, inline = false, target, zIndex = 100, ...rest } = defineProps<Props>()
const emits = defineEmits<Emits>()

17
packages/nc-gui/components/general/Share.vue

@ -12,13 +12,16 @@ interface Props {
width?: string
}
const { url, socialMedias, title, summary, hashTags, css, iconClass, width } = withDefaults(defineProps<Props>(), {
title: 'NocoDB',
hashTags: '',
css: '',
iconClass: '',
width: '45px',
})
const {
url,
socialMedias,
title = 'NocoDB',
summary,
hashTags = '',
css = '',
iconClass = '',
width = '45px',
} = defineProps<Props>()
const summaryArr = [
'Instant #Rest & #GraphQL APIs on any #SQL Database (Supports : MySQL, PostgresSQL, MsSQL, SQLite, MariaDB) #nocodb ',

2
packages/nc-gui/components/general/Sponsors.vue

@ -3,7 +3,7 @@ interface Props {
nav?: boolean
}
const { nav } = withDefaults(defineProps<Props>(), { nav: false })
const { nav = false } = defineProps<Props>()
</script>
<template>

2
packages/nc-gui/components/general/TruncateText.vue

@ -18,7 +18,7 @@ interface Props {
length?: number
}
const { placement, length } = withDefaults(defineProps<Props>(), { placement: 'bottom', length: 20 })
const { placement = 'bottom', length = 20 } = defineProps<Props>()
const text = ref<HTMLDivElement>()

6
packages/nc-gui/components/monaco/Editor.vue

@ -14,11 +14,7 @@ interface Props {
readOnly?: boolean
}
const { hideMinimap, lang, validate, disableDeepCompare, modelValue, readOnly } = withDefaults(defineProps<Props>(), {
lang: 'json',
validate: true,
disableDeepCompare: false,
})
const { hideMinimap, lang = 'json', validate = true, disableDeepCompare = false, modelValue, readOnly } = defineProps<Props>()
const emits = defineEmits(['update:modelValue'])

9
packages/nc-gui/components/virtual-cell/components/ItemChip.vue

@ -22,14 +22,7 @@ interface Props {
readonly?: boolean
}
const {
value,
item,
column,
showUnlinkButton,
border,
readonly: readonlyProp,
} = withDefaults(defineProps<Props>(), { border: true })
const { value, item, column, showUnlinkButton, border = true, readonly: readonlyProp } = defineProps<Props>()
const emit = defineEmits(['unlink'])

4
packages/nc-gui/pages/projects/index/index.vue

@ -6,9 +6,7 @@ interface Props {
bases?: BaseType[]
}
const { bases } = withDefaults(defineProps<Props>(), {
bases: () => [],
})
const { bases = [] } = defineProps<Props>()
const emit = defineEmits(['delete-base'])

4
packages/nc-gui/pages/projects/index/list.vue

@ -6,9 +6,7 @@ interface Props {
bases?: BaseType[]
}
const { bases } = withDefaults(defineProps<Props>(), {
bases: () => [],
})
const { bases = [] } = defineProps<Props>()
const emit = defineEmits(['delete-base'])

Loading…
Cancel
Save