Browse Source

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

pull/7342/head
Pranav C 7 months ago
parent
commit
d809bd77d7
  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 showValidationError?: boolean
} }
const { modelValue, showValidationError } = withDefaults(defineProps<Props>(), { showValidationError: true }) const { modelValue, showValidationError = true } = defineProps<Props>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])

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

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

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

@ -45,7 +45,7 @@ interface Props {
importDataOnly?: boolean 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']) const emit = defineEmits(['update:modelValue'])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save