code stringlengths 1 1.05M | repo_name stringlengths 6 83 | path stringlengths 3 242 | language stringclasses 222
values | license stringclasses 20
values | size int64 1 1.05M |
|---|---|---|---|---|---|
<template>
<div class="select-none space-y-3 bg-white p-1 text-base">
<div class="flex items-center text-gray-700">
<div
class="flex h-6 w-6 cursor-pointer items-center justify-center rounded hover:bg-gray-100"
>
<FeatherIcon @click="prevMonth" name="chevron-left" class="h-5 w-5" />
</div>
<div c... | 2302_79757062/insights | frontend/src/components/Controls/DateRangePickerFlat.vue | Vue | agpl-3.0 | 7,256 |
<script setup>
import Tabs from '@/components/Tabs.vue'
import { computed } from 'vue'
defineEmits(['tab-change'])
const props = defineProps(['placeholder', 'tabs', 'value'])
const tabs = computed(() =>
Object.keys(props.tabs).map((key) => ({
label: key,
active: props.tabs[key],
}))
)
function getLabel() {
ret... | 2302_79757062/insights | frontend/src/components/Controls/InputWithTabs.vue | Vue | agpl-3.0 | 1,244 |
<script setup>
const props = defineProps({ link: { type: String, required: true } })
function openLink() {
window.open(props.link, '_blank')
}
</script>
<template>
<div class="relative">
<slot></slot>
<div
v-if="props.link"
class="absolute top-0 right-0 flex h-full w-8 cursor-pointer items-center justify-c... | 2302_79757062/insights | frontend/src/components/Controls/LinkIcon.vue | Vue | agpl-3.0 | 477 |
<template>
<Combobox multiple nullable v-slot="{ open: isComboboxOpen }" v-model="selectedOptions">
<Popover class="w-full">
<template #target="{ open: openPopover }">
<div class="w-full">
<ComboboxButton
class="form-input flex h-fit w-full items-center justify-between rounded border-gray-400 bg-gr... | 2302_79757062/insights | frontend/src/components/Controls/ListPicker.vue | Vue | agpl-3.0 | 6,182 |
<template>
<Popover class="flex w-full [&>div:first-child]:w-full">
<template #target="{ togglePopover }">
<input
readonly
type="text"
:value="_value"
:placeholder="placeholder"
@focus="togglePopover()"
class="form-input block h-7 w-full cursor-text select-none rounded border-gray-400 text... | 2302_79757062/insights | frontend/src/components/Controls/TimespanPicker.vue | Vue | agpl-3.0 | 2,396 |
<template>
<div class="flex select-none flex-col space-y-3 text-base">
<Tabs :tabs="['Last', 'Current', 'Next']" v-model="span"></Tabs>
<div class="flex space-x-2">
<Input
v-if="span !== 'Current'"
type="number"
v-model="interval"
class="w-full text-sm"
/>
<Input
type="select"
v-m... | 2302_79757062/insights | frontend/src/components/Controls/TimespanPickerFlat.vue | Vue | agpl-3.0 | 1,864 |
<script setup>
import { GripVertical, X } from 'lucide-vue-next'
import { computed } from 'vue'
import Draggable from 'vuedraggable'
const emit = defineEmits(['update:items', 'sort'])
const props = defineProps({
items: { type: Array, required: true },
group: { type: String, required: true },
itemKey: { type: String... | 2302_79757062/insights | frontend/src/components/DraggableList.vue | Vue | agpl-3.0 | 2,272 |
<script setup></script>
<template>
<Popover placement="bottom-start">
<template #target="{ togglePopover }">
<Button icon="more-horizontal" @click="togglePopover"></Button>
</template>
<template #body="{ togglePopover }">
<div
class="relative mt-1 max-h-[26rem] w-[16rem] overflow-y-auto rounded-lg bg-... | 2302_79757062/insights | frontend/src/components/DraggableListItemMenu.vue | Vue | agpl-3.0 | 450 |
<script setup>
defineProps({ info: Object })
</script>
<template>
<div class="ml-auto w-[20rem] rounded border bg-white p-2 shadow-lg">
<p>{{ info?.description }}</p>
<div class="mt-2 rounded bg-gray-50 p-2 text-xs leading-5">
<code>
<span class="text-gray-600"># Syntax</span>
<br />
{{ info?.synta... | 2302_79757062/insights | frontend/src/components/ExpressionHelp.vue | Vue | agpl-3.0 | 471 |
<template>
<div class="relative flex flex-1 overflow-hidden rounded py-3">
<div
v-if="props.rows.length == 0"
class="absolute top-0 flex h-full w-full items-center justify-center text-lg font-light text-gray-600"
>
<span>No Data</span>
</div>
<div class="flex flex-1 flex-col overflow-auto text-base">
... | 2302_79757062/insights | frontend/src/components/Grid.vue | Vue | agpl-3.0 | 1,061 |
<script setup>
import { computed, ref, inject } from 'vue'
import { TextEditor, call } from 'frappe-ui'
const props = defineProps({ modelValue: Boolean })
const emit = defineEmits(['update:modelValue'])
const show = computed({
get: () => props.modelValue,
set: (value) => emit('update:modelValue', value),
})
const co... | 2302_79757062/insights | frontend/src/components/HelpDialog.vue | Vue | agpl-3.0 | 3,193 |
<template>
<svg
width="512"
height="512"
viewBox="0 0 512 512"
fill="none"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<path d="M0 0H512V512H0V0Z" fill="url(#pattern0)" />
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">... | 2302_79757062/insights | frontend/src/components/Icons/ComboChartIcon.vue | Vue | agpl-3.0 | 9,721 |
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="9" r="1"></circle>
<circle cx="19" cy="9" r="1"></circle>
<circle cx="5" cy="9" r="1"></circle>
<circle c... | 2302_79757062/insights | frontend/src/components/Icons/DragHandleIcon.vue | Vue | agpl-3.0 | 517 |
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
width="800px"
height="800px"
viewBox="0 0 24 24"
fill="none"
>
<g id="Navigation / House_01">
<path
id="Vector"
d="M20 17.0002V11.4522C20 10.9179 19.9995 10.6506 19.9346 10.4019C19.877 10.1816 19.7825 9.97307 19.6546 9.78464C19.5102 9.57201 19.... | 2302_79757062/insights | frontend/src/components/Icons/HomeIcon.vue | Vue | agpl-3.0 | 1,418 |
<template>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<rect width="16" height="16" rx="4.5" class="currentColor fill-current" />
<circle cx="8" cy="8" r="3" fill="white" />
</svg>
</template>
| 2302_79757062/insights | frontend/src/components/Icons/IndicatorIcon.vue | Vue | agpl-3.0 | 251 |
<template>
<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20">
<path
strokeWidth="1"
fill="currentColor"
d="M13.333 15.833Q12.812 15.833 12.406 15.75Q12 15.667 11.667 15.5Q12.667 14.708 13.229 13.25Q13.792 11.792 13.792 10Q13.792 8.208 13.229 6.75Q12.667 5.292 11.667 4.5Q12 4.333 12.406 4.25Q12.... | 2302_79757062/insights | frontend/src/components/Icons/JoinFullIcon.vue | Vue | agpl-3.0 | 967 |
<template>
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M2 4.5H14"
stroke="currentColor"
stroke-miterlimit="10"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M4 8.5H12"
stroke="currentColor"
stroke-miterlimit="10"
... | 2302_79757062/insights | frontend/src/components/ListFilter/FilterIcon.vue | Vue | agpl-3.0 | 534 |
<template>
<NestedPopover>
<template #target>
<Button label="Filter">
<template #prefix><FilterIcon class="h-4" /></template>
<template v-if="filters.length" #suffix>
<div
class="flex h-5 w-5 items-center justify-center rounded bg-gray-900 pt-[1px] text-xs font-medium text-white"
>
{... | 2302_79757062/insights | frontend/src/components/ListFilter/ListFilter.vue | Vue | agpl-3.0 | 7,331 |
<template>
<Popover v-slot="{ open }">
<PopoverButton
as="div"
ref="reference"
@click="updatePosition"
@focusin="updatePosition"
@keydown="updatePosition"
v-slot="{ open }"
>
<slot name="target" v-bind="{ open }" />
</PopoverButton>
<div v-show="open">
<PopoverPanel v-slot="{ open, clos... | 2302_79757062/insights | frontend/src/components/ListFilter/NestedPopover.vue | Vue | agpl-3.0 | 1,141 |
<template>
<Autocomplete
placeholder="Select an option"
:options="options"
:modelValue="selection"
@update:query="(q) => onUpdateQuery(q)"
@update:modelValue="(v) => (selection = v.value)"
/>
</template>
<script setup>
import { Autocomplete, createListResource } from 'frappe-ui'
import { computed, watch } ... | 2302_79757062/insights | frontend/src/components/ListFilter/SearchComplete.vue | Vue | agpl-3.0 | 1,728 |
<template>
<div class="h-full w-full pt-4 sm:pt-16">
<div class="relative z-10">
<div class="flex">
<img src="../assets/insights-logo-new.svg" class="mx-auto h-12" />
</div>
<div
class="mx-auto bg-white px-4 py-8 sm:mt-6 sm:w-96 sm:rounded-lg sm:px-8 sm:shadow-xl"
>
<div class="mb-6 text-cent... | 2302_79757062/insights | frontend/src/components/LoginBox.vue | Vue | agpl-3.0 | 675 |
<script setup>
import { computed } from 'vue'
const props = defineProps({
show: { type: Boolean, default: false },
title: { type: String },
types: { type: Array, default: () => [] },
})
const emit = defineEmits(['update:show'])
const show = computed({
get: () => props.show,
set: (value) => emit('update:show', val... | 2302_79757062/insights | frontend/src/components/NewDialogWithTypes.vue | Vue | agpl-3.0 | 1,630 |
<template>
<div class="flex min-w-0 items-center">
<router-link
class="flex items-center rounded px-0.5 py-1 text-lg font-medium text-gray-600 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-400"
:to="{ path: '/' }"
>
<HomeIcon class="w-4" />
</router-link>
<span cl... | 2302_79757062/insights | frontend/src/components/PageBreadcrumbs.vue | Vue | agpl-3.0 | 2,469 |
<script setup>
const props = defineProps({
title: { type: String },
actions: { type: Array },
})
</script>
<template>
<div class="flex h-14 flex-shrink-0 items-center justify-between">
<div class="flex items-center space-x-4">
<div class="text-3xl font-medium text-gray-900">{{ title }}</div>
<slot name="tit... | 2302_79757062/insights | frontend/src/components/PageTitle.vue | Vue | agpl-3.0 | 730 |
<template>
<div ref="reference">
<div
ref="target"
:class="['flex', $attrs.class]"
@click="updatePosition"
@focusin="updatePosition"
@keydown="updatePosition"
@mouseover="onMouseover"
@mouseleave="onMouseleave"
>
<slot name="target" v-bind="{ togglePopover, updatePosition, open, close, isOp... | 2302_79757062/insights | frontend/src/components/Popover.vue | Vue | agpl-3.0 | 6,322 |
<template>
<Dialog v-model="show" :dismissable="true">
<template #body>
<div class="bg-white px-4 py-5 sm:p-6">
<h3 class="mb-3 text-lg font-medium leading-6 text-gray-900">
{{ title }}
</h3>
<div class="space-y-3 text-base">
<div class="space-y-4">
<div class="flex items-center space-... | 2302_79757062/insights | frontend/src/components/PublicShareDialog.vue | Vue | agpl-3.0 | 3,344 |
<script setup>
import ContentEditable from './ContentEditable.vue'
import { computed } from 'vue'
const emit = defineEmits(['update:modelValue'])
const props = defineProps({ modelValue: String | Number, placeholder: String })
const value = computed({
get: () => props.modelValue || '',
set: (value) => emit('update:mod... | 2302_79757062/insights | frontend/src/components/ResizeableInput.vue | Vue | agpl-3.0 | 574 |
<template>
<div class="flex">
<div class="flex-1">
<p class="font-medium leading-6 text-gray-900">{{ label }}</p>
<span class="text-gray-600">
{{ description }}
</span>
</div>
<div class="flex flex-1 items-center pl-20">
<slot />
</div>
</div>
</template>
<script setup>
const props = definePr... | 2302_79757062/insights | frontend/src/components/Setting.vue | Vue | agpl-3.0 | 441 |
<template>
<Dialog v-model="show" :dismissable="true">
<template #body>
<div class="bg-white px-4 py-5 sm:p-6">
<h3 class="mb-3 text-lg font-medium leading-6 text-gray-900">
{{ title }}
</h3>
<div class="space-y-3 text-base">
<div v-if="props.allowPublicAccess" class="space-y-4">
<div ... | 2302_79757062/insights | frontend/src/components/ShareDialog.vue | Vue | agpl-3.0 | 5,962 |
<template>
<div
class="rg:w-60 flex w-14 flex-shrink-0 flex-col border-r border-gray-300 bg-white"
v-if="currentRoute"
>
<div class="flex flex-grow flex-col overflow-y-auto p-2.5">
<div class="rg:flex hidden flex-shrink-0 items-end text-sm text-gray-600">
<img src="../assets/insights-logo-new.svg" class=... | 2302_79757062/insights | frontend/src/components/Sidebar.vue | Vue | agpl-3.0 | 6,760 |
import { LoadingIndicator } from 'frappe-ui'
export default {
name: 'SuspenseFallback',
components: { LoadingIndicator },
render() {
return (
<div class="flex h-full w-full flex-col items-center justify-center">
<LoadingIndicator class="h-10 w-10 text-gray-400" />
</div>
)
},
}
| 2302_79757062/insights | frontend/src/components/SuspenseFallback.jsx | JavaScript | agpl-3.0 | 297 |
<script setup>
import { SearchIcon } from 'lucide-vue-next'
const emit = defineEmits(['update:modelValue'])
const props = defineProps({ modelValue: String })
</script>
<template>
<FormControl
type="text"
autocomplete="off"
:modelValue="modelValue"
@update:modelValue="emit('update:modelValue', $event)"
>
<... | 2302_79757062/insights | frontend/src/components/Table/TableColumnFilter.vue | Vue | agpl-3.0 | 428 |
<script setup>
import { PackageOpen } from 'lucide-vue-next'
</script>
<template>
<div
class="absolute top-0 flex h-full w-full flex-col items-center justify-center gap-2 text-base text-gray-500"
>
<PackageOpen class="h-12 w-12 text-gray-400" stroke-width="1" />
<div class="text-center">No results to display</... | 2302_79757062/insights | frontend/src/components/Table/TableEmpty.vue | Vue | agpl-3.0 | 345 |
<script setup>
import { FlexRender } from '@tanstack/vue-table'
import { ChevronDown, ChevronRight } from 'lucide-vue-next'
const props = defineProps({
row: { type: Object, required: true },
cell: { type: Object, required: true },
})
</script>
<template>
<div class="flex gap-1">
<ChevronDown
v-if="row.getIsEx... | 2302_79757062/insights | frontend/src/components/Table/TableGroupedCell.vue | Vue | agpl-3.0 | 709 |
<script setup>
import { LinkIcon } from 'lucide-vue-next'
const props = defineProps({
label: { type: String, required: true },
url: { type: String, required: true },
})
</script>
<template>
<a :href="url" target="_blank" class="flex items-center gap-1 hover:underline">
<LinkIcon class="h-3 w-3" />
<span>{{ lab... | 2302_79757062/insights | frontend/src/components/Table/TableLinkCell.vue | Vue | agpl-3.0 | 351 |
<script setup>
import { formatNumber } from '@/utils'
import { COLOR_MAP } from '@/utils/colors'
const props = defineProps({
value: { type: Number, required: true },
prefix: { type: String, required: false, default: '' },
suffix: { type: String, required: false, default: '' },
decimals: { type: Number, required: f... | 2302_79757062/insights | frontend/src/components/Table/TableNumberCell.vue | Vue | agpl-3.0 | 1,341 |
<script setup>
import {
FlexRender,
getCoreRowModel,
getExpandedRowModel,
getFilteredRowModel,
getGroupedRowModel,
getPaginationRowModel,
getSortedRowModel,
useVueTable,
} from '@tanstack/vue-table'
import { debounce } from 'frappe-ui'
import { ChevronLeft, ChevronRight } from 'lucide-vue-next'
import { compute... | 2302_79757062/insights | frontend/src/components/Table/TanstackTable.vue | Vue | agpl-3.0 | 6,759 |
import { ellipsis, formatNumber } from '@/utils'
import { Badge } from 'frappe-ui'
import { h } from 'vue'
import TableLinkCell from './TableLinkCell.vue'
import TableNumberCell from './TableNumberCell.vue'
export function filterFunction(row, columnId, filterValue) {
const column = columnId
const value = row.getValu... | 2302_79757062/insights | frontend/src/components/Table/utils.js | JavaScript | agpl-3.0 | 3,108 |
<template>
<div class="flex h-7 w-full cursor-pointer select-none items-center rounded border bg-gray-100">
<div
v-for="tab in tabs"
class="flex h-full flex-1 items-center justify-center truncate px-4 transition-all"
:class="{
'rounded bg-white shadow':
tab.active ||
currentTab === tab.value |... | 2302_79757062/insights | frontend/src/components/Tabs.vue | Vue | agpl-3.0 | 962 |
<template>
<div class="m-2 flex transition duration-200 ease-out">
<div :class="['w-[22rem] rounded bg-white p-3 shadow-md', variantClasses]">
<div class="flex items-start">
<div v-if="icon || variantIcon" class="mr-2 pt-1">
<FeatherIcon
:name="icon || variantIcon"
:class="['h-4 w-4 rounded-f... | 2302_79757062/insights | frontend/src/components/Toast.vue | Vue | agpl-3.0 | 2,395 |
<template>
<Popover trigger="hover" :hoverDelay="hoverDelay" :placement="placement">
<template #target>
<slot />
</template>
<template #body>
<slot name="body">
<div
class="w-fit rounded bg-gray-800 px-2 py-1 text-center text-xs text-white shadow-xl"
:class="bodyClasses"
>
{{ text }}... | 2302_79757062/insights | frontend/src/components/Tooltip.vue | Vue | agpl-3.0 | 634 |
<script setup></script>
<template>
<div class="flex h-14 items-center justify-between border-b bg-white px-3"></div>
</template>
| 2302_79757062/insights | frontend/src/components/Topbar.vue | Vue | agpl-3.0 | 130 |
<script setup>
import { slideDownTransition } from '@/utils/transitions'
import { createPopper } from '@popperjs/core'
import { whenever } from '@vueuse/core'
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
const emit = defineEmits(['update:show'])
const props = defineProps({
show: { type: Boolean, de... | 2302_79757062/insights | frontend/src/components/UsePopover.vue | Vue | agpl-3.0 | 2,886 |
<script setup>
import { onMounted, ref, onBeforeUnmount, computed } from 'vue'
import UsePopover from './UsePopover.vue'
const props = defineProps({
content: { type: String, default: null },
targetElement: { type: Object, required: true },
placement: { type: String, default: 'top' },
hoverDelay: { type: Number, def... | 2302_79757062/insights | frontend/src/components/UseTooltip.vue | Vue | agpl-3.0 | 1,590 |
<script setup>
import ContentEditable from '@/components/ContentEditable.vue'
import VueGridLayout from '@/dashboard/VueGridLayout.vue'
import useDashboard from '@/dashboard/useDashboard'
import BaseLayout from '@/layouts/BaseLayout.vue'
import { updateDocumentTitle } from '@/utils'
import widgets from '@/widgets/widge... | 2302_79757062/insights | frontend/src/dashboard/Dashboard.vue | Vue | agpl-3.0 | 5,531 |
<script setup>
import { inject } from 'vue'
const dashboard = inject('dashboard')
</script>
<template>
<div class="flex flex-1 flex-col items-center justify-center space-y-1">
<div class="text-base font-light text-gray-600">
{{
!dashboard.editing ? "You haven't added any charts." : 'Drag and drop charts here... | 2302_79757062/insights | frontend/src/dashboard/DashboardEmptyState.vue | Vue | agpl-3.0 | 524 |
<script setup>
import UsePopover from '@/components/UsePopover.vue'
import { downloadImage } from '@/utils'
import useChartData from '@/widgets/useChartData'
import widgets from '@/widgets/widgets'
import { whenever } from '@vueuse/shared'
import { Maximize } from 'lucide-vue-next'
import { computed, inject, provide, r... | 2302_79757062/insights | frontend/src/dashboard/DashboardItem.vue | Vue | agpl-3.0 | 5,199 |
<script setup>
import { downloadImage } from '@/utils'
import { inject } from 'vue'
const props = defineProps({ item: Object })
const dashboard = inject('dashboard')
const widgetRef = inject('widgetRef')
const actions = [
{
icon: 'external-link',
label: 'Open Query',
hidden: (item) => item.item_type === 'Filter... | 2302_79757062/insights | frontend/src/dashboard/DashboardItemActions.vue | Vue | agpl-3.0 | 1,167 |
<template>
<header class="sticky top-0 z-10 flex items-center justify-between bg-white px-5 py-2.5">
<PageBreadcrumbs class="h-7" :items="[{ label: 'Dashboards' }]" />
<div class="space-x-2.5">
<Button label="New Dashboard" variant="solid" @click="showDialog = true">
<template #prefix>
<Plus class="h-4... | 2302_79757062/insights | frontend/src/dashboard/DashboardList.vue | Vue | agpl-3.0 | 2,988 |
<script setup>
import useDashboards from '@/dashboard/useDashboards'
import { getShortNumber } from '@/utils'
const props = defineProps({
dashboard: { type: Object, required: true },
})
const dashboards = useDashboards()
function toggleFavourite() {
dashboards.toggleLike(props.dashboard)
}
</script>
<template>
<rou... | 2302_79757062/insights | frontend/src/dashboard/DashboardListCard.vue | Vue | agpl-3.0 | 1,856 |
<script setup>
import { ref, computed } from 'vue'
import DashboardCard from './DashboardListCard.vue'
const props = defineProps({
title: { type: String, required: true },
dashboards: { type: Array, required: true },
enableSearch: { type: Boolean, default: false },
})
const searchTerm = ref('')
const filteredDashboa... | 2302_79757062/insights | frontend/src/dashboard/DashboardListGroup.vue | Vue | agpl-3.0 | 1,334 |
<script setup>
import { downloadImage } from '@/utils'
import { inject, ref } from 'vue'
import { useRouter } from 'vue-router'
const dashboard = inject('dashboard')
const showDeleteDialog = ref(false)
const router = useRouter()
async function handleDelete() {
await dashboard.deleteDashboard()
showDeleteDialog.value... | 2302_79757062/insights | frontend/src/dashboard/DashboardMenuButton.vue | Vue | agpl-3.0 | 1,372 |
<script setup>
import { useMagicKeys, whenever } from '@vueuse/core'
import { inject } from 'vue'
import DashboardMenuButton from './DashboardMenuButton.vue'
import DashboardShareButton from './DashboardShareButton.vue'
const dashboard = inject('dashboard')
const keys = useMagicKeys()
const cmdE = keys['Meta+E']
whene... | 2302_79757062/insights | frontend/src/dashboard/DashboardNavbarButtons.vue | Vue | agpl-3.0 | 1,089 |
<script setup>
import { Dialog as HDialog, DialogOverlay, TransitionChild, TransitionRoot } from '@headlessui/vue'
import { computed } from 'vue'
import DashboardQueryEditor from './DashboardQueryEditor.vue'
const emit = defineEmits(['update:show', 'close'])
const props = defineProps({
show: { type: Boolean, required... | 2302_79757062/insights | frontend/src/dashboard/DashboardQueryDialog.vue | Vue | agpl-3.0 | 2,274 |
<script setup>
import Query from '@/query/Query.vue'
import QueryHeader from '@/query/QueryHeader.vue'
const props = defineProps(['name'])
</script>
<template>
<div class="flex w-full flex-col p-2">
<Query :name="props.name" :hideTabs="true" />
</div>
</template>
| 2302_79757062/insights | frontend/src/dashboard/DashboardQueryEditor.vue | Vue | agpl-3.0 | 269 |
<script setup>
import Query from '@/query/Query.vue'
import useQueryStore from '@/stores/queryStore'
import { computed, ref } from 'vue'
const emit = defineEmits(['update:modelValue'])
const props = defineProps(['modelValue'])
const queryName = computed({
get: () => props.modelValue,
set: (value) => emit('update:mo... | 2302_79757062/insights | frontend/src/dashboard/DashboardQueryOption.vue | Vue | agpl-3.0 | 2,329 |
<script setup>
import ShareDialog from '@/components/ShareDialog.vue'
import { inject, ref } from 'vue'
const dashboard = inject('dashboard')
const showShareDialog = ref(false)
</script>
<template>
<Badge v-if="dashboard.isPrivate" theme="yellow"> Private </Badge>
<Button variant="outline" @click="showShareDialog ... | 2302_79757062/insights | frontend/src/dashboard/DashboardShareButton.vue | Vue | agpl-3.0 | 641 |
<script setup>
import widgets from '@/widgets/widgets'
import { inject } from 'vue'
const dashboard = inject('dashboard')
const emit = defineEmits(['dragChange'])
function onDragStart(widget) {
emit('dragChange', widget)
dashboard.draggingWidget = widget
}
</script>
<template>
<div class="grid grid-cols-3 gap-3">
... | 2302_79757062/insights | frontend/src/dashboard/DashboardWidgetsOptions.vue | Vue | agpl-3.0 | 858 |
<script setup>
import VueGridLayout from '@/dashboard/VueGridLayout.vue'
import usePublicDashboard from '@/dashboard/usePublicDashboard'
import BaseLayout from '@/layouts/BaseLayout.vue'
import { provide } from 'vue'
import DashboardEmptyState from './DashboardEmptyState.vue'
import PublicDashboardItem from './PublicDa... | 2302_79757062/insights | frontend/src/dashboard/PublicDashboard.vue | Vue | agpl-3.0 | 1,431 |
<script setup>
import InvalidWidget from '@/widgets/InvalidWidget.vue'
import useChartData from '@/widgets/useChartData'
import widgets from '@/widgets/widgets'
import { whenever } from '@vueuse/shared'
import { computed, inject, reactive, watch } from 'vue'
const dashboard = inject('dashboard')
const props = definePr... | 2302_79757062/insights | frontend/src/dashboard/PublicDashboardItem.vue | Vue | agpl-3.0 | 1,936 |
<script setup>
import DatePickerFlat from '@/components/Controls/DatePickerFlat.vue'
import DateRangePickerFlat from '@/components/Controls/DateRangePickerFlat.vue'
import TimespanPickerFlat from '@/components/Controls/TimespanPickerFlat.vue'
import { fieldtypesToIcon, formatDate, isEmptyObj } from '@/utils'
import { g... | 2302_79757062/insights | frontend/src/dashboard/SimpleFilter.vue | Vue | agpl-3.0 | 10,057 |
<script setup>
import { computed, onMounted, onUnmounted, reactive, ref, watchEffect } from 'vue'
const props = defineProps({
onDrop: { type: Function },
showCollision: { type: Boolean, default: false },
colliderClass: { type: String, default: '.collider' },
ghostWidth: { type: Number, default: 128 },
ghostHeight... | 2302_79757062/insights | frontend/src/dashboard/UseDropZone.vue | Vue | agpl-3.0 | 3,459 |
<template>
<grid-layout ref="grid" :layout="layouts" v-bind="options" @update:layout="layouts = $event">
<template #default="{ gridItemProps }">
<grid-item
v-for="(layout, index) in layouts"
v-bind="gridItemProps"
:key="layout.i"
:i="layout.i"
:x="layout.x"
:y="layout.y"
:w="layout.w"
... | 2302_79757062/insights | frontend/src/dashboard/VueGridLayout.vue | Vue | agpl-3.0 | 2,566 |
import useQuery from '@/query/resources/useQuery'
import sessionStore from '@/stores/sessionStore'
import { areDeeplyEqual, safeJSONParse } from '@/utils'
import { createToast } from '@/utils/toasts'
import widgets from '@/widgets/widgets'
import { createDocumentResource, debounce } from 'frappe-ui'
import { getLocal, ... | 2302_79757062/insights | frontend/src/dashboard/useDashboard.js | JavaScript | agpl-3.0 | 8,531 |
import dayjs from '@/utils/dayjs'
import { call, createResource } from 'frappe-ui'
import { defineStore } from 'pinia'
export default defineStore('dashboards', {
state: () => ({
list: [],
loading: false,
creating: false,
deleting: false,
currentDashboard: undefined,
}),
actions: {
async reload() {
th... | 2302_79757062/insights | frontend/src/dashboard/useDashboards.js | JavaScript | agpl-3.0 | 1,851 |
import { areDeeplyEqual, safeJSONParse } from '@/utils'
import widgets from '@/widgets/widgets'
import { createResource } from 'frappe-ui'
import { getLocal, saveLocal } from 'frappe-ui/src/resources/local'
import { reactive } from 'vue'
export default function usePublicDashboard(public_key) {
const resource = getPub... | 2302_79757062/insights | frontend/src/dashboard/usePublicDashboard.js | JavaScript | agpl-3.0 | 4,659 |
<script setup>
import { computed } from 'vue'
import MariaDBForm from './MariaDBForm.vue'
const props = defineProps({ show: Boolean })
const emit = defineEmits(['update:show'])
const show = computed({
get: () => props.show,
set: (value) => emit('update:show', value),
})
</script>
<template>
<Dialog v-model="show" :... | 2302_79757062/insights | frontend/src/datasource/ConnectMariaDBDialog.vue | Vue | agpl-3.0 | 469 |
<script setup>
import { computed } from 'vue'
import PostgreSQLForm from './PostgreSQLForm.vue'
const props = defineProps({ show: Boolean })
const emit = defineEmits(['update:show'])
const show = computed({
get: () => props.show,
set: (value) => emit('update:show', value),
})
</script>
<template>
<Dialog v-model="s... | 2302_79757062/insights | frontend/src/datasource/ConnectPostgreDBDialog.vue | Vue | agpl-3.0 | 480 |
<template>
<header class="sticky top-0 z-10 flex items-center justify-between bg-white px-5 py-2.5">
<PageBreadcrumbs
class="h-7"
:items="[
{ label: 'Data Sources', route: { path: '/data-source' } },
{ label: dataSource.doc.title },
]"
/>
</header>
<div class="mb-4 flex h-full flex-col gap-2 ov... | 2302_79757062/insights | frontend/src/datasource/DataSource.vue | Vue | agpl-3.0 | 3,719 |
<template>
<header class="sticky top-0 z-10 flex items-center justify-between bg-white px-5 py-2.5">
<PageBreadcrumbs class="h-7" :items="[{ label: 'Data Sources' }]" />
<div>
<Button label="New Data Source" variant="solid" @click="new_dialog = true">
<template #prefix>
<PlusIcon class="w-4" />
</t... | 2302_79757062/insights | frontend/src/datasource/DataSourceList.vue | Vue | agpl-3.0 | 3,975 |
<script setup>
import PageBreadcrumbs from '@/components/PageBreadcrumbs.vue'
import TableRelationshipEditor from './TableRelationshipEditor.vue'
import useDataSource from './useDataSource'
import { provide } from 'vue'
const props = defineProps({
name: {
type: String,
required: true,
},
})
const dataSource = u... | 2302_79757062/insights | frontend/src/datasource/DataSourceRelationships.vue | Vue | agpl-3.0 | 973 |
<template>
<header class="sticky top-0 z-10 flex items-center bg-white px-5 py-2.5">
<PageBreadcrumbs
class="h-7"
:items="[
{
label: 'Data Sources',
href: '/data-source',
route: { path: '/data-source' },
},
{
label: props.name,
route: { path: `/data-source/${props.name}` },... | 2302_79757062/insights | frontend/src/datasource/DataSourceTable.vue | Vue | agpl-3.0 | 6,689 |
<template>
<td
v-for="col in $props.columns"
class="bg-gray-100 px-2.5 py-1.5 first:rounded-l-md last:rounded-r-md"
scope="col"
>
<div class="flex items-center">
<span class="mr-2 overflow-hidden text-ellipsis whitespace-nowrap">
{{ col.label }} : {{ col.type }}
</span>
<div class="h-6">
<Pop... | 2302_79757062/insights | frontend/src/datasource/DataSourceTableColumnHeader.vue | Vue | agpl-3.0 | 1,381 |
<script setup>
import Attachment from '@/components/Controls/Attachment.vue'
import Autocomplete from '@/components/Controls/Autocomplete.vue'
import useDataSourceStore from '@/stores/dataSourceStore'
import { FileUploader, createResource } from 'frappe-ui'
import { computed, reactive, ref, watch } from 'vue'
import Dr... | 2302_79757062/insights | frontend/src/datasource/FileSourceForm.vue | Vue | agpl-3.0 | 6,346 |
<script setup>
import Form from '@/pages/Form.vue'
import useDataSourceStore from '@/stores/dataSourceStore'
import { computed, reactive, ref } from 'vue'
const props = defineProps({ submitLabel: String })
const emit = defineEmits(['submit'])
const database = reactive({})
const form = ref(null)
const fields = [
{ na... | 2302_79757062/insights | frontend/src/datasource/MariaDBForm.vue | Vue | agpl-3.0 | 3,042 |
<script setup>
import useDataSourceStore from '@/stores/dataSourceStore'
import { computed, reactive, ref } from 'vue'
import Form from '../pages/Form.vue'
const props = defineProps({ submitLabel: String })
const emit = defineEmits(['submit'])
const database = reactive({})
const form = ref(null)
const fields = comput... | 2302_79757062/insights | frontend/src/datasource/PostgreSQLForm.vue | Vue | agpl-3.0 | 3,661 |
<script setup>
import sessionStore from '@/stores/sessionStore'
import { call } from 'frappe-ui'
import { inject, ref } from 'vue'
const emit = defineEmits(['submit'])
const selectedDataset = ref(null)
const sampleDatasets = [
{
name: 'ecommerce',
title: 'eCommerce',
description: 'An eCommerce dataset with orde... | 2302_79757062/insights | frontend/src/datasource/SampleDatasetList.vue | Vue | agpl-3.0 | 2,160 |
<script setup>
import { BaseEdge, EdgeLabelRenderer, getBezierPath, useVueFlow } from '@vue-flow/core'
import { computed, inject } from 'vue'
const props = defineProps({
id: { type: String, required: true },
sourceX: { type: Number, required: true },
sourceY: { type: Number, required: true },
targetX: { type: Numb... | 2302_79757062/insights | frontend/src/datasource/TableEdge.vue | Vue | agpl-3.0 | 1,896 |
<script setup>
import useDataSourceTable from '@/datasource/useDataSourceTable'
import { fieldtypesToIcon } from '@/utils'
import { Handle, Position } from '@vue-flow/core'
import { inject, ref, watch } from 'vue'
const state = inject('state')
const edges = inject('edges')
const props = defineProps({ tablename: { type... | 2302_79757062/insights | frontend/src/datasource/TableNode.vue | Vue | agpl-3.0 | 3,664 |
<script setup>
import { whenHasValue } from '@/utils'
import { MarkerType, VueFlow, useVueFlow } from '@vue-flow/core'
import { useStorage, watchDebounced } from '@vueuse/core'
import { Grip } from 'lucide-vue-next'
import { computed, inject, nextTick, provide, reactive, ref, watch } from 'vue'
import TableEdge from '.... | 2302_79757062/insights | frontend/src/datasource/TableRelationshipEditor.vue | Vue | agpl-3.0 | 7,933 |
<script setup>
import { computed } from 'vue'
import FileSourceForm from './FileSourceForm.vue'
const emit = defineEmits(['update:show'])
const props = defineProps({ show: Boolean })
const show = computed({
get: () => props.show,
set: (val) => emit('update:show', val),
})
</script>
<template>
<Dialog :options="{ t... | 2302_79757062/insights | frontend/src/datasource/UploadCSVFileDialog.vue | Vue | agpl-3.0 | 467 |
import { getDocumentResource } from '@/api'
import useCacheStore from '@/stores/cacheStore'
import { computed, reactive, ref, UnwrapRef } from 'vue'
function useDataSource(name: string) {
const cacheStore = useCacheStore()
if (cacheStore.getDataSource(name)) {
return cacheStore.getDataSource(name)
}
const resou... | 2302_79757062/insights | frontend/src/datasource/useDataSource.ts | TypeScript | agpl-3.0 | 3,830 |
import { fetchTableName, getDocumentResource } from '@/api'
import useCacheStore from '@/stores/cacheStore'
import { whenHasValue } from '@/utils'
import { useStorage } from '@vueuse/core'
import { UnwrapRef, computed, reactive } from 'vue'
export type GetTableParams =
| {
name: string
}
| {
table: string
... | 2302_79757062/insights | frontend/src/datasource/useDataSourceTable.ts | TypeScript | agpl-3.0 | 2,777 |
import {
Button,
FeatherIcon,
Input,
onOutsideClickDirective,
Dialog,
ErrorMessage,
Dropdown,
Badge,
Avatar,
Tooltip,
LoadingIndicator,
FormControl,
} from 'frappe-ui'
import Checkbox from '@/components/Controls/Checkbox.vue'
import Autocomplete from '@/components/Controls/Autocomplete.vue'
import Popover f... | 2302_79757062/insights | frontend/src/globals.js | JavaScript | agpl-3.0 | 1,358 |
<script setup>
import sessionStore from '@/stores/sessionStore'
import { inject } from 'vue'
import HomeOnboarding from './HomeOnboarding.vue'
import HomePinnedItems from './HomePinnedItems.vue'
import HomeQuickActions from './HomeQuickActions.vue'
import HomeRecentRecords from './HomeRecentRecords.vue'
const session ... | 2302_79757062/insights | frontend/src/home/Home.vue | Vue | agpl-3.0 | 929 |
<script setup>
import { useStorage } from '@vueuse/core'
import { computed, reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
import ProgressRing from './ProgressRing.vue'
const router = useRouter()
const showOnboarding = ref(false)
const steps = reactive([
{
title: 'Connect Your Data',
name: 'con... | 2302_79757062/insights | frontend/src/home/HomeOnboarding.vue | Vue | agpl-3.0 | 4,293 |
<script setup>
import { ref } from 'vue'
const showNewPinDialog = ref(false)
</script>
<template>
<div>
<div class="flex items-center space-x-2">
<div class="rounded bg-gray-100 p-1">
<FeatherIcon name="bookmark" class="h-4 w-4" />
</div>
<div class="text-lg">Pinned Charts</div>
</div>
<div class="... | 2302_79757062/insights | frontend/src/home/HomePinnedItems.vue | Vue | agpl-3.0 | 1,083 |
<template>
<div>
<div class="flex items-center space-x-2">
<div class="rounded bg-gray-100 p-1">
<FeatherIcon name="arrow-up-right" class="h-4 w-4" />
</div>
<div class="text-lg">Quick Actions</div>
</div>
<div class="mt-4 grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4">
<div
class="col... | 2302_79757062/insights | frontend/src/home/HomeQuickActions.vue | Vue | agpl-3.0 | 1,588 |
<script setup>
import { call } from 'frappe-ui'
import { inject, ref } from 'vue'
import { useRouter } from 'vue-router'
const $dayjs = inject('$dayjs')
const recent_records = ref([])
call('insights.api.home.get_last_viewed_records').then((data) => {
recent_records.value = data.map((d) => {
const record_type = d.r... | 2302_79757062/insights | frontend/src/home/HomeRecentRecords.vue | Vue | agpl-3.0 | 2,465 |
<script setup>
import { computed } from 'vue'
const props = defineProps({
progress: {
type: Number,
default: 0,
},
progressLabel: {
type: String,
default: '',
},
radius: {
type: Number,
default: 26,
},
stroke: {
type: Number,
default: 4,
},
})
const normalizedRadius = computed(() => props.radi... | 2302_79757062/insights | frontend/src/home/ProgressRing.vue | Vue | agpl-3.0 | 1,363 |
@import './assets/Inter/inter.css';
@import './assets/FiraCode/fira_code.css';
@import 'frappe-ui/src/style.css';
@import '@vue-flow/core/dist/style.css';
@import '@vue-flow/core/dist/theme-default.css';
.dataframe th {
@apply whitespace-nowrap border-r border-b bg-gray-50 py-2 px-4 text-left text-sm font-medium text... | 2302_79757062/insights | frontend/src/index.css | CSS | agpl-3.0 | 2,593 |
<template>
<div class="flex h-full w-full flex-col bg-gray-50">
<div class="flex items-center justify-between bg-white px-5 py-2.5 shadow-sm">
<slot name="navbar"></slot>
</div>
<div class="flex flex-1 overflow-hidden">
<slot name="content"></slot>
<div v-if="$slots.sidebar" class="flex flex-shrink-0 ov... | 2302_79757062/insights | frontend/src/layouts/BaseLayout.vue | Vue | agpl-3.0 | 408 |
import { autoAnimatePlugin } from '@formkit/auto-animate/vue'
import { frappeRequest, setConfig } from 'frappe-ui'
import { GridItem, GridLayout } from 'grid-layout-plus'
import { createPinia } from 'pinia'
import { createApp } from 'vue'
import App from './App.vue'
import './index.css'
import router from './router'
im... | 2302_79757062/insights | frontend/src/main.js | JavaScript | agpl-3.0 | 1,039 |
<script setup lang="jsx">
import PageBreadcrumbs from '@/components/PageBreadcrumbs.vue'
import useNotebook from '@/notebook/useNotebook'
import useNotebooks from '@/notebook/useNotebooks'
import { updateDocumentTitle } from '@/utils'
import { ListView } from 'frappe-ui'
import { PlusIcon, SearchIcon } from 'lucide-vue... | 2302_79757062/insights | frontend/src/notebook/Notebook.vue | Vue | agpl-3.0 | 3,276 |
<script setup lang="jsx">
import PageBreadcrumbs from '@/components/PageBreadcrumbs.vue'
import useNotebooks from '@/notebook/useNotebooks'
import { updateDocumentTitle } from '@/utils'
import { ListView } from 'frappe-ui'
import { PlusIcon, SearchIcon } from 'lucide-vue-next'
import { ref } from 'vue'
import { useRout... | 2302_79757062/insights | frontend/src/notebook/NotebookList.vue | Vue | agpl-3.0 | 3,056 |
<script setup lang="jsx">
import ContentEditable from '@/components/ContentEditable.vue'
import PageBreadcrumbs from '@/components/PageBreadcrumbs.vue'
import useNotebook from '@/notebook/useNotebook'
import useNotebookPage from '@/notebook/useNotebookPage'
import { updateDocumentTitle } from '@/utils'
import { compute... | 2302_79757062/insights | frontend/src/notebook/NotebookPage.vue | Vue | agpl-3.0 | 1,721 |
<script setup>
import { inject, ref } from 'vue'
import { useRouter } from 'vue-router'
const page = inject('page')
const show_delete_dialog = ref(false)
const router = useRouter()
function deletePage() {
const notebook_name = page.doc.notebook
page.delete().then(() => {
router.push(`/notebook/${notebook_name}`)
... | 2302_79757062/insights | frontend/src/notebook/NotebookPageDropdown.vue | Vue | agpl-3.0 | 1,113 |
<script setup>
import { LoadingIndicator } from 'frappe-ui'
const props = defineProps({
label: String,
icon: String,
iconComponent: Object,
action: Function,
loading: Boolean,
})
</script>
<template>
<div
class="flex h-8 cursor-pointer items-center rounded border border-gray-200 bg-white px-2 hover:bg-gray-50... | 2302_79757062/insights | frontend/src/notebook/blocks/BlockAction.vue | Vue | agpl-3.0 | 818 |
<script setup>
import UsePopover from '@/components/UsePopover.vue'
import { slideRightTransition } from '@/utils/transitions'
const props = defineProps({
blockRef: Object,
actions: {
type: Array,
default: () => [],
},
})
</script>
<template>
<UsePopover
v-if="blockRef"
:targetElement="blockRef"
placemen... | 2302_79757062/insights | frontend/src/notebook/blocks/BlockActions.vue | Vue | agpl-3.0 | 499 |
<script setup lang="jsx">
import useDashboards from '@/dashboard/useDashboards'
import { createChart, default as useChartOld } from '@/query/useChart'
import useQueryStore from '@/stores/queryStore'
import InvalidWidget from '@/widgets/InvalidWidget.vue'
import widgets from '@/widgets/widgets'
import { computed, inject... | 2302_79757062/insights | frontend/src/notebook/blocks/chart/ChartBlock.vue | Vue | agpl-3.0 | 4,608 |