-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from frappe/develop
chore: merge 'develop' into 'main'
- Loading branch information
Showing
109 changed files
with
2,120 additions
and
1,451 deletions.
There are no files selected for viewing
Submodule frappe-ui
updated
13 files
+3 −2 | package.json | |
+18 −12 | src/components/Autocomplete.vue | |
+1 −1 | src/components/Button.vue | |
+4 −1 | src/components/Checkbox.vue | |
+1 −0 | src/components/Select.vue | |
+54 −0 | src/components/TabButtons.vue | |
+1 −0 | src/components/TextInput.vue | |
+1 −0 | src/components/Textarea.vue | |
+1 −0 | src/index.js | |
+1 −1 | src/resources/documentResource.js | |
+6 −0 | src/style.css | |
+0 −14 | src/utils/vite-dev-server.js | |
+47 −0 | vite.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<script setup> | ||
import * as echarts from 'echarts' | ||
import { onBeforeUnmount, onMounted, ref, watch } from 'vue' | ||
const props = defineProps({ | ||
title: { type: String, required: false }, | ||
subtitle: { type: String, required: false }, | ||
options: { type: Object, required: true }, | ||
}) | ||
let eChart = null | ||
const chartRef = ref(null) | ||
onMounted(() => { | ||
eChart = echarts.init(chartRef.value, 'light', { renderer: 'svg' }) | ||
props.options && eChart.setOption(props.options) | ||
const resizeObserver = new ResizeObserver(() => eChart.resize()) | ||
setTimeout(() => chartRef.value && resizeObserver.observe(chartRef.value), 1000) | ||
onBeforeUnmount(() => chartRef.value && resizeObserver.unobserve(chartRef.value)) | ||
}) | ||
watch( | ||
() => props.options, | ||
() => eChart && eChart.setOption(props.options), | ||
{ deep: true } | ||
) | ||
defineExpose({ downloadChart }) | ||
function downloadChart() { | ||
const image = new Image() | ||
const type = 'png' | ||
image.src = eChart.getDataURL({ | ||
type, | ||
pixelRatio: 2, | ||
backgroundColor: '#fff', | ||
}) | ||
const link = document.createElement('a') | ||
link.href = image.src | ||
link.download = `${props.title}.${type}` | ||
link.click() | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="h-full w-full rounded p-2"> | ||
<div class="flex h-full w-full flex-col"> | ||
<div v-if="title" class="flex-shrink-0" :class="['mx-3', subtitle ? 'h-11' : 'h-6']"> | ||
<div class="text-lg font-normal leading-6 text-gray-800"> | ||
{{ title }} | ||
</div> | ||
<div v-if="subtitle" class="text-base font-light"> | ||
{{ subtitle }} | ||
</div> | ||
</div> | ||
<div ref="chartRef" class="w-full flex-1 overflow-hidden"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.