多维表格
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.

22 lines
754 B

const timeout = 3000 // in ms
export default function useShowNotEditableWarning() {
const showEditNonEditableFieldWarning = refAutoReset(false, timeout)
const showClearNonEditableFieldWarning = refAutoReset(false, timeout)
const activateShowEditNonEditableFieldWarning = () => (showEditNonEditableFieldWarning.value = true)
useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEvent) => {
switch (e.key) {
case 'Enter':
showEditNonEditableFieldWarning.value = true
break
case 'Delete':
showClearNonEditableFieldWarning.value = true
break
}
})
return { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activateShowEditNonEditableFieldWarning }
}