Update file structure to be sensible for design section

This commit is contained in:
Andrew Kingston 2021-01-14 09:45:09 +00:00
parent cc62a9c053
commit 2200039935
71 changed files with 97 additions and 201 deletions

View File

@ -5,7 +5,7 @@
import { Button, Input, Select, Label } from "@budibase/bbui" import { Button, Input, Select, Label } from "@budibase/bbui"
import { automationStore } from "builderStore" import { automationStore } from "builderStore"
import WebhookDisplay from "../Shared/WebhookDisplay.svelte" import WebhookDisplay from "../Shared/WebhookDisplay.svelte"
import BindableInput from "components/userInterface/BindableInput.svelte" import BindableInput from "./BindableInput.svelte"
export let block export let block
export let webhookModal export let webhookModal

View File

@ -1,5 +1,5 @@
<script> <script>
import GenericBindingPopover from "./GenericBindingPopover.svelte" import GenericBindingPopover from "../../userInterface/PropertiesPanel/GenericBindingPopover.svelte"
import { Input, Icon } from "@budibase/bbui" import { Input, Icon } from "@budibase/bbui"
export let bindings = [] export let bindings = []

View File

@ -1,7 +1,7 @@
<script> <script>
import { backendUiStore } from "builderStore" import { backendUiStore } from "builderStore"
import { Input, Select, Label } from "@budibase/bbui" import { Select } from "@budibase/bbui"
import BindableInput from "../../userInterface/BindableInput.svelte" import BindableInput from "./BindableInput.svelte"
export let value export let value
export let bindings export let bindings

View File

@ -9,10 +9,10 @@
selectedAccessRole, selectedAccessRole,
} from "builderStore" } from "builderStore"
import { FrontendTypes } from "constants" import { FrontendTypes } from "constants"
import ComponentNavigationTree from "components/userInterface/ComponentNavigationTree/index.svelte" import ComponentNavigationTree from "components/userInterface/NavigationPanel/ComponentNavigationTree/index.svelte"
import Layout from "components/userInterface/Layout.svelte" import Layout from "components/userInterface/NavigationPanel/Layout.svelte"
import NewScreenModal from "components/userInterface/NewScreenModal.svelte" import NewScreenModal from "components/userInterface/NavigationPanel/NewScreenModal.svelte"
import NewLayoutModal from "components/userInterface/NewLayoutModal.svelte" import NewLayoutModal from "components/userInterface/NavigationPanel/NewLayoutModal.svelte"
import { Modal, Switcher, Select } from "@budibase/bbui" import { Modal, Switcher, Select } from "@budibase/bbui"
const tabs = [ const tabs = [

View File

@ -1,6 +1,6 @@
<script> <script>
import { TextArea, DetailSummary, Button } from "@budibase/bbui" import { TextArea, DetailSummary, Button } from "@budibase/bbui"
import PropertyGroup from "./PropertyGroup.svelte" import PropertyGroup from "./PropertyPanelControls/PropertyGroup.svelte"
import FlatButtonGroup from "./PropertyPanelControls/FlatButtonGroup" import FlatButtonGroup from "./PropertyPanelControls/FlatButtonGroup"
import { allStyles } from "./componentStyles" import { allStyles } from "./componentStyles"

View File

@ -0,0 +1,7 @@
<script>
import Checkbox from "components/common/Checkbox.svelte"
export let value
</script>
<Checkbox checked={value} on:change />

View File

@ -0,0 +1,7 @@
<script>
import Colorpicker from "@budibase/colorpicker"
export let value
</script>
<Colorpicker value={value || '#000'} on:change />

View File

@ -41,53 +41,53 @@
newOrExisting = "existing" newOrExisting = "existing"
parameters.newAutomationName = "" parameters.newAutomationName = ""
} }
</script> </script>
<div class="root"> <div class="root">
<div class="radio-container" on:click={setNew}> <div class="radio-container" on:click={setNew}>
<input <input
type="radio" type="radio"
value="new" value="new"
bind:group={newOrExisting} bind:group={newOrExisting}
disabled={!hasAutomations}> disabled={!hasAutomations} />
<Label disabled={!hasAutomations}>Create a new automation</Label> <Label disabled={!hasAutomations}>Create a new automation</Label>
</div> </div>
<div class="radio-container" on:click={setExisting}> <div class="radio-container" on:click={setExisting}>
<input <input
type="radio" type="radio"
value="existing" value="existing"
bind:group={newOrExisting} bind:group={newOrExisting}
disabled={!hasAutomations}> disabled={!hasAutomations} />
<Label disabled={!hasAutomations}>Use an existing automation</Label> <Label disabled={!hasAutomations}>Use an existing automation</Label>
</div> </div>
<Label size="m" color="dark">Automation</Label> <Label size="m" color="dark">Automation</Label>
{#if newOrExisting=== "existing"} {#if newOrExisting === 'existing'}
<Select secondary bind:value={parameters.automationId} placeholder="Choose automation"> <Select
secondary
bind:value={parameters.automationId}
placeholder="Choose automation">
<option value="" /> <option value="" />
{#each automations as automation} {#each automations as automation}
<option value={automation._id}>{automation.name}</option> <option value={automation._id}>{automation.name}</option>
{/each} {/each}
</Select> </Select>
{:else} {:else}
<Input secondary bind:value={parameters.newAutomationName} placeholder="Enter automation name" /> <Input
secondary
bind:value={parameters.newAutomationName}
placeholder="Enter automation name" />
{/if} {/if}
<SaveFields <SaveFields
parameterFields={parameters.fields} parameterFields={parameters.fields}
schemaFields={newOrExisting === "existing" && selectedAutomation && selectedAutomation.schema} schemaFields={newOrExisting === 'existing' && selectedAutomation && selectedAutomation.schema}
fieldLabel="Field" fieldLabel="Field"
on:fieldschanged={onFieldsChanged} /> on:fieldschanged={onFieldsChanged} />
</div> </div>
<style> <style>
@ -127,5 +127,4 @@
.radio-container > input:focus { .radio-container > input:focus {
outline: none; outline: none;
} }
</style> </style>

View File

@ -0,0 +1,5 @@
<script>
import TableViewFieldSelect from "./TableViewFieldSelect.svelte"
</script>
<TableViewFieldSelect {...$$props} multiselect />

View File

@ -1,7 +1,7 @@
<script> <script>
import { onMount } from "svelte" import { onMount } from "svelte"
import Portal from "svelte-portal" import Portal from "svelte-portal"
import { buildStyle } from "../../../helpers.js" import { buildStyle } from "../../../../helpers.js"
export let options = [] export let options = []
export let value = "" export let value = ""

View File

@ -8,7 +8,7 @@
runtimeToReadableBinding, runtimeToReadableBinding,
} from "builderStore/replaceBindings" } from "builderStore/replaceBindings"
import { DropdownMenu } from "@budibase/bbui" import { DropdownMenu } from "@budibase/bbui"
import BindingDropdown from "components/userInterface/BindingDropdown.svelte" import BindingDropdown from "components/userInterface/PropertiesPanel/BindingDropdown.svelte"
export let label = "" export let label = ""
export let bindable = true export let bindable = true

