refactor(vue-flow,components): hide/show slots in Controls.vue

# What's changed?

* depending on props, hide slot as well
* rename `control-fitview` to `control-fit-view`
This commit is contained in:
bcakmakoglu
2022-06-15 19:31:20 +02:00
committed by Braks
parent 14000111f9
commit 32086e0760
@@ -67,23 +67,27 @@ export default {
</ControlButton> </ControlButton>
</slot> </slot>
</template> </template>
<slot name="control-fitview"> <template v-if="showFitView">
<ControlButton v-if="showFitView" class="vue-flow__controls-fitview" @click="onFitViewHandler"> <slot name="control-fit-view">
<slot name="icon-fitview"> <ControlButton class="vue-flow__controls-fitview" @click="onFitViewHandler">
<FitView /> <slot name="icon-fit-view">
</slot> <FitView />
</ControlButton> </slot>
</slot> </ControlButton>
<slot name="control-interactive"> </slot>
<ControlButton v-if="showInteractive" class="vue-flow__controls-interactive" @click="onInteractiveChangeHandler"> </template>
<slot name="icon-unlock"> <template v-if="showInteractive">
<Unlock v-if="isInteractive" /> <slot name="control-interactive">
</slot> <ControlButton v-if="showInteractive" class="vue-flow__controls-interactive" @click="onInteractiveChangeHandler">
<slot name="icon-lock"> <slot name="icon-unlock">
<Lock v-if="!isInteractive" /> <Unlock v-if="isInteractive" />
</slot> </slot>
</ControlButton> <slot name="icon-lock">
</slot> <Lock v-if="!isInteractive" />
</slot>
</ControlButton>
</slot>
</template>
<slot></slot> <slot></slot>
</div> </div>
</template> </template>