多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1002 B

import type { TableType, ViewType } from 'nocodb-sdk'
interface UseExpandedFormDetachedProps {
'isOpen'?: boolean
'row': Row
'state'?: Record<string, any> | null
'meta': TableType
'loadRow'?: boolean
'useMetaFields'?: boolean
'rowId'?: string
'view'?: ViewType
'onCancel'?: Function
'onUpdate:modelValue'?: Function
}
const [setup, use] = useInjectionState(() => {
return ref<UseExpandedFormDetachedProps[]>([])
})
Nc feat/link record dropdown (#8345) * feat(nc-gui): link record dropdown setup * fix(nc-gui): move link record pagination to the bottom * feat(nc-gui): link record new design * fix(nc-gui): update bank state subtitle * fix(nc-gui): small changes * fix(nc-gui): update skeleton of link records item * fix(nc-gui): ui break issue * fix(nc-gui): increase z index of link dropdown overlay * fix(nc-gui): update link record dropdown header * fix(nc-gui): update link record dropdown * fix(nc-gui): new changes * fix: remove margin * fix(nc-gui): unlinked records empty state alignment * fix(nc-gui): make tooltip text size 14px * fix(nc-gui): reduce subtext font size * fix(nc-gui): link record item rich text cell alignment issue * fix(nc-gui): on esc link record dropdown should close * fix(nc-gui): update link record header and footer height * fix(nc-gui): add link record dropdown for bt cell * fix(nc-gui): fix invalid offset issue * fix(nc-gui): link record z index issue * fix: PW link unlink corrections * fix(nc-gui): link record dropdown close on outside issue in expanded form * fix(nc-gui): close dropdown after adding link in bt cell * fix(nc-gui): allow close link record dropdown on esc * fix(nc-gui): add link record dropdown in mm component * fix(nc-gui): add link record dropdown in hm component * fix(nc-gui): add link record dropdown in oo component * fix: auto close for BT * fix: ltar modal operations * fix: close link modal * fix: PW tests (wip) * test: fix link modal close in share view * test: fix LTAR in cell handling * fix(nc-gui): reduce link items skeleton height * fix(nc-gui): expanded form open issue on clicking bt cell record * fix(nc-gui): hide back btn if user directly opens record list dropdown * fix(nc-gui): reset offset when user opens link record dropdwon and switch between linked and unlinked records * fix(nc-gui): link record item height * fix(nc-gui): linked record list reload issue on link/unlink * fix(nc-gui): link record item subtext fields width should be same * fix(nc-gui): email, url cell truncate text issue * fix(nc-gui): shared form link record dropdwon ui * chore(nc-gui): lint * fix(nc-gu): small changes * fix(nc-gui): ai review changes * fix(nc-gui): link record list offset issue * fix(nc-gui): show plus btn in bt cell even if it is not blank * fix(nc-gui): barcode visiblility issue in link record dropdown * fix(nc-gui): do not focus links cell plus btn on close dropdown * fix(nc-gui): text color * fix(nc-gui): skip showing qr code null value * fix(nc-gui): virtual cell margin left issue in link record dropdwon * fix(nc-gui): link record subtext order should be same as default view col order * chore(nc-gui): lint * refactor(nocodb): add default view column order in col meta * fix(nc-gui): update default view order on reordering column from fields menu --------- Co-authored-by: Raju Udava <86527202+dstala@users.noreply.github.com>
7 months ago
export { setup as useExpandedFormDetachedProvider }
export function useExpandedFormDetached() {
let states = use()!
if (!states) {
states = setup()
}
const closeHook = createEventHook<void>()
const index = ref(-1)
const open = (props: UseExpandedFormDetachedProps) => {
states.value.push(props)
index.value = states.value.length - 1
}
const close = (i?: number) => {
states.value.splice(i || index.value, 1)
if (index.value === i || !i) closeHook.trigger()
}
return { states, open, close, onClose: closeHook.on }
}