2020-01-18 00:06:42 +01:00
|
|
|
<script>
|
2020-05-29 15:56:21 +02:00
|
|
|
import { goto } from "@sveltech/routify"
|
2020-04-21 15:20:57 +02:00
|
|
|
import { splitName } from "./pagesParsing/splitRootComponentName.js"
|
2020-04-17 09:16:03 +02:00
|
|
|
import components from "./temporaryPanelStructure.js"
|
2020-04-21 15:20:57 +02:00
|
|
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
2020-05-04 17:07:04 +02:00
|
|
|
import CategoryTab from "./CategoryTab.svelte"
|
2020-04-21 15:20:57 +02:00
|
|
|
import {
|
|
|
|
find,
|
|
|
|
sortBy,
|
|
|
|
groupBy,
|
|
|
|
values,
|
|
|
|
filter,
|
|
|
|
map,
|
|
|
|
uniqBy,
|
|
|
|
flatten,
|
|
|
|
} from "lodash/fp"
|
|
|
|
|
2020-04-29 21:29:42 +02:00
|
|
|
import { pipe } from "components/common/core"
|
2020-04-21 15:20:57 +02:00
|
|
|
|
2020-04-22 08:25:59 +02:00
|
|
|
import Tab from "./ItemTab/Tab.svelte"
|
2020-04-20 16:10:23 +02:00
|
|
|
import { store } from "builderStore"
|
2020-04-17 09:16:03 +02:00
|
|
|
|
2020-04-21 15:20:57 +02:00
|
|
|
export let toggleTab
|
|
|
|
|
|
|
|
let selectTemplateDialog
|
|
|
|
let selectedTemplateInstance
|
|
|
|
let templateInstances = []
|
|
|
|
|
|
|
|
let selectedComponent = null
|
|
|
|
|
2020-04-17 09:16:03 +02:00
|
|
|
const categories = components.categories
|
|
|
|
let selectedCategory = categories[0]
|
2020-04-21 15:20:57 +02:00
|
|
|
|
2020-04-22 08:25:59 +02:00
|
|
|
const onComponentChosen = component => {
|
2020-05-07 15:04:32 +02:00
|
|
|
store.addChildComponent(component._component)
|
2020-05-29 15:56:21 +02:00
|
|
|
|
2020-05-29 14:28:12 +02:00
|
|
|
toggleTab("Navigate")
|
2020-05-29 15:56:21 +02:00
|
|
|
|
|
|
|
// Get ID path
|
|
|
|
const path = store.getPathToComponent($store.currentComponentInfo)
|
|
|
|
|
|
|
|
// Go to correct URL
|
|
|
|
$goto(`./:page/:screen/${path}`)
|
|
|
|
|
2020-04-22 08:25:59 +02:00
|
|
|
}
|
2020-01-18 00:06:42 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="root">
|
2020-05-04 17:07:04 +02:00
|
|
|
|
|
|
|
<CategoryTab
|
|
|
|
onClick={category => (selectedCategory = category)}
|
|
|
|
{selectedCategory}
|
|
|
|
{categories} />
|
|
|
|
|
2020-04-17 09:16:03 +02:00
|
|
|
<div class="panel">
|
2020-04-22 08:25:59 +02:00
|
|
|
<Tab
|
|
|
|
list={selectedCategory}
|
2020-04-22 14:24:54 +02:00
|
|
|
on:selectItem={e => onComponentChosen(e.detail)}
|
|
|
|
{toggleTab} />
|
2020-02-19 22:38:21 +01:00
|
|
|
</div>
|
2020-01-18 00:06:42 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
2020-04-17 09:16:03 +02:00
|
|
|
.panel {
|
2020-05-27 12:11:32 +02:00
|
|
|
padding: 20px 0px;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
2020-04-17 09:16:03 +02:00
|
|
|
}
|
2020-01-18 00:06:42 +01:00
|
|
|
</style>
|