Refactor client component structure, fix select bar z index, add titles to container bar settings

This commit is contained in:
Andrew Kingston 2021-06-10 18:42:41 +01:00
parent da72a079ae
commit 65d6216d33
8 changed files with 34 additions and 22 deletions

View File

@ -14,9 +14,9 @@
builderStore, builderStore,
} from "../store" } from "../store"
import { TableNames, ActionTypes } from "../constants" import { TableNames, ActionTypes } from "../constants"
import SettingsBar from "./SettingsBar.svelte" import SettingsBar from "./preview/SettingsBar.svelte"
import SelectionIndicator from "./SelectionIndicator.svelte" import SelectionIndicator from "./preview/SelectionIndicator.svelte"
import HoverIndicator from "./HoverIndicator.svelte" import HoverIndicator from "./preview/HoverIndicator.svelte"
// Provide contexts // Provide contexts
setContext("sdk", SDK) setContext("sdk", SDK)

View File

@ -1,7 +1,7 @@
<script> <script>
import { onMount, onDestroy } from "svelte" import { onMount, onDestroy } from "svelte"
import IndicatorSet from "./IndicatorSet.svelte" import IndicatorSet from "./IndicatorSet.svelte"
import { builderStore } from "../store" import { builderStore } from "../../store"
let componentId let componentId
$: zIndex = componentId === $builderStore.selectedComponentId ? 900 : 920 $: zIndex = componentId === $builderStore.selectedComponentId ? 900 : 920

View File

@ -1,7 +1,7 @@
<script> <script>
import { onMount, onDestroy } from "svelte" import { onMount, onDestroy } from "svelte"
import Indicator from "./Indicator.svelte" import Indicator from "./Indicator.svelte"
import { domDebounce } from "../utils/domDebounce" import { domDebounce } from "../../utils/domDebounce"
export let componentId export let componentId
export let color export let color

View File

@ -1,5 +1,5 @@
<script> <script>
import { builderStore } from "../store" import { builderStore } from "../../store"
import IndicatorSet from "./IndicatorSet.svelte" import IndicatorSet from "./IndicatorSet.svelte"
</script> </script>

View File

@ -1,8 +1,8 @@
<script> <script>
import { onMount, onDestroy } from "svelte" import { onMount, onDestroy } from "svelte"
import SettingsButton from "./SettingsButton.svelte" import SettingsButton from "./SettingsButton.svelte"
import { builderStore } from "../store" import { builderStore } from "../../store"
import { domDebounce } from "../utils/domDebounce" import { domDebounce } from "../../utils/domDebounce"
const verticalOffset = 28 const verticalOffset = 28
const horizontalOffset = 2 const horizontalOffset = 2
@ -107,7 +107,7 @@
.bar { .bar {
display: flex; display: flex;
position: absolute; position: absolute;
z-index: 920; z-index: 930;
padding: 6px 8px; padding: 6px 8px;
opacity: 0; opacity: 0;
flex-direction: row; flex-direction: row;

View File

@ -1,6 +1,6 @@
<script> <script>
import { Icon } from "@budibase/bbui" import { Icon } from "@budibase/bbui"
import { builderStore } from "../store" import { builderStore } from "../../store"
export let prop export let prop
export let value export let value

View File

@ -17,12 +17,14 @@
{ {
"label": "Column", "label": "Column",
"value": "column", "value": "column",
"barIcon": "ViewRow" "barIcon": "ViewRow",
"barTitle": "Column layout"
}, },
{ {
"label": "Row", "label": "Row",
"value": "row", "value": "row",
"barIcon": "ViewColumn" "barIcon": "ViewColumn",
"barTitle": "Row layout"
} }
], ],
"defaultValue": "column" "defaultValue": "column"
@ -36,22 +38,26 @@
{ {
"label": "Left", "label": "Left",
"value": "left", "value": "left",
"barIcon": "AlignLeft" "barIcon": "AlignLeft",
"barTitle": "Align left"
}, },
{ {
"label": "Center", "label": "Center",
"value": "center", "value": "center",
"barIcon": "AlignCenter" "barIcon": "AlignCenter",
"barTitle": "Align center"
}, },
{ {
"label": "Right", "label": "Right",
"value": "right", "value": "right",
"barIcon": "AlignRight" "barIcon": "AlignRight",
"barTitle": "Align right"
}, },
{ {
"label": "Stretch", "label": "Stretch",
"value": "stretch", "value": "stretch",
"barIcon": "MoveLeftRight" "barIcon": "MoveLeftRight",
"barTitle": "Align stretched horizontally"
} }
], ],
"defaultValue": "stretch" "defaultValue": "stretch"
@ -65,22 +71,26 @@
{ {
"label": "Top", "label": "Top",
"value": "top", "value": "top",
"barIcon": "AlignTop" "barIcon": "AlignTop",
"barTitle": "Align top"
}, },
{ {
"label": "Middle", "label": "Middle",
"value": "middle", "value": "middle",
"barIcon": "AlignMiddle" "barIcon": "AlignMiddle",
"barTitle": "Align middle"
}, },
{ {
"label": "Bottom", "label": "Bottom",
"value": "bottom", "value": "bottom",
"barIcon": "AlignBottom" "barIcon": "AlignBottom",
"barTitle": "Align bottom"
}, },
{ {
"label": "Stretch", "label": "Stretch",
"value": "stretch", "value": "stretch",
"barIcon": "MoveUpDown" "barIcon": "MoveUpDown",
"barTitle": "Align stretched vertically"
} }
], ],
"defaultValue": "top" "defaultValue": "top"
@ -94,12 +104,14 @@
{ {
"label": "Shrink", "label": "Shrink",
"value": "shrink", "value": "shrink",
"barIcon": "Minimize" "barIcon": "Minimize",
"barTitle": "Shrink container"
}, },
{ {
"label": "Grow", "label": "Grow",
"value": "grow", "value": "grow",
"barIcon": "Maximize" "barIcon": "Maximize",
"barTitle": "Grow container"
} }
], ],
"defaultValue": "shrink" "defaultValue": "shrink"