Add back in component settings panel
This commit is contained in:
parent
168ec6634e
commit
271e302b10
|
@ -20,7 +20,7 @@ import {
|
||||||
} from "@budibase/string-templates"
|
} from "@budibase/string-templates"
|
||||||
import { TableNames } from "../constants"
|
import { TableNames } from "../constants"
|
||||||
import { JSONUtils } from "@budibase/frontend-core"
|
import { JSONUtils } from "@budibase/frontend-core"
|
||||||
import ActionDefinitions from "components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json"
|
import ActionDefinitions from "components/design/settings/controls/ButtonActionEditor/manifest.json"
|
||||||
|
|
||||||
// Regex to match all instances of template strings
|
// Regex to match all instances of template strings
|
||||||
const CAPTURE_VAR_INSIDE_TEMPLATE = /{{([^}]+)}}/g
|
const CAPTURE_VAR_INSIDE_TEMPLATE = /{{([^}]+)}}/g
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
import Editor from "components/integration/QueryEditor.svelte"
|
import Editor from "components/integration/QueryEditor.svelte"
|
||||||
import { debounce } from "lodash"
|
import { debounce } from "lodash"
|
||||||
import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte"
|
import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte"
|
||||||
import FilterDrawer from "components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte"
|
import FilterDrawer from "components/design/settings/controls/FilterEditor/FilterDrawer.svelte"
|
||||||
import { LuceneUtils } from "@budibase/frontend-core"
|
import { LuceneUtils } from "@budibase/frontend-core"
|
||||||
import { getSchemaForTable } from "builderStore/dataBinding"
|
import { getSchemaForTable } from "builderStore/dataBinding"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { ActionButton, Modal, ModalContent } from "@budibase/bbui"
|
import { ActionButton, Modal, ModalContent } from "@budibase/bbui"
|
||||||
import FilterDrawer from "components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte"
|
import FilterDrawer from "components/design/settings/controls/FilterEditor/FilterDrawer.svelte"
|
||||||
|
|
||||||
export let schema
|
export let schema
|
||||||
export let filters
|
export let filters
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
import { goto, params } from "@roxi/routify"
|
import { goto, params } from "@roxi/routify"
|
||||||
import { store, selectedAccessRole, screenSearchString } from "builderStore"
|
import { store, selectedAccessRole, screenSearchString } from "builderStore"
|
||||||
import { roles } from "stores/backend"
|
import { roles } from "stores/backend"
|
||||||
import ComponentNavigationTree from "components/design/NavigationPanel/ComponentNavigationTree/index.svelte"
|
import ComponentNavigationTree from "components/design/navigation/ComponentNavigationTree/index.svelte"
|
||||||
import Layout from "components/design/NavigationPanel/Layout.svelte"
|
import Layout from "components/design/navigation/Layout.svelte"
|
||||||
import NewLayoutModal from "components/design/NavigationPanel/NewLayoutModal.svelte"
|
import NewLayoutModal from "components/design/navigation/NewLayoutModal.svelte"
|
||||||
import {
|
import {
|
||||||
Icon,
|
Icon,
|
||||||
Modal,
|
Modal,
|
|
@ -5,7 +5,7 @@
|
||||||
import CurrentItemPreview from "components/design/AppPreview"
|
import CurrentItemPreview from "components/design/AppPreview"
|
||||||
import PropertiesPanel from "components/design/PropertiesPanel/PropertiesPanel.svelte"
|
import PropertiesPanel from "components/design/PropertiesPanel/PropertiesPanel.svelte"
|
||||||
import ComponentSelectionList from "components/design/AppPreview/ComponentSelectionList.svelte"
|
import ComponentSelectionList from "components/design/AppPreview/ComponentSelectionList.svelte"
|
||||||
import FrontendNavigatePane from "components/design/NavigationPanel/FrontendNavigatePane.svelte"
|
import FrontendNavigatePane from "components/design/navigation/FrontendNavigatePane.svelte"
|
||||||
import { goto, leftover, params } from "@roxi/routify"
|
import { goto, leftover, params } from "@roxi/routify"
|
||||||
import { FrontendTypes } from "constants"
|
import { FrontendTypes } from "constants"
|
||||||
import { findComponent, findComponentPath } from "builderStore/componentUtils"
|
import { findComponent, findComponentPath } from "builderStore/componentUtils"
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
import ThemeEditor from "components/design/AppPreview/ThemeEditor.svelte"
|
import ThemeEditor from "components/design/AppPreview/ThemeEditor.svelte"
|
||||||
import DevicePreviewSelect from "components/design/AppPreview/DevicePreviewSelect.svelte"
|
import DevicePreviewSelect from "components/design/AppPreview/DevicePreviewSelect.svelte"
|
||||||
import Logo from "assets/bb-space-man.svg"
|
import Logo from "assets/bb-space-man.svg"
|
||||||
import ScreenWizard from "components/design/NavigationPanel/ScreenWizard.svelte"
|
import ScreenWizard from "components/design/navigation/ScreenWizard.svelte"
|
||||||
|
|
||||||
// Cache previous values so we don't update the URL more than necessary
|
// Cache previous values so we don't update the URL more than necessary
|
||||||
let previousType
|
let previousType
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<slot />
|
<div class="body">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
@ -28,7 +30,6 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
overflow: auto;
|
|
||||||
}
|
}
|
||||||
.header {
|
.header {
|
||||||
flex: 0 0 48px;
|
flex: 0 0 48px;
|
||||||
|
@ -53,4 +54,13 @@
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
.body {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
overflow: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,24 +1,24 @@
|
||||||
import { Checkbox, Select, Stepper } from "@budibase/bbui"
|
import { Checkbox, Select, Stepper } from "@budibase/bbui"
|
||||||
import DataSourceSelect from "./DataSourceSelect.svelte"
|
import DataSourceSelect from "./controls/DataSourceSelect.svelte"
|
||||||
import S3DataSourceSelect from "./S3DataSourceSelect.svelte"
|
import S3DataSourceSelect from "./controls/S3DataSourceSelect.svelte"
|
||||||
import DataProviderSelect from "./DataProviderSelect.svelte"
|
import DataProviderSelect from "./controls/DataProviderSelect.svelte"
|
||||||
import ButtonActionEditor from "./ButtonActionEditor/ButtonActionEditor.svelte"
|
import ButtonActionEditor from "./controls/ButtonActionEditor/ButtonActionEditor.svelte"
|
||||||
import TableSelect from "./TableSelect.svelte"
|
import TableSelect from "./controls/TableSelect.svelte"
|
||||||
import ColorPicker from "./ColorPicker.svelte"
|
import ColorPicker from "./controls/ColorPicker.svelte"
|
||||||
import { IconSelect } from "./IconSelect"
|
import { IconSelect } from "./controls/IconSelect"
|
||||||
import FieldSelect from "./FieldSelect.svelte"
|
import FieldSelect from "./controls/FieldSelect.svelte"
|
||||||
import MultiFieldSelect from "./MultiFieldSelect.svelte"
|
import MultiFieldSelect from "./controls/MultiFieldSelect.svelte"
|
||||||
import SearchFieldSelect from "./SearchFieldSelect.svelte"
|
import SearchFieldSelect from "./controls/SearchFieldSelect.svelte"
|
||||||
import SchemaSelect from "./SchemaSelect.svelte"
|
import SchemaSelect from "./controls/SchemaSelect.svelte"
|
||||||
import SectionSelect from "./SectionSelect.svelte"
|
import SectionSelect from "./controls/SectionSelect.svelte"
|
||||||
import NavigationEditor from "./NavigationEditor/NavigationEditor.svelte"
|
import NavigationEditor from "./controls/NavigationEditor/NavigationEditor.svelte"
|
||||||
import FilterEditor from "./FilterEditor/FilterEditor.svelte"
|
import FilterEditor from "./controls/FilterEditor/FilterEditor.svelte"
|
||||||
import URLSelect from "./URLSelect.svelte"
|
import URLSelect from "./controls/URLSelect.svelte"
|
||||||
import OptionsEditor from "./OptionsEditor/OptionsEditor.svelte"
|
import OptionsEditor from "./controls/OptionsEditor/OptionsEditor.svelte"
|
||||||
import FormFieldSelect from "./FormFieldSelect.svelte"
|
import FormFieldSelect from "./controls/FormFieldSelect.svelte"
|
||||||
import ValidationEditor from "./ValidationEditor/ValidationEditor.svelte"
|
import ValidationEditor from "./controls/ValidationEditor/ValidationEditor.svelte"
|
||||||
import DrawerBindableCombobox from "components/common/bindings/DrawerBindableCombobox.svelte"
|
import DrawerBindableCombobox from "components/common/bindings/DrawerBindableCombobox.svelte"
|
||||||
import ColumnEditor from "./ColumnEditor/ColumnEditor.svelte"
|
import ColumnEditor from "./controls/ColumnEditor/ColumnEditor.svelte"
|
||||||
|
|
||||||
const componentMap = {
|
const componentMap = {
|
||||||
text: DrawerBindableCombobox,
|
text: DrawerBindableCombobox,
|
|
@ -1,5 +0,0 @@
|
||||||
<script>
|
|
||||||
import SettingsPanel from "components/design/SettingsPanel/SettingsPanel.svelte"
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<SettingsPanel title="Components" />
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import NavigationPanel from "components/design/NavigationPanel/NavigationPanel.svelte"
|
import NavigationPanel from "components/design/navigation/NavigationPanel.svelte"
|
||||||
import ComponentTree from "./ComponentTree.svelte"
|
import ComponentTree from "./ComponentTree.svelte"
|
||||||
import instantiateStore from "./dragDropStore.js"
|
import instantiateStore from "./dragDropStore.js"
|
||||||
import { goto } from "@roxi/routify"
|
import { goto } from "@roxi/routify"
|
|
@ -0,0 +1,37 @@
|
||||||
|
<script>
|
||||||
|
import SettingsPanel from "components/design/settings/SettingsPanel.svelte"
|
||||||
|
import { store, selectedComponent, currentAsset } from "builderStore"
|
||||||
|
import ComponentSettingsSection from "./ComponentSettingsSection.svelte"
|
||||||
|
import DesignSection from "./DesignSection.svelte"
|
||||||
|
import CustomStylesSection from "./CustomStylesSection.svelte"
|
||||||
|
import ConditionalUISection from "./ConditionalUISection.svelte"
|
||||||
|
import {
|
||||||
|
getBindableProperties,
|
||||||
|
getComponentBindableProperties,
|
||||||
|
} from "builderStore/dataBinding"
|
||||||
|
|
||||||
|
$: componentInstance = $selectedComponent
|
||||||
|
$: componentDefinition = store.actions.components.getDefinition(
|
||||||
|
$selectedComponent?._component
|
||||||
|
)
|
||||||
|
$: bindings = getBindableProperties($currentAsset, $store.selectedComponentId)
|
||||||
|
$: componentBindings = getComponentBindableProperties(
|
||||||
|
$currentAsset,
|
||||||
|
$store.selectedComponentId
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<SettingsPanel
|
||||||
|
title={$selectedComponent._instanceName}
|
||||||
|
icon={componentDefinition.icon}
|
||||||
|
>
|
||||||
|
<ComponentSettingsSection
|
||||||
|
{componentInstance}
|
||||||
|
{componentDefinition}
|
||||||
|
{bindings}
|
||||||
|
{componentBindings}
|
||||||
|
/>
|
||||||
|
<DesignSection {componentInstance} {componentDefinition} {bindings} />
|
||||||
|
<CustomStylesSection {componentInstance} {componentDefinition} {bindings} />
|
||||||
|
<ConditionalUISection {componentInstance} {componentDefinition} {bindings} />
|
||||||
|
</SettingsPanel>
|
|
@ -2,11 +2,11 @@
|
||||||
import { isEmpty } from "lodash/fp"
|
import { isEmpty } from "lodash/fp"
|
||||||
import { Input, DetailSummary, notifications } from "@budibase/bbui"
|
import { Input, DetailSummary, notifications } from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import PropertyControl from "./PropertyControls/PropertyControl.svelte"
|
import PropertyControl from "components/design/settings/controls/PropertyControl.svelte"
|
||||||
import LayoutSelect from "./PropertyControls/LayoutSelect.svelte"
|
import LayoutSelect from "components/design/settings/controls/LayoutSelect.svelte"
|
||||||
import RoleSelect from "./PropertyControls/RoleSelect.svelte"
|
import RoleSelect from "components/design/settings/controls/RoleSelect.svelte"
|
||||||
import ResetFieldsButton from "./PropertyControls/ResetFieldsButton.svelte"
|
import ResetFieldsButton from "components/design/settings/controls/ResetFieldsButton.svelte"
|
||||||
import { getComponentForSettingType } from "./PropertyControls/componentSettings"
|
import { getComponentForSettingType } from "components/design/settings/componentSettings"
|
||||||
import { Utils } from "@budibase/frontend-core"
|
import { Utils } from "@budibase/frontend-core"
|
||||||
|
|
||||||
export let componentDefinition
|
export let componentDefinition
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
const customSections = settings.filter(setting => setting.section)
|
const customSections = settings.filter(setting => setting.section)
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: componentDefinition?.name || "General",
|
name: "General",
|
||||||
info: componentDefinition?.info,
|
info: componentDefinition?.info,
|
||||||
settings: generalSettings,
|
settings: generalSettings,
|
||||||
},
|
},
|
|
@ -14,8 +14,8 @@
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
import { LuceneUtils, Constants } from "@budibase/frontend-core"
|
import { LuceneUtils, Constants } from "@budibase/frontend-core"
|
||||||
import { selectedComponent } from "builderStore"
|
import { selectedComponent } from "builderStore"
|
||||||
import { getComponentForSettingType } from "./componentSettings"
|
import { getComponentForSettingType } from "components/design/settings/componentSettings"
|
||||||
import PropertyControl from "./PropertyControl.svelte"
|
import PropertyControl from "components/design/settings/controls/PropertyControl.svelte"
|
||||||
import { getComponentSettings } from "builderStore/componentUtils"
|
import { getComponentSettings } from "builderStore/componentUtils"
|
||||||
|
|
||||||
export let conditions = []
|
export let conditions = []
|
|
@ -7,7 +7,7 @@
|
||||||
notifications,
|
notifications,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import ConditionalUIDrawer from "./PropertyControls/ConditionalUIDrawer.svelte"
|
import ConditionalUIDrawer from "./ConditionalUIDrawer.svelte"
|
||||||
|
|
||||||
export let componentInstance
|
export let componentInstance
|
||||||
export let bindings
|
export let bindings
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import PropertyControl from "./PropertyControls/PropertyControl.svelte"
|
import PropertyControl from "components/design/settings/controls/PropertyControl.svelte"
|
||||||
import { DetailSummary, notifications } from "@budibase/bbui"
|
import { DetailSummary, notifications } from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Input, Select } from "@budibase/bbui"
|
import { Input, Select } from "@budibase/bbui"
|
||||||
import ColorPicker from "./PropertyControls/ColorPicker.svelte"
|
import ColorPicker from "components/design/settings/controls/ColorPicker.svelte"
|
||||||
|
|
||||||
export const margin = {
|
export const margin = {
|
||||||
label: "Margin",
|
label: "Margin",
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import ComponentNavigationPanel from "./_components/ComponentNavigationPanel.svelte"
|
import ComponentNavigationPanel from "./_components/navigation/ComponentNavigationPanel.svelte"
|
||||||
import ComponentSettingsPanel from "./_components/ComponentSettingsPanel.svelte"
|
import ComponentSettingsPanel from "./_components/settings/ComponentSettingsPanel.svelte"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ComponentNavigationPanel />
|
<ComponentNavigationPanel />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import NavigationPanel from "components/design/NavigationPanel/NavigationPanel.svelte"
|
import NavigationPanel from "components/design/navigation/NavigationPanel.svelte"
|
||||||
import { goto } from "@roxi/routify"
|
import { goto } from "@roxi/routify"
|
||||||
import {
|
import {
|
||||||
Layout,
|
Layout,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import SettingsPanel from "components/design/SettingsPanel/SettingsPanel.svelte"
|
import SettingsPanel from "components/design/settings/SettingsPanel.svelte"
|
||||||
import { Body, Layout } from "@budibase/bbui"
|
import { Body, Layout } from "@budibase/bbui"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -62,14 +62,6 @@
|
||||||
notifications.error("Error deleting screen")
|
notifications.error("Error deleting screen")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pasteComponent = mode => {
|
|
||||||
try {
|
|
||||||
store.actions.components.paste(screen?.props, mode)
|
|
||||||
} catch (error) {
|
|
||||||
notifications.error("Error saving component")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ActionMenu>
|
<ActionMenu>
|
||||||
|
@ -77,13 +69,6 @@
|
||||||
<Icon size="S" hoverable name="MoreSmallList" />
|
<Icon size="S" hoverable name="MoreSmallList" />
|
||||||
</div>
|
</div>
|
||||||
<MenuItem icon="Duplicate" on:click={duplicateScreen}>Duplicate</MenuItem>
|
<MenuItem icon="Duplicate" on:click={duplicateScreen}>Duplicate</MenuItem>
|
||||||
<MenuItem
|
|
||||||
icon="ShowOneLayer"
|
|
||||||
on:click={() => pasteComponent("inside")}
|
|
||||||
disabled={!$store.componentToPaste}
|
|
||||||
>
|
|
||||||
Paste inside
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem icon="Delete" on:click={confirmDeleteDialog.show}>Delete</MenuItem>
|
<MenuItem icon="Delete" on:click={confirmDeleteDialog.show}>Delete</MenuItem>
|
||||||
</ActionMenu>
|
</ActionMenu>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { Search, Layout, Select } from "@budibase/bbui"
|
import { Search, Layout, Select } from "@budibase/bbui"
|
||||||
import NavigationPanel from "components/design/NavigationPanel/NavigationPanel.svelte"
|
import NavigationPanel from "components/design/navigation/NavigationPanel.svelte"
|
||||||
import { roles } from "stores/backend"
|
import { roles } from "stores/backend"
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import NavItem from "components/common/NavItem.svelte"
|
import NavItem from "components/common/NavItem.svelte"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import SettingsPanel from "components/design/SettingsPanel/SettingsPanel.svelte"
|
import SettingsPanel from "components/design/settings/SettingsPanel.svelte"
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { get as deepGet, setWith } from "lodash"
|
import { get as deepGet, setWith } from "lodash"
|
||||||
import {
|
import {
|
||||||
|
@ -10,8 +10,8 @@
|
||||||
Checkbox,
|
Checkbox,
|
||||||
notifications,
|
notifications,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import PropertyControl from "components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte"
|
import PropertyControl from "components/design/settings/controls/PropertyControl.svelte"
|
||||||
import RoleSelect from "components/design/PropertiesPanel/PropertyControls/RoleSelect.svelte"
|
import RoleSelect from "components/design/settings/controls/RoleSelect.svelte"
|
||||||
import { selectedScreen, store } from "builderStore"
|
import { selectedScreen, store } from "builderStore"
|
||||||
import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl"
|
import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import NavigationPanel from "components/design/NavigationPanel/NavigationPanel.svelte"
|
import NavigationPanel from "components/design/navigation/NavigationPanel.svelte"
|
||||||
import { Body, Layout } from "@budibase/bbui"
|
import { Body, Layout } from "@budibase/bbui"
|
||||||
import ThemeEditor from "./_components/ThemeEditor.svelte"
|
import ThemeEditor from "./_components/ThemeEditor.svelte"
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue