|
|
|
@ -1,4 +1,5 @@ |
|
|
|
<script> |
|
|
|
import { params, goto } from "@sveltech/routify" |
|
|
|
import ComponentsHierarchyChildren from "./ComponentsHierarchyChildren.svelte" |
|
|
|
|
|
|
|
import { last, sortBy, map, trimCharsStart, trimChars, join } from "lodash/fp" |
|
|
|
@ -15,15 +16,12 @@ |
|
|
|
const joinPath = join("/") |
|
|
|
|
|
|
|
const normalizedName = name => |
|
|
|
pipe( |
|
|
|
name, |
|
|
|
[ |
|
|
|
trimCharsStart("./"), |
|
|
|
trimCharsStart("~/"), |
|
|
|
trimCharsStart("../"), |
|
|
|
trimChars(" "), |
|
|
|
] |
|
|
|
) |
|
|
|
pipe(name, [ |
|
|
|
trimCharsStart("./"), |
|
|
|
trimCharsStart("~/"), |
|
|
|
trimCharsStart("../"), |
|
|
|
trimChars(" "), |
|
|
|
]) |
|
|
|
|
|
|
|
const lastPartOfName = c => { |
|
|
|
if (!c) return "" |
|
|
|
@ -35,10 +33,10 @@ |
|
|
|
|
|
|
|
const isFolderSelected = (current, folder) => isInSubfolder(current, folder) |
|
|
|
|
|
|
|
$: _screens = pipe( |
|
|
|
screens, |
|
|
|
[map(c => ({ component: c, title: lastPartOfName(c) })), sortBy("title")] |
|
|
|
) |
|
|
|
$: _screens = pipe(screens, [ |
|
|
|
map(c => ({ component: c, title: lastPartOfName(c) })), |
|
|
|
sortBy("title"), |
|
|
|
]) |
|
|
|
|
|
|
|
const isScreenSelected = component => |
|
|
|
component.component && |
|
|
|
@ -49,6 +47,14 @@ |
|
|
|
componentToDelete = component |
|
|
|
confirmDeleteDialog.show() |
|
|
|
} |
|
|
|
|
|
|
|
const changeScreen = screen => { |
|
|
|
console.log("Screen: ", screen) |
|
|
|
store.setCurrentScreen(screen.title) |
|
|
|
$goto(`./:page/${screen.title}`) |
|
|
|
} |
|
|
|
|
|
|
|
$: console.log("Params: ", $params) |
|
|
|
</script> |
|
|
|
|
|
|
|
<div class="root"> |
|
|
|
@ -57,7 +63,7 @@ |
|
|
|
<div |
|
|
|
class="budibase__nav-item component" |
|
|
|
class:selected={$store.currentComponentInfo._id === screen.component.props._id} |
|
|
|
on:click|stopPropagation={() => store.setCurrentScreen(screen.title)}> |
|
|
|
on:click|stopPropagation={() => changeScreen(screen)}> |
|
|
|
|
|
|
|
<span |
|
|
|
class="icon" |
|
|
|
|