Browse Source

fix(gui): set default inject value

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5647/head
Pranav C 2 years ago
parent
commit
d2abe4489f
  1. 2
      packages/nc-gui/components/cell/Currency.vue
  2. 2
      packages/nc-gui/components/cell/Decimal.vue
  3. 2
      packages/nc-gui/components/cell/Duration.vue
  4. 2
      packages/nc-gui/components/cell/Email.vue
  5. 2
      packages/nc-gui/components/cell/Float.vue
  6. 2
      packages/nc-gui/components/cell/Integer.vue
  7. 2
      packages/nc-gui/components/cell/Percent.vue
  8. 2
      packages/nc-gui/components/cell/Text.vue
  9. 2
      packages/nc-gui/components/cell/TextArea.vue
  10. 2
      packages/nc-gui/components/cell/Url.vue

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

@ -53,7 +53,7 @@ const currency = computed(() => {
} }
}) })
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()

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

@ -36,7 +36,7 @@ const vModel = computed({
}, },
}) })
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()
</script> </script>

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

@ -74,7 +74,7 @@ const submitDuration = () => {
isEdited.value = false isEdited.value = false
} }
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()
</script> </script>

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

@ -35,7 +35,7 @@ const vModel = computed({
const validEmail = computed(() => vModel.value && validateEmail(vModel.value)) const validEmail = computed(() => vModel.value && validateEmail(vModel.value))
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()

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

@ -36,7 +36,7 @@ const vModel = computed({
}, },
}) })
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()
</script> </script>

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

@ -36,7 +36,7 @@ const vModel = computed({
}, },
}) })
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()

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

@ -27,7 +27,7 @@ const vModel = computed({
}, },
}) })
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()
</script> </script>

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

@ -23,7 +23,7 @@ const readonly = inject(ReadonlyInj, ref(false))
const vModel = useVModel(props, 'modelValue', emits) const vModel = useVModel(props, 'modelValue', emits)
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()
</script> </script>

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

@ -19,7 +19,7 @@ const { showNull } = useGlobal()
const vModel = useVModel(props, 'modelValue', emits, { defaultValue: '' }) const vModel = useVModel(props, 'modelValue', emits, { defaultValue: '' })
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLTextAreaElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLTextAreaElement)?.focus()
</script> </script>

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

@ -63,7 +63,7 @@ const url = computed(() => {
const { cellUrlOptions } = useCellUrlConfig(url) const { cellUrlOptions } = useCellUrlConfig(url)
const isExpandedFormOpen = inject(IsExpandedFormOpenInj)! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen && (el as HTMLInputElement)?.focus()

Loading…
Cancel
Save