View File

@ -1,5 +1,5 @@
<script> <script>
import PropertyControl from "./PropertyPanelControls/PropertyControl.svelte" import PropertyControl from "./PropertyControl.svelte"
import { DetailSummary } from "@budibase/bbui" import { DetailSummary } from "@budibase/bbui"
export let name = "" export let name = ""
@ -10,14 +10,6 @@
export let open = false export let open = false
const hasPropChanged = (style, prop) => { const hasPropChanged = (style, prop) => {
// TODO: replace color picker with one that works better.
// Currently it cannot support null values, so this is a hack which
// prevents the color fields from always being marked as changed
if (!["color", "background", "border-color"].includes(prop.key)) {
if (prop.initialValue !== undefined) {
return style[prop.key] !== prop.initialValue
}
}
return style[prop.key] != null && style[prop.key] !== "" return style[prop.key] != null && style[prop.key] !== ""
} }

View File

@ -1,8 +1,8 @@
<script> <script>
import { Button, Icon, DropdownMenu, Spacer, Heading } from "@budibase/bbui" import { Icon, DropdownMenu, Heading } from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { store, backendUiStore, currentAsset } from "builderStore" import { store, backendUiStore, currentAsset } from "builderStore"
import fetchBindableProperties from "../../../builderStore/fetchBindableProperties" import fetchBindableProperties from "builderStore/fetchBindableProperties"
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
let anchorRight, dropdownRight let anchorRight, dropdownRight

View File

