Fix schema in when creating columns and use new spectrum form components in design section

This commit is contained in:
Andrew Kingston 2021-04-16 11:06:21 +01:00
parent 064c2d8551
commit 3627cd38e1
7 changed files with 45 additions and 51 deletions

View File

@ -173,6 +173,7 @@
disabled={originalName} disabled={originalName}
label="Type" label="Type"
bind:value={field.type} bind:value={field.type}
on:change={handleTypeChange}
options={[...Object.values(fieldDefinitions), { name: 'Auto Column', type: AUTO_COL }]} options={[...Object.values(fieldDefinitions), { name: 'Auto Column', type: AUTO_COL }]}
getOptionLabel={field => field.name} getOptionLabel={field => field.name}
getOptionValue={field => field.type} /> getOptionValue={field => field.type} />

View File

@ -105,6 +105,7 @@
position: relative; position: relative;
display: flex; display: flex;
min-height: 0; min-height: 0;
flex: 1 1 auto;
} }
.property-groups { .property-groups {

View File

@ -13,13 +13,9 @@
) )
</script> </script>
<Select thin secondary {value} on:change> <Select
<option value="">Choose option</option> {value}
{#if providers} on:change
{#each providers as component} options={providers}
<option value={`{{ literal ${makePropSafe(component._id)} }}`}> getOptionLabel={component => component._instanceName}
{component._instanceName} getOptionValue={component => `{{ literal ${makePropSafe(component._id)} }}`} />
</option>
{/each}
{/if}
</Select>

View File

@ -134,7 +134,6 @@
flex: 1; flex: 1;
display: inline-block; display: inline-block;
padding-left: 2px; padding-left: 2px;
overflow: hidden;
} }
.icon { .icon {

View File

@ -1,17 +1,14 @@
<script> <script>
import { get } from "lodash" import { get } from "lodash"
import { isEmpty } from "lodash/fp" import { isEmpty } from "lodash/fp"
import { Button } from "@budibase/bbui" import { Button, Checkbox, Input, Select } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import { currentAsset } from "builderStore" import { currentAsset } from "builderStore"
import { findClosestMatchingComponent } from "builderStore/storeUtils" import { findClosestMatchingComponent } from "builderStore/storeUtils"
import { makeDatasourceFormComponents } from "builderStore/store/screenTemplates/utils/commonComponents" import { makeDatasourceFormComponents } from "builderStore/store/screenTemplates/utils/commonComponents"
import PropertyControl from "./PropertyControls/PropertyControl.svelte" import PropertyControl from "./PropertyControls/PropertyControl.svelte"
import Input from "./PropertyControls/Input.svelte"
import LayoutSelect from "./PropertyControls/LayoutSelect.svelte" import LayoutSelect from "./PropertyControls/LayoutSelect.svelte"
import RoleSelect from "./PropertyControls/RoleSelect.svelte" import RoleSelect from "./PropertyControls/RoleSelect.svelte"
import OptionSelect from "./PropertyControls/OptionSelect.svelte"
import Checkbox from "./PropertyControls/Checkbox.svelte"
import TableSelect from "./PropertyControls/TableSelect.svelte" import TableSelect from "./PropertyControls/TableSelect.svelte"
import DataSourceSelect from "./PropertyControls/DataSourceSelect.svelte" import DataSourceSelect from "./PropertyControls/DataSourceSelect.svelte"
import DataProviderSelect from "./PropertyControls/DataProviderSelect.svelte" import DataProviderSelect from "./PropertyControls/DataProviderSelect.svelte"
@ -61,7 +58,7 @@
const controlMap = { const controlMap = {
text: Input, text: Input,
select: OptionSelect, select: Select,
dataSource: DataSourceSelect, dataSource: DataSourceSelect,
dataProvider: DataProviderSelect, dataProvider: DataProviderSelect,
detailScreen: DetailScreenSelect, detailScreen: DetailScreenSelect,

View File

@ -1,5 +1,4 @@
import Input from "./PropertyControls/Input.svelte" import { Input, Select } from "@budibase/bbui"
import OptionSelect from "./PropertyControls/OptionSelect.svelte"
import FlatButtonGroup from "./PropertyControls/FlatButtonGroup" import FlatButtonGroup from "./PropertyControls/FlatButtonGroup"
import Colorpicker from "./PropertyControls/ColorPicker.svelte" import Colorpicker from "./PropertyControls/ColorPicker.svelte"
@ -7,7 +6,7 @@ export const layout = [
{ {
label: "Display", label: "Display",
key: "display", key: "display",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Block", value: "block" }, { label: "Block", value: "block" },
{ label: "Inline Block", value: "inline-block" }, { label: "Inline Block", value: "inline-block" },
@ -34,7 +33,7 @@ export const layout = [
{ {
label: "Justify", label: "Justify",
key: "justify-content", key: "justify-content",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Flex Start", value: "flex-start" }, { label: "Flex Start", value: "flex-start" },
{ label: "Flex End", value: "flex-end" }, { label: "Flex End", value: "flex-end" },
@ -47,7 +46,7 @@ export const layout = [
{ {
label: "Align", label: "Align",
key: "align-items", key: "align-items",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Flex Start", value: "flex-start" }, { label: "Flex Start", value: "flex-start" },
{ label: "Flex End", value: "flex-end" }, { label: "Flex End", value: "flex-end" },
@ -59,7 +58,7 @@ export const layout = [
{ {
label: "Wrap", label: "Wrap",
key: "flex-wrap", key: "flex-wrap",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Wrap", value: "wrap" }, { label: "Wrap", value: "wrap" },
{ label: "No wrap", value: "nowrap" }, { label: "No wrap", value: "nowrap" },
@ -68,7 +67,7 @@ export const layout = [
{ {
label: "Gap", label: "Gap",
key: "gap", key: "gap",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -86,7 +85,7 @@ export const margin = [
{ {
label: "All sides", label: "All sides",
key: "margin", key: "margin",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -105,7 +104,7 @@ export const margin = [
{ {
label: "Top", label: "Top",
key: "margin-top", key: "margin-top",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -124,7 +123,7 @@ export const margin = [
{ {
label: "Right", label: "Right",
key: "margin-right", key: "margin-right",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -143,7 +142,7 @@ export const margin = [
{ {
label: "Bottom", label: "Bottom",
key: "margin-bottom", key: "margin-bottom",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -162,7 +161,7 @@ export const margin = [
{ {
label: "Left", label: "Left",
key: "margin-left", key: "margin-left",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -184,7 +183,7 @@ export const padding = [
{ {
label: "All sides", label: "All sides",
key: "padding", key: "padding",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -201,7 +200,7 @@ export const padding = [
{ {
label: "Top", label: "Top",
key: "padding-top", key: "padding-top",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -218,7 +217,7 @@ export const padding = [
{ {
label: "Right", label: "Right",
key: "padding-right", key: "padding-right",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -235,7 +234,7 @@ export const padding = [
{ {
label: "Bottom", label: "Bottom",
key: "padding-bottom", key: "padding-bottom",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -252,7 +251,7 @@ export const padding = [
{ {
label: "Left", label: "Left",
key: "padding-left", key: "padding-left",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0px" }, { label: "None", value: "0px" },
{ label: "4px", value: "4px" }, { label: "4px", value: "4px" },
@ -272,7 +271,7 @@ export const size = [
{ {
label: "Flex", label: "Flex",
key: "flex", key: "flex",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Shrink", value: "0 1 auto" }, { label: "Shrink", value: "0 1 auto" },
{ label: "Grow", value: "1 1 auto" }, { label: "Grow", value: "1 1 auto" },
@ -320,7 +319,7 @@ export const position = [
{ {
label: "Position", label: "Position",
key: "position", key: "position",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Static", value: "static" }, { label: "Static", value: "static" },
{ label: "Relative", value: "relative" }, { label: "Relative", value: "relative" },
@ -356,7 +355,7 @@ export const position = [
{ {
label: "Z-index", label: "Z-index",
key: "z-index", key: "z-index",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "-9999", value: "-9999" }, { label: "-9999", value: "-9999" },
{ label: "-3", value: "-3" }, { label: "-3", value: "-3" },
@ -375,7 +374,7 @@ export const typography = [
{ {
label: "Font", label: "Font",
key: "font-family", key: "font-family",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Arial", value: "Arial" }, { label: "Arial", value: "Arial" },
{ label: "Arial Black", value: "Arial Black" }, { label: "Arial Black", value: "Arial Black" },
@ -397,7 +396,7 @@ export const typography = [
{ {
label: "Weight", label: "Weight",
key: "font-weight", key: "font-weight",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "200", value: "200" }, { label: "200", value: "200" },
{ label: "300", value: "300" }, { label: "300", value: "300" },
@ -412,7 +411,7 @@ export const typography = [
{ {
label: "size", label: "size",
key: "font-size", key: "font-size",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "8px", value: "8px" }, { label: "8px", value: "8px" },
{ label: "10px", value: "10px" }, { label: "10px", value: "10px" },
@ -431,7 +430,7 @@ export const typography = [
{ {
label: "Line H", label: "Line H",
key: "line-height", key: "line-height",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "1", value: "1" }, { label: "1", value: "1" },
{ label: "1.25", value: "1.25" }, { label: "1.25", value: "1.25" },
@ -472,7 +471,7 @@ export const typography = [
{ {
label: "Decoration", label: "Decoration",
key: "text-decoration-line", key: "text-decoration-line",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Underline", value: "underline" }, { label: "Underline", value: "underline" },
{ label: "Overline", value: "overline" }, { label: "Overline", value: "overline" },
@ -491,7 +490,7 @@ export const background = [
{ {
label: "Gradient", label: "Gradient",
key: "background-image", key: "background-image",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "none" }, { label: "None", value: "none" },
{ {
@ -577,7 +576,7 @@ export const border = [
{ {
label: "Radius", label: "Radius",
key: "border-radius", key: "border-radius",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0" }, { label: "None", value: "0" },
{ label: "X Small", value: "0.125rem" }, { label: "X Small", value: "0.125rem" },
@ -592,7 +591,7 @@ export const border = [
{ {
label: "Width", label: "Width",
key: "border-width", key: "border-width",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0" }, { label: "None", value: "0" },
{ label: "X Small", value: "0.5px" }, { label: "X Small", value: "0.5px" },
@ -610,7 +609,7 @@ export const border = [
{ {
label: "Style", label: "Style",
key: "border-style", key: "border-style",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "none" }, { label: "None", value: "none" },
{ label: "Hidden", value: "hidden" }, { label: "Hidden", value: "hidden" },
@ -630,7 +629,7 @@ export const effects = [
{ {
label: "Opacity", label: "Opacity",
key: "opacity", key: "opacity",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "0", value: "0" }, { label: "0", value: "0" },
{ label: "0.2", value: "0.2" }, { label: "0.2", value: "0.2" },
@ -643,7 +642,7 @@ export const effects = [
{ {
label: "Rotate", label: "Rotate",
key: "transform", key: "transform",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "0" }, { label: "None", value: "0" },
{ label: "45 deg", value: "rotate(45deg)" }, { label: "45 deg", value: "rotate(45deg)" },
@ -659,7 +658,7 @@ export const effects = [
{ {
label: "Shadow", label: "Shadow",
key: "box-shadow", key: "box-shadow",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "none" }, { label: "None", value: "none" },
{ label: "X Small", value: "0 1px 2px 0 rgba(0, 0, 0, 0.05)" }, { label: "X Small", value: "0 1px 2px 0 rgba(0, 0, 0, 0.05)" },
@ -691,7 +690,7 @@ export const transitions = [
{ {
label: "Property", label: "Property",
key: "transition-property", key: "transition-property",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "None", value: "none" }, { label: "None", value: "none" },
{ label: "All", value: "all" }, { label: "All", value: "all" },
@ -711,7 +710,7 @@ export const transitions = [
{ {
label: "Duration", label: "Duration",
key: "transition-duration", key: "transition-duration",
control: OptionSelect, control: Select,
placeholder: "sec", placeholder: "sec",
options: [ options: [
{ label: "0.4s", value: "0.4s" }, { label: "0.4s", value: "0.4s" },
@ -725,7 +724,7 @@ export const transitions = [
{ {
label: "Ease", label: "Ease",
key: "transition-timing-function", key: "transition-timing-function",
control: OptionSelect, control: Select,
options: [ options: [
{ label: "Linear", value: "linear" }, { label: "Linear", value: "linear" },
{ label: "Ease", value: "ease" }, { label: "Ease", value: "ease" },

View File

@ -209,5 +209,6 @@
gap: var(--spacing-l); gap: var(--spacing-l);
padding: var(--spacing-l) var(--spacing-xl); padding: var(--spacing-l) var(--spacing-xl);
border-left: var(--border-light); border-left: var(--border-light);
overflow-x: hidden;
} }
</style> </style>