Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function useFlags() {
const flags: ValidationFlags = reactive(createFlags());
const passed = computed(() => {
return flags.valid && flags.validated;
});
const failed = computed(() => {
return flags.invalid && flags.validated;
});
return {
...toRefs(flags),
passed,
failed
};
}
}).json()
)
try {
_loading.value = true
state.result = await state.promise
} catch (e) {
state.error = e
} finally {
_loading.value = false
}
}
return {
call,
cancelPrevious,
...toRefs(state),
}
}
setup () {
const state = reactive({
term: ''
})
return {
...toRefs(state),
simpleCardData
}
}
}
onMounted(() => {
state.darkTheme = window.getComputedStyle(document.documentElement).getPropertyValue('content') === 'dark' ||
!!localStorage.getItem('darkTheme') ||
false
})
function toggleDarkTheme () {
state.darkTheme = !state.darkTheme
if (state.darkTheme) {
return localStorage.setItem('darkTheme', 'on')
}
localStorage.removeItem('darkTheme')
}
return {
...toRefs(state),
toggleDarkTheme
}
}
}
setup (_, { emit }) {
const state = reactive({
filter: []
})
return {
...toRefs(state)
}
}
}
setup () {
const state = reactive({
term: '',
filters: []
})
function setFilter (item) {
state.filters = [...state.filters, item]
}
return {
...toRefs(state),
filterItems,
setFilter,
discoverData
}
}
}
setup(props, { emit }) {
const { datasetId } = toRefs(props)
const {
result: downloadLinkResult,
loading,
} = useQuery(getDatasetDownloadLink, { datasetId }, { fetchPolicy: 'no-cache' })
const downloadLinks = computed(() => downloadLinkResult.value != null
? safeJsonParse(downloadLinkResult.value.dataset.downloadLinkJson)
: null)
return () => {
let content
if (loading.value) {
content = <div class="h-64">
} else if (downloadLinks.value == null) {
content = <div><h1>Error</h1><p>This dataset cannot be downloaded.</p></div>
} else {
const { license, contributors, files } = downloadLinks.value</div>
function navBetweenTabsByKeyBoard (e, index) {
const i = {
ArrowRight: index + 1,
ArrowLeft: index - 1,
Home: 0,
End: state.highlights.length - 1
}
if (state.highlights[i[e.key]]) {
state.highlight = { ...state.highlights[i[e.key]] }
refs.highlightItem[i[e.key]].focus()
}
}
return {
...toRefs(state),
setChosenHighlight,
navBetweenTabsByKeyBoard
}
}
}