Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin author enhancements #15268

Merged
merged 7 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/client/src/components/preview/SettingsBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
value={option.value}
icon={option.barIcon}
title={option.barTitle || option.label}
disabled={!!setting.license}
{component}
/>
{/each}
Expand All @@ -281,6 +282,7 @@
prop={setting.key}
options={setting.options}
label={setting.label}
disabled={!!setting.license}
{component}
/>
{/if}
Expand All @@ -289,11 +291,16 @@
prop={setting.key}
icon={setting.barIcon}
title={setting.barTitle || setting.label}
disabled={!!setting.license}
bool
{component}
/>
{:else if setting.type === "color"}
<SettingsColorPicker prop={setting.key} {component} />
<SettingsColorPicker
prop={setting.key}
{component}
disabled={!!setting.license}
/>
{/if}
{#if setting.barSeparator !== false && (settings.length != idx + 1 || !isRoot)}
<div class="divider" />
Expand Down
6 changes: 6 additions & 0 deletions packages/client/src/components/preview/SettingsButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
export let bool = false
export let active = false
export let component
export let disabled = false

const dispatch = createEventDispatcher()

Expand All @@ -22,6 +23,7 @@
<div
{title}
class:active
class:disabled
on:click={() => {
if (prop) {
const newValue = bool ? !currentValue : value
Expand Down Expand Up @@ -50,4 +52,8 @@
background-color: rgba(13, 102, 208, 0.1);
color: var(--spectrum-global-color-blue-600);
}
.disabled {
pointer-events: none;
color: var(--spectrum-global-color-gray-400);
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

export let prop
export let component
export let disabled = false

$: currentValue = component?.[prop]
</script>

<div>
<div class:disabled>
<ColorPicker
size="S"
value={currentValue}
value={disabled ? null : currentValue}
on:change={e => {
if (prop) {
builderStore.actions.updateProp(prop, e.detail)
Expand All @@ -24,4 +25,7 @@
div {
padding: 0 4px;
}
div.disabled {
pointer-events: none;
}
</style>
2 changes: 2 additions & 0 deletions packages/client/src/components/preview/SettingsPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
export let options
export let label
export let component
export let disabled = false

$: currentValue = component?.[prop]
</script>
Expand All @@ -16,6 +17,7 @@
autoWidth
placeholder={label}
{options}
{disabled}
value={currentValue}
on:change={e => {
if (prop) {
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
memo,
derivedMemo,
} from "@budibase/frontend-core"
import { createValidatorFromConstraints } from "components/app/forms/validation"

export default {
API,
Expand Down Expand Up @@ -81,6 +82,7 @@ export default {
generateGoldenSample: RowUtils.generateGoldenSample,
memo,
derivedMemo,
createValidatorFromConstraints,

// Components
Provider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const HPadding = 40
export const ScrollBarSize = 8
export const GutterWidth = 72
export const DefaultColumnWidth = 200
export const MinColumnWidth = 80
export const MinColumnWidth = 56
export const NewRowID = "new"
export const BlankRowID = "blank"
export const GeneratedIDPrefix = "‽‽"
Expand Down
Loading