2021-08-06 08:31:17 +00:00
|
|
|
<!--
|
2021-11-22 12:06:14 +00:00
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
2021-08-06 08:31:17 +00:00
|
|
|
//
|
|
|
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License. You may
|
|
|
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
//
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-11-22 12:06:14 +00:00
|
|
|
import type { NavigatorModel, SpecialNavModel } from '@anticrm/workbench'
|
2021-08-06 08:31:17 +00:00
|
|
|
import SpacesNav from './navigator/SpacesNav.svelte'
|
2021-11-22 12:06:14 +00:00
|
|
|
import TreeSeparator from './navigator/TreeSeparator.svelte'
|
|
|
|
import SpecialElement from './navigator/SpecialElement.svelte'
|
|
|
|
import { getCurrentLocation, navigate } from '@anticrm/ui'
|
2021-08-06 08:31:17 +00:00
|
|
|
|
|
|
|
export let model: NavigatorModel | undefined
|
2021-11-22 12:06:14 +00:00
|
|
|
|
|
|
|
function selectSpecial (sp: SpecialNavModel): void {
|
|
|
|
const loc = getCurrentLocation()
|
|
|
|
loc.path[2] = sp.id
|
|
|
|
loc.path.length = 3
|
|
|
|
navigate(loc)
|
|
|
|
}
|
2021-08-06 08:31:17 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{#if model}
|
2021-11-22 12:06:14 +00:00
|
|
|
{#if model.specials}
|
|
|
|
{#each model.specials as special}
|
|
|
|
<SpecialElement label={special.label} icon={special.icon} on:click={() => selectSpecial(special)} />
|
|
|
|
{/each}
|
|
|
|
{#if model.spaces.length}
|
|
|
|
<TreeSeparator />
|
|
|
|
{/if}
|
|
|
|
{/if}
|
2021-12-07 09:05:52 +00:00
|
|
|
{#each model.spaces as m (m.label)}
|
2021-08-06 08:31:17 +00:00
|
|
|
<SpacesNav model={m}/>
|
|
|
|
{/each}
|
|
|
|
{/if}
|