From 8ad10976d3f03c2225a04873409014534e9703b3 Mon Sep 17 00:00:00 2001 From: Conor_Mack Date: Tue, 5 May 2020 10:02:10 +0100 Subject: [PATCH] Updates to naming conventions --- .../userInterface/DesignView.svelte | 12 ++-- .../userInterface/PropertyGroup.svelte | 18 +++--- .../userInterface/propertyCategories.js | 63 +++++++++---------- .../userInterface/temporaryPanelStructure.js | 30 ++++----- 4 files changed, 62 insertions(+), 61 deletions(-) diff --git a/packages/builder/src/components/userInterface/DesignView.svelte b/packages/builder/src/components/userInterface/DesignView.svelte index 60a6dc8bc3..f8dad08905 100644 --- a/packages/builder/src/components/userInterface/DesignView.svelte +++ b/packages/builder/src/components/userInterface/DesignView.svelte @@ -1,17 +1,19 @@ -{#each props as prop} +{#each propertyGroupNames as groupName} {/each} diff --git a/packages/builder/src/components/userInterface/PropertyGroup.svelte b/packages/builder/src/components/userInterface/PropertyGroup.svelte index 1b424dcd28..b2b1e9c9eb 100644 --- a/packages/builder/src/components/userInterface/PropertyGroup.svelte +++ b/packages/builder/src/components/userInterface/PropertyGroup.svelte @@ -1,6 +1,6 @@
(show = !show)}> -
+
-
{capitalize(title)}
+
{capitalize(name)}
    {#each propertyKeys as key} -
  • {content[key].displayName || capitalize(key)}
  • +
  • {properties[key].label || capitalize(key)}
  • {/each}
@@ -42,7 +42,7 @@ padding: 5px; } - .property-group-title { + .property-group-name { cursor: pointer; flex: 0 0 20px; display: flex; @@ -54,7 +54,7 @@ text-align: center; } - .title { + .name { flex: 1; text-align: left; } diff --git a/packages/builder/src/components/userInterface/propertyCategories.js b/packages/builder/src/components/userInterface/propertyCategories.js index 8b662d443c..352baea93e 100644 --- a/packages/builder/src/components/userInterface/propertyCategories.js +++ b/packages/builder/src/components/userInterface/propertyCategories.js @@ -1,4 +1,3 @@ - /* TODO: all strings types are really inputs and could be typed as such TODO: Options types need option items @@ -6,52 +5,52 @@ */ export const layout = { - flexDirection: { displayName: "Direction", type: "string" }, - justifyContent: { displayName: "Justify", type: "string" }, - alignItems: { displayName: "Align", type: "string" }, - flexWrap: { displayName: "Wrap", type: "options" }, + flexDirection: { label: "Direction", control: "string" }, + justifyContent: { label: "Justify", control: "string" }, + alignItems: { label: "Align", control: "string" }, + flexWrap: { label: "Wrap", control: "options" }, } export const spacing = { - padding: { type: "string" }, - margin: { type: "string" }, + padding: { control: "string" }, + margin: { control: "string" }, } export const size = { - width: { type: "string" }, - height: { type: "string" }, - minWidth: { displayName: "Min W", type: "string" }, - minHeight: { displayName: "Min H", type: "string" }, - maxWidth: { displayName: "Max W", type: "string" }, - maxHeight: { displayName: "Max H", type: "string" }, - overflow: { type: "string" }, //custom + width: { control: "string" }, + height: { control: "string" }, + minWidth: { label: "Min W", control: "string" }, + minHeight: { label: "Min H", control: "string" }, + maxWidth: { label: "Max W", control: "string" }, + maxHeight: { label: "Max H", control: "string" }, + overflow: { control: "string" }, //custom } export const position = { - position: { type: "options" }, + position: { control: "options" }, } export const typography = { - font: { type: "options" }, - weight: { type: "options" }, - size: { type: "string" }, - lineHeight: { displayName: "Line H", type: "string" }, - color: { type: "colour" }, - align: { type: "string" }, //custom - transform: { type: "string" }, //custom - style: { type: "string" }, //custom + font: { control: "options" }, + weight: { control: "options" }, + size: { control: "string" }, + lineHeight: { label: "Line H", control: "string" }, + color: { control: "colour" }, + align: { control: "string" }, //custom + transform: { control: "string" }, //custom + style: { control: "string" }, //custom } export const background = { - backgroundColor: { displayName: "Background Color", type: "colour" }, - image: { type: "string" }, //custom + backgroundColor: { label: "Background Color", control: "colour" }, + image: { control: "string" }, //custom } export const border = { - radius: { type: "string" }, - width: { type: "string" }, //custom - color: { type: "colour" }, - style: { type: "options" }, + radius: { control: "string" }, + width: { control: "string" }, //custom + color: { control: "colour" }, + style: { control: "options" }, } export const effects = { @@ -61,9 +60,9 @@ export const effects = { } export const transitions = { - property: { type: "options" }, - duration: { type: "string" }, - ease: { type: "options" }, + property: { control: "options" }, + duration: { control: "string" }, + ease: { control: "options" }, } export function excludeProps(props, propsToExclude) { diff --git a/packages/builder/src/components/userInterface/temporaryPanelStructure.js b/packages/builder/src/components/userInterface/temporaryPanelStructure.js index 07facd4e28..7ec5988def 100644 --- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js +++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js @@ -13,7 +13,7 @@ export default { icon: 'ri-layout-row-fill', commonProps: {}, children: [], - props: { layout, background }, + properties: { layout, background }, }, { name: 'Text', @@ -26,7 +26,7 @@ export default { name: 'Headline', description: "A component for displaying heading text", icon: "ri-heading", - props: { + properties: { layout, background, }, @@ -36,7 +36,7 @@ export default { name: 'Paragraph', description: "A component for displaying paragraph text.", icon: 'ri-paragraph', - props: {} + properties: {} } ] }, @@ -51,28 +51,28 @@ export default { name: "Textfield", description: "A textfield component that allows the user to input text.", icon: 'ri-edit-box-line', - props: {} + properties: {} }, { _component: "@budibase/standard-components/checkbox", name: "Checkbox", description: "A selectable checkbox component", icon: 'ri-checkbox-line', - props: {} + properties: {} }, { _component: "@budibase/standard-components/radiobutton", name: "Radiobutton", description: "A selectable radiobutton component", icon: 'ri-radio-button-line', - props: {} + properties: {} }, { _component: "@budibase/standard-components/select", name: "Select", description: "A select component for choosing from different options", icon: 'ri-file-list-line', - props: {} + properties: {} } ] }, @@ -82,14 +82,14 @@ export default { description: 'A basic html button that is ready for styling', icon: 'ri-radio-button-fill', children: [], - props: {}, + properties: {}, }, { _component: "@budibase/standard-components/icon", name: 'Icon', description: 'A basic component for displaying icons', icon: 'ri-sun-fill', - props: {}, + properties: {}, children: [] }, { @@ -97,7 +97,7 @@ export default { name: 'Link', description: 'A basic link component for internal and external links', icon: 'ri-link', - props: {}, + properties: {}, children: [] } ] @@ -111,14 +111,14 @@ export default { name: 'Card', description: 'A basic card component that can contain content and actions.', icon: 'ri-layout-bottom-line', - props: {}, + properties: {}, children: [] }, { name: 'Login', description: 'A component that automatically generates a login screen for your app.', icon: 'ri-login-box-fill', - props: {}, + properties: {}, children: [] }, { @@ -126,7 +126,7 @@ export default { _component: "@budibase/standard-components/Navigation", description: "A component for handling the navigation within your app.", icon: "ri-navigation-fill", - props: {}, + properties: {}, children: [] } ] @@ -139,14 +139,14 @@ export default { name: 'Table', description: 'A component that generates a table from your data.', icon: 'ri-archive-drawer-fill', - props: {}, + properties: {}, children: [] }, { name: 'Form', description: 'A component that generates a form from your data.', icon: 'ri-file-edit-fill', - props: {}, + properties: {}, _component: "@budibase/materialdesign-components/Form", template: { component: "@budibase/materialdesign-components/Form",