Browse Source

chore(gui-v2): typo correction and linting

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3065/head
Pranav C 2 years ago
parent
commit
4710022fed
  1. 14
      packages/nc-gui-v2/components/cell/DatePicker.vue
  2. 6
      packages/nc-gui-v2/components/cell/DateTimePicker.vue
  3. 6
      packages/nc-gui-v2/components/cell/TimePicker.vue
  4. 6
      packages/nc-gui-v2/components/cell/YearPicker.vue
  5. 2
      packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue

14
packages/nc-gui-v2/components/cell/DatePicker.vue

@ -2,14 +2,14 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ColumnInj, ReadonlyInj } from '~/context' import { ColumnInj, ReadonlyInj } from '~/context'
const { modelValue } = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])
interface Props { interface Props {
modelValue: string | null modelValue: string | null
} }
const { modelValue } = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])
const columnMeta = inject(ColumnInj, null) const columnMeta = inject(ColumnInj, null)
const readOnlyMode = inject(ReadonlyInj, false) const readOnlyMode = inject(ReadonlyInj, false)
@ -42,12 +42,12 @@ const localState = $computed({
}) })
const open = ref(false) const open = ref(false)
const randonClass = `picker_${Math.floor(Math.random() * 99999)}` const randomClass = `picker_${Math.floor(Math.random() * 99999)}`
watch( watch(
open, open,
(next) => { (next) => {
if (next) { if (next) {
onClickOutside(document.querySelector(`.${randonClass}`)! as HTMLDivElement, () => (open.value = false)) onClickOutside(document.querySelector(`.${randomClass}`)! as HTMLDivElement, () => (open.value = false))
} }
}, },
{ flush: 'post' }, { flush: 'post' },
@ -63,7 +63,7 @@ watch(
:placeholder="isDateInvalid ? 'Invalid date' : !readOnlyMode ? 'Select date' : ''" :placeholder="isDateInvalid ? 'Invalid date' : !readOnlyMode ? 'Select date' : ''"
:allow-clear="!readOnlyMode" :allow-clear="!readOnlyMode"
:input-read-only="true" :input-read-only="true"
:dropdown-class-name="randonClass" :dropdown-class-name="randomClass"
:open="readOnlyMode ? false : open" :open="readOnlyMode ? false : open"
@click="open = !open" @click="open = !open"
> >

6
packages/nc-gui-v2/components/cell/DateTimePicker.vue

@ -44,12 +44,12 @@ const localState = $computed({
const open = ref(false) const open = ref(false)
const randonClass = `picker_${Math.floor(Math.random() * 99999)}` const randomClass = `picker_${Math.floor(Math.random() * 99999)}`
watch( watch(
open, open,
(next) => { (next) => {
if (next) { if (next) {
onClickOutside(document.querySelector(`.${randonClass}`)! as HTMLDivElement, () => (open.value = false)) onClickOutside(document.querySelector(`.${randomClass}`)! as HTMLDivElement, () => (open.value = false))
} }
}, },
{ flush: 'post' }, { flush: 'post' },
@ -66,7 +66,7 @@ watch(
:placeholder="isDateInvalid ? 'Invalid date' : !readOnlyMode ? 'Select date and time' : ''" :placeholder="isDateInvalid ? 'Invalid date' : !readOnlyMode ? 'Select date and time' : ''"
:allow-clear="!readOnlyMode" :allow-clear="!readOnlyMode"
:input-read-only="true" :input-read-only="true"
:dropdown-class-name="randonClass" :dropdown-class-name="randomClass"
:open="readOnlyMode ? false : open" :open="readOnlyMode ? false : open"
@click="open = !open" @click="open = !open"
> >

6
packages/nc-gui-v2/components/cell/TimePicker.vue

@ -54,12 +54,12 @@ const localState = $computed({
const open = ref(false) const open = ref(false)
const randonClass = `picker_${Math.floor(Math.random() * 99999)}` const randomClass = `picker_${Math.floor(Math.random() * 99999)}`
watch( watch(
open, open,
(next) => { (next) => {
if (next) { if (next) {
onClickOutside(document.querySelector(`.${randonClass}`)! as HTMLDivElement, () => (open.value = false)) onClickOutside(document.querySelector(`.${randomClass}`)! as HTMLDivElement, () => (open.value = false))
} }
}, },
{ flush: 'post' }, { flush: 'post' },
@ -79,7 +79,7 @@ watch(
:allow-clear="!readOnlyMode" :allow-clear="!readOnlyMode"
:input-read-only="true" :input-read-only="true"
:open="readOnlyMode ? false : open" :open="readOnlyMode ? false : open"
:dropdown-class-name="randonClass" :dropdown-class-name="randomClass"
@click="open = !open" @click="open = !open"
@ok="open = !open" @ok="open = !open"
> >

6
packages/nc-gui-v2/components/cell/YearPicker.vue

@ -43,12 +43,12 @@ const localState = $computed({
const open = ref(false) const open = ref(false)
const randonClass = `picker_${Math.floor(Math.random() * 99999)}` const randomClass = `picker_${Math.floor(Math.random() * 99999)}`
watch( watch(
open, open,
(next) => { (next) => {
if (next) { if (next) {
onClickOutside(document.querySelector(`.${randonClass}`)! as HTMLDivElement, () => (open.value = false)) onClickOutside(document.querySelector(`.${randomClass}`)! as HTMLDivElement, () => (open.value = false))
} }
}, },
{ flush: 'post' }, { flush: 'post' },
@ -65,7 +65,7 @@ watch(
:allow-clear="!readOnlyMode" :allow-clear="!readOnlyMode"
:input-read-only="true" :input-read-only="true"
:open="readOnlyMode ? false : open" :open="readOnlyMode ? false : open"
:dropdown-class-name="randonClass" :dropdown-class-name="randomClass"
@click="open = !open" @click="open = !open"
@change="open = !open" @change="open = !open"
> >

2
packages/nc-gui-v2/components/virtual-cell/BelongsTo.vue

@ -4,7 +4,7 @@ import type { Ref } from 'vue'
import ItemChip from './components/ItemChip.vue' import ItemChip from './components/ItemChip.vue'
import ListItems from './components/ListItems.vue' import ListItems from './components/ListItems.vue'
import { inject, ref, useProvideLTARStore, useSmartsheetRowStoreOrThrow } from '#imports' import { inject, ref, useProvideLTARStore, useSmartsheetRowStoreOrThrow } from '#imports'
import {ActiveCellInj, CellValueInj, ColumnInj, ReloadViewDataHookInj, RowInj } from '~/context' import { ActiveCellInj, CellValueInj, ColumnInj, ReloadViewDataHookInj, RowInj } from '~/context'
import MdiArrowExpand from '~icons/mdi/arrow-expand' import MdiArrowExpand from '~icons/mdi/arrow-expand'
import MdiPlus from '~icons/mdi/plus' import MdiPlus from '~icons/mdi/plus'

Loading…
Cancel
Save