This commit is contained in:
Gerard Burns 2024-04-22 08:46:00 +01:00
parent 248764ce98
commit 9d4283e9ba
17 changed files with 21 additions and 30 deletions

View File

@ -31,17 +31,18 @@
$: updatePosition(anchor, tooltip) $: updatePosition(anchor, tooltip)
const handleMouseenter = (e) => { const handleMouseenter = () => {
hovering = true; hovering = true;
} }
const handleMouseleave = (e) => { const handleMouseleave = () => {
hovering = false; hovering = false;
} }
</script> </script>
<Portal {target}> <Portal {target}>
<div <div
role="tooltip"
on:mouseenter={handleMouseenter} on:mouseenter={handleMouseenter}
on:mouseleave={handleMouseleave} on:mouseleave={handleMouseleave}
style:left={`${x}px`} style:left={`${x}px`}

View File

@ -9,7 +9,6 @@
const updateTimeStamp = () => { const updateTimeStamp = () => {
timestamp = Date.now(); timestamp = Date.now();
console.log(timestamp);
if (run) { if (run) {
setTimeout(updateTimeStamp, 200) setTimeout(updateTimeStamp, 200)
} }

View File

@ -1,5 +1,4 @@
<script> <script>
import { Body } from "@budibase/bbui"
import { ExampleSection, ExampleLine, Block, Subject, Section } from './components' import { ExampleSection, ExampleLine, Block, Subject, Section } from './components'
export let schema export let schema

View File

@ -1,4 +1,3 @@
<script> <script>
import { import {
decodeJSBinding, decodeJSBinding,
@ -8,11 +7,10 @@
EditorModes, EditorModes,
} from "components/common/CodeEditor" } from "components/common/CodeEditor"
import { import {
readableToRuntimeBinding,
runtimeToReadableBinding, runtimeToReadableBinding,
getDatasourceForProvider getDatasourceForProvider
} from "dataBinding" } from "dataBinding"
import { tables, datasources, selectedScreen, selectedComponent } from "stores/builder" import { tables, selectedScreen, selectedComponent } from "stores/builder"
import { getBindings } from "components/backend/DataTable/formula" import { getBindings } from "components/backend/DataTable/formula"
export let value export let value

View File

@ -1,5 +1,6 @@
<script> <script>
import Section from "./Section.svelte" import Section from "./Section.svelte"
export let heading export let heading
</script> </script>

View File

@ -5,7 +5,6 @@
let body; let body;
const handleScroll = (e) => { const handleScroll = (e) => {
console.log("scroll");
if (!body) return; if (!body) return;
body.scrollTo({ top: body.scrollTop + e.deltaY, behavior: "smooth" }) body.scrollTo({ top: body.scrollTop + e.deltaY, behavior: "smooth" })

View File

@ -1,5 +1,3 @@
import { capitalize } from 'lodash';
export const messages = { export const messages = {
jsonPrimitivesOnly: Symbol("explanation-json-primitives-only"), jsonPrimitivesOnly: Symbol("explanation-json-primitives-only"),
stringAsNumber: Symbol("explanation-string-as-number"), stringAsNumber: Symbol("explanation-string-as-number"),
@ -56,7 +54,7 @@ const getSupportMessage = (type, explanation) => {
return null return null
} }
export const getExplanationMessagesAndSupport = (fieldSchema, explanation, typeSupportPresets) => { export const getExplanationMessagesAndSupport = (fieldSchema, explanation) => {
try { try {
const explanationMessagesAndSupport = { const explanationMessagesAndSupport = {
support: getSupport(fieldSchema.type, explanation), support: getSupport(fieldSchema.type, explanation),

View File

@ -1,5 +1,5 @@
<script> <script>
import { Line, InfoWord, DocumentationLink, Space, Text, Period } from "../typography" import { Line, InfoWord, DocumentationLink, Text, Period } from "../typography"
import subjects from '../subjects' import subjects from '../subjects'
export let columnName export let columnName

View File

@ -1,5 +1,5 @@
<script> <script>
import { Line, InfoWord, DocumentationLink, Space, Text, Period } from "../typography" import { Line, InfoWord, Text, Period } from "../typography"
import subjects from '../subjects' import subjects from '../subjects'
export let setExplanationSubject export let setExplanationSubject

View File

@ -1,5 +1,5 @@
<script> <script>
import { Line, InfoWord, DocumentationLink, Space, Text, Period, Comma } from "../typography" import { Line, InfoWord, Text, Period } from "../typography"
import subjects from '../subjects' import subjects from '../subjects'
export let setExplanationSubject export let setExplanationSubject

View File

@ -1,5 +1,5 @@
<script> <script>
import { Line, InfoWord, DocumentationLink, Space, Text, Period, Comma } from "../typography" import { Line, InfoWord, DocumentationLink, Space, Text } from "../typography"
import subjects from '../subjects' import subjects from '../subjects'
export let setExplanationSubject export let setExplanationSubject

View File

@ -1,5 +1,5 @@
<script> <script>
import { Line, InfoWord, DocumentationLink, Space, Text, Period } from "../typography" import { Line, InfoWord, Text, Period } from "../typography"
import subjects from '../subjects' import subjects from '../subjects'
export let setExplanationSubject export let setExplanationSubject

View File

@ -1,5 +1,5 @@
<script> <script>
import { Line, InfoWord, DocumentationLink, Space, Text, Period } from "../typography" import { Line, InfoWord, Text, Period } from "../typography"
import subjects from '../subjects' import subjects from '../subjects'
export let setExplanationSubject export let setExplanationSubject

View File

@ -1,5 +1,5 @@
<script> <script>
import { Line, InfoWord, DocumentationLink, Space, Text, Period } from "../typography" import { Line, InfoWord, Text, Period } from "../typography"
import subjects from '../subjects' import subjects from '../subjects'
export let setExplanationSubject export let setExplanationSubject

View File

@ -1,5 +1,5 @@
<script> <script>
import { Line, InfoWord, DocumentationLink, Space, Text, Period } from "../typography" import { Line, InfoWord, DocumentationLink, Text } from "../typography"
import subjects from '../subjects' import subjects from '../subjects'
import * as explanation from '../explanation' import * as explanation from '../explanation'

View File

@ -5,7 +5,7 @@
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { Explanation } from './Explanation' import { Explanation } from './Explanation'
import { debounce } from "lodash" import { debounce } from "lodash"
import { goto, params } from "@roxi/routify" import { params } from "@roxi/routify"
import { Constants } from "@budibase/frontend-core" import { Constants } from "@budibase/frontend-core"
import { FIELDS } from 'constants/backend' import { FIELDS } from 'constants/backend'
@ -53,11 +53,11 @@
} }
}, 200); }, 200);
const onOptionMouseenter = (e, option, idx) => { const onOptionMouseenter = (e, option) => {
updateTooltip(e, option); updateTooltip(e, option);
} }
const onOptionMouseleave = (e, option) => { const onOptionMouseleave = (e) => {
updateTooltip(e, null); updateTooltip(e, null);
} }
const getOptionIcon = optionKey => { const getOptionIcon = optionKey => {

View File

@ -1,5 +1,5 @@
<script> <script>
import { Icon, Heading, Multiselect, ContextTooltip } from "@budibase/bbui" import { Multiselect, ContextTooltip } from "@budibase/bbui"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding" import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { selectedScreen, import { selectedScreen,
componentStore, componentStore,
@ -7,7 +7,7 @@
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { Explanation } from './Explanation' import { Explanation } from './Explanation'
import { FIELDS } from 'constants/backend' import { FIELDS } from 'constants/backend'
import { goto, params } from "@roxi/routify" import { params } from "@roxi/routify"
import { debounce } from "lodash" import { debounce } from "lodash"
import { Constants } from "@budibase/frontend-core" import { Constants } from "@budibase/frontend-core"
@ -20,10 +20,6 @@
let currentOption = null let currentOption = null
let contextTooltipVisible = false let contextTooltipVisible = false
$: componentDefinition = componentStore.getDefinition(
componentInstance?._component
)
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
$: datasource = getDatasourceForProvider($selectedScreen, componentInstance) $: datasource = getDatasourceForProvider($selectedScreen, componentInstance)
$: schema = getSchemaForDatasource($selectedScreen, datasource).schema $: schema = getSchemaForDatasource($selectedScreen, datasource).schema
@ -87,11 +83,11 @@
} }
}, 200); }, 200);
const onOptionMouseenter = (e, option, idx) => { const onOptionMouseenter = (e, option) => {
updateTooltip(e, option); updateTooltip(e, option);
} }
const onOptionMouseleave = (e, option) => { const onOptionMouseleave = (e) => {
updateTooltip(e, null); updateTooltip(e, null);
} }
</script> </script>