@ -8,16 +8,16 @@
import LayoutSelect from "./PropertyPanelControls/LayoutSelect.svelte" import LayoutSelect from "./PropertyPanelControls/LayoutSelect.svelte"
import RoleSelect from "./PropertyPanelControls/RoleSelect.svelte" import RoleSelect from "./PropertyPanelControls/RoleSelect.svelte"
import OptionSelect from "./PropertyPanelControls/OptionSelect.svelte" import OptionSelect from "./PropertyPanelControls/OptionSelect.svelte"
import MultiTableViewFieldSelect from "./MultiTableViewFieldSelect.svelte" import MultiTableViewFieldSelect from "./PropertyPanelControls/MultiTableViewFieldSelect.svelte"
import Checkbox from "../common/Checkbox.svelte" import Checkbox from "./PropertyPanelControls/Checkbox.svelte"
import TableSelect from "components/userInterface/PropertyPanelControls/TableSelect.svelte" import TableSelect from "components/userInterface/PropertyPanelControls/TableSelect.svelte"
import TableViewSelect from "components/userInterface/PropertyPanelControls/TableViewSelect.svelte" import TableViewSelect from "components/userInterface/PropertyPanelControls/TableViewSelect.svelte"
import TableViewFieldSelect from "components/userInterface/PropertyPanelControls/TableViewFieldSelect.svelte" import TableViewFieldSelect from "components/userInterface/PropertyPanelControls/TableViewFieldSelect.svelte"
import EventsEditor from "components/userInterface/PropertyPanelControls/EventsEditor" import EventsEditor from "components/userInterface/PropertyPanelControls/EventsEditor"
import ScreenSelect from "components/userInterface/PropertyPanelControls/ScreenSelect.svelte" import ScreenSelect from "components/userInterface/PropertyPanelControls/ScreenSelect.svelte"
import DetailScreenSelect from "components/userInterface/DetailScreenSelect.svelte" import DetailScreenSelect from "components/userInterface/PropertyPanelControls/DetailScreenSelect.svelte"
import IconSelect from "components/userInterface/PropertyPanelControls/IconSelect" import IconSelect from "components/userInterface/PropertyPanelControls/IconSelect"
import Colorpicker from "@budibase/colorpicker" import ColorPicker from "./ComponentPropertiesPanel.svelte"
export let componentDefinition = {} export let componentDefinition = {}
export let componentInstance = {} export let componentInstance = {}
@ -43,6 +43,7 @@
detailURL: DetailScreenSelect, detailURL: DetailScreenSelect,
boolean: Checkbox, boolean: Checkbox,
number: Input, number: Input,
event: EventsEditor,
} }
const getControl = type => { const getControl = type => {
return controlMap[type] return controlMap[type]

View File

@ -1,7 +1,7 @@
import Input from "./PropertyPanelControls/Input.svelte" import Input from "./PropertyPanelControls/Input.svelte"
import OptionSelect from "./PropertyPanelControls/OptionSelect.svelte" import OptionSelect from "./PropertyPanelControls/OptionSelect.svelte"
import FlatButtonGroup from "./PropertyPanelControls/FlatButtonGroup" import FlatButtonGroup from "./PropertyPanelControls/FlatButtonGroup"
import Colorpicker from "@budibase/colorpicker" import Colorpicker from "./PropertyPanelControls/ColorPicker.svelte"
export const layout = [ export const layout = [
{ {
@ -467,7 +467,6 @@ export const typography = [
label: "Color", label: "Color",
key: "color", key: "color",
control: Colorpicker, control: Colorpicker,
initialValue: "#000",
}, },
{ {
label: "align", label: "align",
@ -511,7 +510,6 @@ export const background = [
label: "Color", label: "Color",
key: "background", key: "background",
control: Colorpicker, control: Colorpicker,
initialValue: "#000",
}, },
{ {
label: "Gradient", label: "Gradient",
@ -634,7 +632,6 @@ export const border = [
label: "Color", label: "Color",
key: "border-color", key: "border-color",
control: Colorpicker, control: Colorpicker,
initialValue: "#000",
}, },
{ {
label: "Style", label: "Style",

View File

@ -1,13 +1,13 @@
import Input from "./PropertyPanelControls/Input.svelte" import Input from "./PropertiesPanel/PropertyPanelControls/Input.svelte"
import OptionSelect from "./PropertyPanelControls/OptionSelect.svelte" import OptionSelect from "./PropertiesPanel/PropertyPanelControls/OptionSelect.svelte"
import MultiTableViewFieldSelect from "./MultiTableViewFieldSelect.svelte" import MultiTableViewFieldSelect from "./PropertiesPanel/PropertyPanelControls/MultiTableViewFieldSelect.svelte"
import Checkbox from "../common/Checkbox.svelte" import Checkbox from "../common/Checkbox.svelte"
import TableSelect from "components/userInterface/PropertyPanelControls/TableSelect.svelte" import TableSelect from "components/userInterface/PropertyPanelControls/TableSelect.svelte"
import TableViewSelect from "components/userInterface/PropertyPanelControls/TableViewSelect.svelte" import TableViewSelect from "components/userInterface/PropertyPanelControls/TableViewSelect.svelte"
import TableViewFieldSelect from "components/userInterface/PropertyPanelControls/TableViewFieldSelect.svelte" import TableViewFieldSelect from "components/userInterface/PropertyPanelControls/TableViewFieldSelect.svelte"
import Event from "components/userInterface/PropertyPanelControls/EventsEditor/EventPropertyControl.svelte" import Event from "components/userInterface/PropertyPanelControls/EventsEditor/EventPropertyControl.svelte"
import ScreenSelect from "components/userInterface/PropertyPanelControls/ScreenSelect.svelte" import ScreenSelect from "components/userInterface/PropertyPanelControls/ScreenSelect.svelte"
import DetailScreenSelect from "components/userInterface/DetailScreenSelect.svelte" import DetailScreenSelect from "components/userInterface/PropertyPanelControls/DetailScreenSelect.svelte"
import { IconSelect } from "components/userInterface/PropertyPanelControls/IconSelect" import { IconSelect } from "components/userInterface/PropertyPanelControls/IconSelect"
import Colorpicker from "@budibase/colorpicker" import Colorpicker from "@budibase/colorpicker"
@ -37,28 +37,7 @@ export default {
}, },
children: [], children: [],
}, },
{
_component: "@budibase/standard-components/button",
name: "Button",
description: "A basic html button that is ready for styling",
icon: "ri-share-box-line",
children: [],
properties: {
design: {
...all,
},
settings: [
{ label: "Text", key: "text", control: Input },
{
label: "Disabled",
key: "disabled",
valueKey: "checked",
control: Checkbox,
},
{ label: "On Click", key: "onClick", control: Event },
],
},
},
{ {
name: "Form", name: "Form",
icon: "ri-file-edit-line", icon: "ri-file-edit-line",

View File

@ -1,78 +0,0 @@
<script>
export let meta = []
export let size = ""
export let values = []
export let propertyName
export let onStyleChanged = () => {}
let selectedLayoutValues = values.map(v => v)
$: onStyleChanged(selectedLayoutValues)
const PROPERTY_OPTIONS = {
Direction: {
vertical: ["column", "ri-arrow-up-down-line"],
horizontal: ["row", "ri-arrow-left-right-line"],
},
Align: {
left: ["flex-start", "ri-layout-bottom-line"],
center: ["center", "ri-layout-row-line"],
right: ["flex-end", "ri-layout-top-line"],
space: ["space-between", "ri-space"],
},
Justify: {
left: ["flex-start", "ri-layout-left-line"],
center: ["center", "ri-layout-column-line"],
right: ["flex-end", "ri-layout-right-line"],
space: ["space-between", "ri-space"],
},
}
$: propertyChoices = Object.entries(PROPERTY_OPTIONS[propertyName])
</script>
<div class="inputs {size}">
{#each meta as { placeholder }, i}
{#each propertyChoices as [displayName, [cssPropValue, icon]]}
<button
class:selected={cssPropValue === selectedLayoutValues[i]}
on:click={() => {
const newPropertyValue = cssPropValue === selectedLayoutValues[i] ? '' : cssPropValue
selectedLayoutValues[i] = newPropertyValue
}}>
<i class={icon} />
</button>
{/each}
{/each}
</div>
<style>
.selected {
color: var(--blue);
background: var(--grey-1);
opacity: 1;
}
button {
cursor: pointer;
outline: none;
border: none;
border-radius: 3px;
min-width: 1.6rem;
min-height: 1.6rem;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 1.2rem;
font-weight: 500;
color: var(--ink);
}
.inputs {
display: flex;
justify-content: space-between;
}
</style>

View File

@ -1,5 +0,0 @@
<script>
import TableViewFieldSelect from "./PropertyPanelControls/TableViewFieldSelect.svelte"
</script>
<TableViewFieldSelect {...$$props} multiselect />

View File

@ -3,7 +3,7 @@
import { Button } from "@budibase/bbui" import { Button } from "@budibase/bbui"
import SettingsLink from "components/settings/Link.svelte" import SettingsLink from "components/settings/Link.svelte"
import ThemeEditorDropdown from "components/settings/ThemeEditorDropdown.svelte" import ThemeEditorDropdown from "components/settings/ThemeEditorDropdown.svelte"
import FeedbackNavLink from "components/userInterface/Feedback/FeedbackNavLink.svelte" import FeedbackNavLink from "components/Feedback/FeedbackNavLink.svelte"
import { get } from "builderStore/api" import { get } from "builderStore/api"
import { isActive, goto, layout } from "@sveltech/routify" import { isActive, goto, layout } from "@sveltech/routify"

View File

@ -7,7 +7,7 @@
import Spinner from "components/common/Spinner.svelte" import Spinner from "components/common/Spinner.svelte"
import DeploymentHistory from "components/deploy/DeploymentHistory.svelte" import DeploymentHistory from "components/deploy/DeploymentHistory.svelte"
import analytics from "analytics" import analytics from "analytics"
import FeedbackIframe from "components/userInterface/Feedback/FeedbackIframe.svelte" import FeedbackIframe from "components/Feedback/FeedbackIframe.svelte"
let loading = false let loading = false
let deployments = [] let deployments = []

View File

@ -7,9 +7,9 @@
} from "builderStore" } from "builderStore"
import { onMount } from "svelte" import { onMount } from "svelte"
import CurrentItemPreview from "components/userInterface/AppPreview" import CurrentItemPreview from "components/userInterface/AppPreview"
import ComponentPropertiesPanel from "components/userInterface/ComponentPropertiesPanel.svelte" import ComponentPropertiesPanel from "components/userInterface/PropertiesPanel/ComponentPropertiesPanel.svelte"
import ComponentSelectionList from "components/userInterface/ComponentSelectionList.svelte" import ComponentSelectionList from "components/userInterface/AppPreview/ComponentSelectionList.svelte"
import FrontendNavigatePane from "components/userInterface/FrontendNavigatePane.svelte" import FrontendNavigatePane from "components/userInterface/NavigationPanel/FrontendNavigatePane.svelte"
$: instance = $store.appInstance $: instance = $store.appInstance

View File

@ -21,39 +21,6 @@
"logoUrl": "string" "logoUrl": "string"
} }
}, },
"button": {
"name": "Button",
"description": "an html <button />",
"props": {
"text": "string",
"disabled": "bool",
"onClick": "event"
},
"tags": [
"layout"
],
"presets": {
"primary": {
"contentText": "Primary Button Preset",
"color": "papayawhip",
"padding": "20px",
"background": "blue"
},
"secondary": {
"contentText": "Secondary Button Preset",
"color": "rebeccapurple",
"padding": "10px",
"background": "#fff",
"border": "1px solid red"
},
"error": {
"contentText": "ERROR",
"color": "red",
"padding": "10px",
"border": "1px solid red"
}
}
},
"login": { "login": {
"name": "Login Control", "name": "Login Control",
"description": "A control that accepts email, password an also handles password resets", "description": "A control that accepts email, password an also handles password resets",

View File

@ -75,5 +75,29 @@
"name": "Screenslot", "name": "Screenslot",
"description": "Contains your app screens", "description": "Contains your app screens",
"styleable": true "styleable": true
},
"button": {
"name": "Button",
"description": "A basic html button that is ready for styling",
"icon": "ri-share-box-line",
"styleable": true,
"settings": [
{
"type": "text",
"label": "Text",
"key": "text"
},
{
"type": "boolean",
"label": "Disabled",
"key": "disabled",
"valueKey": "checked"
},
{
"type": "event",
"label": "On Click",
"key": "onClick"
}
]
} }
} }

View File

@ -6,7 +6,7 @@
export let className = "default" export let className = "default"
export let disabled = false export let disabled = false
export let text export let text = ""
export let onClick export let onClick
</script> </script>

View File

@ -8,12 +8,12 @@ import "@spectrum-css/vars/dist/spectrum-light.css"
export { default as container } from "./Container.svelte" export { default as container } from "./Container.svelte"
export { default as grid } from "./grid/Component.svelte" export { default as grid } from "./grid/Component.svelte"
export { default as screenslot } from "./ScreenSlot.svelte" export { default as screenslot } from "./ScreenSlot.svelte"
export { default as button } from "./Button.svelte"
// export { default as text } from "./Text.svelte" // export { default as text } from "./Text.svelte"
// export { default as heading } from "./Heading.svelte" // export { default as heading } from "./Heading.svelte"
// export { default as input } from "./Input.svelte" // export { default as input } from "./Input.svelte"
// export { default as richtext } from "./RichText.svelte" // export { default as richtext } from "./RichText.svelte"
// export { default as button } from "./Button.svelte"
// export { default as login } from "./Login.svelte" // export { default as login } from "./Login.svelte"
// export { default as link } from "./Link.svelte" // export { default as link } from "./Link.svelte"
// export { default as image } from "./Image.svelte" // export { default as image } from "./Image.svelte"