Feedback updates

This commit is contained in:
Dean 2024-04-05 15:59:28 +01:00
parent b627a4bf37
commit e80a87f519
9 changed files with 26 additions and 24 deletions

View File

@ -10,7 +10,7 @@
export let width = 400 export let width = 400
export let height = 220 export let height = 220
export let saveIcon = false export let saveIcon = false
export let isDark export let darkMode
export function toDataUrl() { export function toDataUrl() {
// PNG to preserve transparency // PNG to preserve transparency
@ -146,7 +146,7 @@
}) })
</script> </script>
<div class="signature" class:light={!isDark} class:image-error={urlFailed}> <div class="signature" class:light={!darkMode} class:image-error={urlFailed}>
{#if !disabled} {#if !disabled}
<div class="overlay"> <div class="overlay">
{#if updated && saveIcon} {#if updated && saveIcon}

View File

@ -27,7 +27,7 @@
export let secondaryButtonText = undefined export let secondaryButtonText = undefined
export let secondaryAction = undefined export let secondaryAction = undefined
export let secondaryButtonWarning = false export let secondaryButtonWarning = false
export let enableGrid = true export let custom = false
const { hide, cancel } = getContext(Context.Modal) const { hide, cancel } = getContext(Context.Modal)
let loading = false let loading = false
@ -64,13 +64,13 @@
class:spectrum-Dialog--medium={size === "M"} class:spectrum-Dialog--medium={size === "M"}
class:spectrum-Dialog--large={size === "L"} class:spectrum-Dialog--large={size === "L"}
class:spectrum-Dialog--extraLarge={size === "XL"} class:spectrum-Dialog--extraLarge={size === "XL"}
class:no-grid={!enableGrid} class:no-grid={custom}
style="position: relative;" style="position: relative;"
role="dialog" role="dialog"
tabindex="-1" tabindex="-1"
aria-modal="true" aria-modal="true"
> >
<div class="modal-core" class:spectrum-Dialog-grid={enableGrid}> <div class="modal-core" class:spectrum-Dialog-grid={!custom}>
{#if title || $$slots.header} {#if title || $$slots.header}
<h1 <h1
class="spectrum-Dialog-heading spectrum-Dialog-heading--noHeader" class="spectrum-Dialog-heading spectrum-Dialog-heading--noHeader"

View File

@ -39,7 +39,7 @@
$: relationshipsEnabled = relationshipSupport(tableDatasource) $: relationshipsEnabled = relationshipSupport(tableDatasource)
$: currentTheme = $themeStore?.theme $: currentTheme = $themeStore?.theme
$: isDark = !currentTheme.includes("light") $: darkMode = !currentTheme.includes("light")
const relationshipSupport = datasource => { const relationshipSupport = datasource => {
const integration = $integrations[datasource?.source] const integration = $integrations[datasource?.source]
@ -59,7 +59,7 @@
<div class="wrapper"> <div class="wrapper">
<Grid <Grid
{API} {API}
{isDark} {darkMode}
datasource={gridDatasource} datasource={gridDatasource}
canAddRows={!isUsersTable} canAddRows={!isUsersTable}
canDeleteRows={!isUsersTable} canDeleteRows={!isUsersTable}

View File

@ -23,7 +23,6 @@
appStore, appStore,
dndComponentPath, dndComponentPath,
dndIsDragging, dndIsDragging,
themeStore,
} from "stores" } from "stores"
import { Helpers } from "@budibase/bbui" import { Helpers } from "@budibase/bbui"
import { getActiveConditions, reduceConditionActions } from "utils/conditions" import { getActiveConditions, reduceConditionActions } from "utils/conditions"
@ -193,7 +192,9 @@
let pad = false let pad = false
$: pad = pad || (interactive && hasChildren && inDndPath) $: pad = pad || (interactive && hasChildren && inDndPath)
$: $dndIsDragging, (pad = false) $: $dndIsDragging, (pad = false)
$: isDark = !$themeStore.theme?.includes("light")
$: currentTheme = $context?.device?.theme
$: darkMode = !currentTheme?.includes("light")
// Update component context // Update component context
$: store.set({ $: store.set({
@ -224,7 +225,7 @@
parent: id, parent: id,
ancestors: [...($component?.ancestors ?? []), instance._component], ancestors: [...($component?.ancestors ?? []), instance._component],
path: [...($component?.path ?? []), id], path: [...($component?.path ?? []), id],
isDark, darkMode,
}) })
const initialise = (instance, force = false) => { const initialise = (instance, force = false) => {

View File

@ -35,7 +35,8 @@
let grid let grid
$: isDark = $component.isDark $: currentTheme = $context?.device?.theme
$: darkMode = !currentTheme?.includes("light")
$: columnWhitelist = parsedColumns $: columnWhitelist = parsedColumns
?.filter(col => col.active) ?.filter(col => col.active)
?.map(col => col.field) ?.map(col => col.field)
@ -115,7 +116,7 @@
<Grid <Grid
bind:this={grid} bind:this={grid}
datasource={table} datasource={table}
{isDark} {darkMode}
{API} {API}
{stripeRows} {stripeRows}
{initialFilter} {initialFilter}

View File

@ -75,14 +75,14 @@
} }
$: currentTheme = $context?.device?.theme $: currentTheme = $context?.device?.theme
$: isDark = !currentTheme?.includes("light") $: darkMode = !currentTheme?.includes("light")
</script> </script>
<SignatureModal <SignatureModal
onConfirm={saveSignature} onConfirm={saveSignature}
title={fieldSchema?.name} title={fieldSchema?.name}
value={fieldState?.value} value={fieldState?.value}
{isDark} {darkMode}
bind:this={modal} bind:this={modal}
/> />
@ -113,7 +113,7 @@
{:else} {:else}
<div class="signature-field"> <div class="signature-field">
<CoreSignature <CoreSignature
{isDark} {darkMode}
disabled={$builderStore.inBuilder || disabled} disabled={$builderStore.inBuilder || disabled}
editable={false} editable={false}
value={fieldState?.value} value={fieldState?.value}

View File

@ -4,7 +4,7 @@
export let onConfirm = () => {} export let onConfirm = () => {}
export let value export let value
export let title export let title
export let isDark export let darkMode
export const show = () => { export const show = () => {
modal.show() modal.show()
@ -19,7 +19,7 @@
showConfirmButton showConfirmButton
showCancelButton={false} showCancelButton={false}
showCloseIcon={false} showCloseIcon={false}
enableGrid={false} custom
showDivider={false} showDivider={false}
onConfirm={() => { onConfirm={() => {
onConfirm(canvas) onConfirm(canvas)
@ -29,7 +29,7 @@
<Body>{title}</Body> <Body>{title}</Body>
</div> </div>
<div class="signature-wrap modal"> <div class="signature-wrap modal">
<CoreSignature {isDark} {value} saveIcon={false} bind:this={canvas} /> <CoreSignature {darkMode} {value} saveIcon={false} bind:this={canvas} />
</div> </div>
</ModalContent> </ModalContent>
</Modal> </Modal>

View File

@ -31,7 +31,7 @@
} }
const onKeyDown = () => { const onKeyDown = () => {
return isOpen return false
} }
const open = () => { const open = () => {
@ -81,7 +81,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<div <div
class="signature-cell" class="signature-cell"
class:light={!($props?.isDark || undefined)} class:light={!$props?.darkMode}
class:editable class:editable
on:click={editable ? open : null} on:click={editable ? open : null}
> >
@ -95,7 +95,7 @@
onConfirm={saveSignature} onConfirm={saveSignature}
title={schema?.name} title={schema?.name}
{value} {value}
isDark={$props.isDark} darkMode={$props.darkMode}
bind:this={modal} bind:this={modal}
/> />
@ -104,7 +104,7 @@
{#if signature?.key} {#if signature?.key}
<div class="signature-wrap"> <div class="signature-wrap">
<CoreSignature <CoreSignature
isDark={$props.isDark} darkMode={$props.darkMode}
editable={false} editable={false}
{value} {value}
on:change={saveSignature} on:change={saveSignature}

View File

@ -49,7 +49,7 @@
export let notifySuccess = null export let notifySuccess = null
export let notifyError = null export let notifyError = null
export let buttons = null export let buttons = null
export let isDark export let darkMode
// Unique identifier for DOM nodes inside this instance // Unique identifier for DOM nodes inside this instance
const rand = Math.random() const rand = Math.random()
@ -102,7 +102,7 @@
notifySuccess, notifySuccess,
notifyError, notifyError,
buttons, buttons,
isDark, darkMode,
}) })
// Set context for children to consume // Set context for children to consume