{title}
@@ -27,7 +22,7 @@
justify-content: flex-start;
align-items: center;
gap: var(--spacing-m);
- padding: var(--spacing-xs) var(--spacing-l);
+ padding: var(--spacing-s) var(--spacing-l);
color: var(--ink);
}
.dropdown-item.disabled,
@@ -35,9 +30,6 @@
pointer-events: none;
color: var(--grey-5);
}
- .dropdown-item.big {
- padding: var(--spacing-s) var(--spacing-l);
- }
.dropdown-item:not(.disabled):hover {
background-color: var(--grey-2);
cursor: pointer;
@@ -65,10 +57,6 @@
}
i {
- padding: 0.5rem;
- background-color: var(--grey-2);
- font-size: 24px;
- border-radius: var(--border-radius-s);
- color: var(--ink);
+ font-size: var(--font-size-m);
}
diff --git a/packages/builder/src/components/userInterface/ComponentSelectionList.svelte b/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte
similarity index 56%
rename from packages/builder/src/components/userInterface/ComponentSelectionList.svelte
rename to packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte
index 60f40be6e2..7ec58fc2c3 100644
--- a/packages/builder/src/components/userInterface/ComponentSelectionList.svelte
+++ b/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte
@@ -6,47 +6,62 @@
selectedComponent,
currentAssetId,
} from "builderStore"
- import components from "./temporaryPanelStructure.js"
+ import structure from "./componentStructure.json"
import { DropdownMenu } from "@budibase/bbui"
import { DropdownContainer, DropdownItem } from "components/common/Dropdowns"
- const categories = components.categories
+ $: enrichedStructure = enrichStructure(structure, $store.components)
+
let selectedIndex
let anchors = []
let popover
$: anchor = selectedIndex === -1 ? null : anchors[selectedIndex]
- const close = () => {
- popover.hide()
+ const enrichStructure = (structure, definitions) => {
+ let enrichedStructure = []
+ structure.forEach(item => {
+ if (typeof item === "string") {
+ const def = definitions[`@budibase/standard-components/${item}`]
+ if (def) {
+ enrichedStructure.push({
+ ...def,
+ isCategory: false,
+ })
+ }
+ } else {
+ enrichedStructure.push({
+ ...item,
+ isCategory: true,
+ children: enrichStructure(item.children || [], definitions),
+ })
+ }
+ })
+ return enrichedStructure
}
- const onCategoryChosen = (category, idx) => {
- if (category.isCategory) {
+ const onItemChosen = (item, idx) => {
+ if (item.isCategory) {
+ // Select and open this category
selectedIndex = idx
popover.show()
} else {
- onComponentChosen(category)
+ // Add this component
+ store.actions.components.create(item.component)
+ popover.hide()
}
}
-
- const onComponentChosen = component => {
- store.actions.components.create(component._component, component.presetProps)
- const path = store.actions.components.findRoute($selectedComponent)
- $goto(`./${$currentAssetId}/${path}`)
- close()
- }
- {#each categories as category, idx}
+ {#each enrichedStructure as item, idx}
@@ -56,12 +71,12 @@
{anchor}
align="left">
onCategoryChosen(category, idx)}
+ on:click={() => onItemChosen(item, idx)}
class:active={idx === selectedIndex}>
- {#if category.icon}{/if}
- {category.name}
- {#if category.isCategory}{/if}
+ {#if item.icon}{/if}
+ {item.name}
+ {#if item.isCategory}{/if}
{/each}
@@ -32,12 +32,12 @@
-
- {#if propertyGroupNames.length > 0}
- {#each propertyGroupNames as groupName}
+
+ {#if groups.length > 0}
+ {#each groups as groupName}
c._component === componentInstance._component
- ) || {}
-
- $: panelDefinition =
- componentPropDefinition.properties &&
- componentPropDefinition.properties[selectedCategory.value]
+ $: definition = store.actions.components.getDefinition(
+ $selectedComponent._component
+ )
+ $: isComponentOrScreen =
+ $store.currentView === "component" ||
+ $store.currentFrontEndType === FrontendTypes.SCREEN
+ $: isNotScreenslot = !$selectedComponent._component.endsWith("screenslot")
+ $: showDisplayName = isComponentOrScreen && isNotScreenslot
const onStyleChanged = store.actions.components.updateStyle
const onCustomStyleChanged = store.actions.components.updateCustomStyle
const onResetStyles = store.actions.components.resetStyles
- $: isComponentOrScreen =
- $store.currentView === "component" ||
- $store.currentFrontEndType === FrontendTypes.SCREEN
- $: isNotScreenslot = componentInstance._component !== "##builtin/screenslot"
-
- $: displayName =
- isComponentOrScreen && componentInstance._instanceName && isNotScreenslot
-
function walkProps(component, action) {
action(component)
if (component.children) {
@@ -89,24 +73,23 @@
{categories}
{selectedCategory} />
-{#if displayName}
-
{componentInstance._instanceName}
+{#if showDisplayName}
+ {$selectedComponent._instanceName}
{/if}
{#if selectedCategory.value === 'design'}
{:else if selectedCategory.value === 'settings'}
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/Checkbox.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/Checkbox.svelte
new file mode 100644
index 0000000000..5eaf81cdbc
--- /dev/null
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/Checkbox.svelte
@@ -0,0 +1,7 @@
+
+
+
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte
new file mode 100644
index 0000000000..63ce8da6c4
--- /dev/null
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ColorPicker.svelte
@@ -0,0 +1,7 @@
+
+
+
diff --git a/packages/builder/src/components/userInterface/DetailScreenSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DetailScreenSelect.svelte
similarity index 100%
rename from packages/builder/src/components/userInterface/DetailScreenSelect.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/DetailScreenSelect.svelte
diff --git a/packages/builder/src/components/userInterface/EventsEditor/EventEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventEditor.svelte
similarity index 98%
rename from packages/builder/src/components/userInterface/EventsEditor/EventEditor.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventEditor.svelte
index 5dd8f8a423..f15b87d867 100644
--- a/packages/builder/src/components/userInterface/EventsEditor/EventEditor.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventEditor.svelte
@@ -13,13 +13,12 @@
const EVENT_TYPE_KEY = "##eventHandlerType"
- export let event
+ export let actions
let addActionButton
let addActionDropdown
let selectedAction
- $: actions = event || []
$: selectedActionComponent =
selectedAction &&
actionTypes.find(t => t.name === selectedAction[EVENT_TYPE_KEY]).component
diff --git a/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventEditorModal.svelte
similarity index 100%
rename from packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventEditorModal.svelte
diff --git a/packages/builder/src/components/userInterface/EventsEditor/EventPropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte
similarity index 92%
rename from packages/builder/src/components/userInterface/EventsEditor/EventPropertyControl.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte
index 9340ec4c28..241864839a 100644
--- a/packages/builder/src/components/userInterface/EventsEditor/EventPropertyControl.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte
@@ -7,7 +7,7 @@
const dispatch = createEventDispatcher()
- export let value
+ export let value = []
export let name
let drawer
@@ -57,12 +57,12 @@
}
-
+
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/DeleteRow.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/DeleteRow.svelte
new file mode 100644
index 0000000000..e61fadd57b
--- /dev/null
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/DeleteRow.svelte
@@ -0,0 +1,72 @@
+
+
+
diff --git a/packages/builder/src/components/userInterface/EventsEditor/actions/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js
similarity index 100%
rename from packages/builder/src/components/userInterface/EventsEditor/actions/index.js
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/index.js
new file mode 100644
index 0000000000..8966c4ab26
--- /dev/null
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/index.js
@@ -0,0 +1,2 @@
+import EventsEditor from "./EventPropertyControl.svelte"
+export default EventsEditor
diff --git a/packages/builder/src/components/userInterface/FlatButton.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FlatButtonGroup/FlatButton.svelte
similarity index 100%
rename from packages/builder/src/components/userInterface/FlatButton.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/FlatButtonGroup/FlatButton.svelte
diff --git a/packages/builder/src/components/userInterface/FlatButtonGroup.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FlatButtonGroup/FlatButtonGroup.svelte
similarity index 100%
rename from packages/builder/src/components/userInterface/FlatButtonGroup.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/FlatButtonGroup/FlatButtonGroup.svelte
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FlatButtonGroup/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FlatButtonGroup/index.js
new file mode 100644
index 0000000000..5221ae4ef4
--- /dev/null
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FlatButtonGroup/index.js
@@ -0,0 +1,2 @@
+import FlatButtonGroup from "./FlatButtonGroup.svelte"
+export default FlatButtonGroup
diff --git a/packages/builder/src/components/userInterface/IconSelect/IconSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/IconSelect/IconSelect.svelte
similarity index 100%
rename from packages/builder/src/components/userInterface/IconSelect/IconSelect.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/IconSelect/IconSelect.svelte
diff --git a/packages/builder/src/components/userInterface/IconSelect/icons.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/IconSelect/icons.js
similarity index 100%
rename from packages/builder/src/components/userInterface/IconSelect/icons.js
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/IconSelect/icons.js
diff --git a/packages/builder/src/components/userInterface/IconSelect/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/IconSelect/index.js
similarity index 100%
rename from packages/builder/src/components/userInterface/IconSelect/index.js
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/IconSelect/index.js
diff --git a/packages/builder/src/components/userInterface/PropertyPanelControls/Input.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/Input.svelte
similarity index 100%
rename from packages/builder/src/components/userInterface/PropertyPanelControls/Input.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/Input.svelte
diff --git a/packages/builder/src/components/userInterface/LayoutSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/LayoutSelect.svelte
similarity index 84%
rename from packages/builder/src/components/userInterface/LayoutSelect.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/LayoutSelect.svelte
index 71bf7e1163..c85f86f409 100644
--- a/packages/builder/src/components/userInterface/LayoutSelect.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/LayoutSelect.svelte
@@ -1,5 +1,5 @@
-
+
+ {#if dataProviderComponents.length === 0}
+
+
+
diff --git a/packages/builder/src/components/userInterface/EventsEditor/actions/ExecuteQuery.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ExecuteQuery.svelte
similarity index 77%
rename from packages/builder/src/components/userInterface/EventsEditor/actions/ExecuteQuery.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ExecuteQuery.svelte
index 05171a0256..a59f1c4954 100644
--- a/packages/builder/src/components/userInterface/EventsEditor/actions/ExecuteQuery.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ExecuteQuery.svelte
@@ -1,22 +1,18 @@
+
+
+ Delete row can only be used within a component that provides data, such as
+ a List
+
+ {:else}
+
+
+ {/if}
+
+ {#if !dataProviderComponents.length}
+
+ {/if}
+ {/if}
+
+
+
diff --git a/packages/builder/src/components/userInterface/EventsEditor/actions/TriggerAutomation.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/TriggerAutomation.svelte
similarity index 98%
rename from packages/builder/src/components/userInterface/EventsEditor/actions/TriggerAutomation.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/TriggerAutomation.svelte
index 18431daf0a..3f61bbcb7e 100644
--- a/packages/builder/src/components/userInterface/EventsEditor/actions/TriggerAutomation.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/TriggerAutomation.svelte
@@ -91,7 +91,6 @@
{/if}
+ Save Row can only be used within a component that provides data, such as a
+ Repeater
+
+ {:else}
+
+
+
+ {#if parameters.providerId}
+
@@ -86,13 +68,13 @@
handleChange(key, val)}
- onChange={val => handleChange(key, val)}
+ value={safeValue}
+ on:change={handleChange}
+ onChange={handleChange}
{...props}
name={key} />
- {#if bindable && !key.startsWith('_') && control === Input}
+ {#if bindable && !key.startsWith('_') && type === 'text'}
{/if}
-
@@ -113,7 +94,7 @@
(temporaryBindableValue = e.detail)}
{bindableProperties} />
diff --git a/packages/builder/src/components/userInterface/PropertyGroup.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyGroup.svelte
similarity index 65%
rename from packages/builder/src/components/userInterface/PropertyGroup.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyGroup.svelte
index 69797c4a21..9d0bb4a40d 100644
--- a/packages/builder/src/components/userInterface/PropertyGroup.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyGroup.svelte
@@ -1,5 +1,4 @@
@@ -31,12 +27,13 @@
+{:else}
+
+{/if}
diff --git a/packages/builder/src/components/userInterface/TableViewSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewSelect.svelte
similarity index 89%
rename from packages/builder/src/components/userInterface/TableViewSelect.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewSelect.svelte
index 02ab2be12e..4e5201a180 100644
--- a/packages/builder/src/components/userInterface/TableViewSelect.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewSelect.svelte
@@ -1,4 +1,5 @@
@@ -93,12 +86,12 @@
class="dropdownbutton"
bind:this={anchorRight}
on:click={dropdownRight.show}>
- {value.label ? value.label : 'Table / View / Query'}
+ {value?.label ? value.label : 'Choose option'}
-{#if value.type === 'query'}
+{#if value?.type === 'query'}
-
+
{#each properties as prop}
onStyleChanged(styleCategory, key, value)}
- props={{ ...excludeProps(prop, ['control', 'label']) }} />
+ onChange={value => onStyleChanged(styleCategory, prop.key, value)}
+ props={getControlProps(prop)} />
{/each}
{/if}
diff --git a/packages/builder/src/components/userInterface/RoleSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/RoleSelect.svelte
similarity index 100%
rename from packages/builder/src/components/userInterface/RoleSelect.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/RoleSelect.svelte
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ScreenSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ScreenSelect.svelte
new file mode 100644
index 0000000000..993e49faa6
--- /dev/null
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ScreenSelect.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
diff --git a/packages/builder/src/components/userInterface/TableSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableSelect.svelte
similarity index 100%
rename from packages/builder/src/components/userInterface/TableSelect.svelte
rename to packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableSelect.svelte
diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewFieldSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewFieldSelect.svelte
new file mode 100644
index 0000000000..32935d8d0a
--- /dev/null
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewFieldSelect.svelte
@@ -0,0 +1,23 @@
+
+
+{#if multiselect}
+