Skip to content

feat: tabsbar component #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c953e2b
feat: created tabsbar component
devartstar Jul 24, 2022
a752e5c
feat: circuitList in store and updating value in external js
devartstar Jul 24, 2022
95d7c7a
feat: replace tab rendering as string to dom with vue-for
devartstar Jul 24, 2022
095ff02
feat: removing item from tabList on closing tab
devartstar Jul 24, 2022
31b7614
feat: add sortability of tabs
devartstar Jul 26, 2022
05e2ada
fix: new circuit was not working after sorting tabs
devartstar Jul 26, 2022
4bce317
fix: multiple tabs closing
devartstar Jul 27, 2022
1d5debe
feat: added message modal
devartstar Jul 27, 2022
94863d1
feat: add dialog boxes for messages instead of prompt
devartstar Jul 27, 2022
2c0a4e0
feat: persistent dialog box for dependencies
devartstar Jul 27, 2022
7c9c3bf
feat: moved circuit deleting cheching to vue component
devartstar Jul 27, 2022
58566b4
feat: made message Box reusable
devartstar Jul 27, 2022
a97a267
feat: linked dialog box conformation for delete to logic
devartstar Jul 27, 2022
ca7fa86
feat: create circuit prompt to dialog box
devartstar Jul 28, 2022
4ab5090
feat: completed converting all prompts of tabsbar to dialog box
devartstar Jul 28, 2022
225de3d
fix: propper current-tab display on sorting, switching, creating, del…
devartstar Aug 1, 2022
dae55e7
fix: lined circuitName in tabsbar and properties panel
devartstar Aug 2, 2022
6950d9e
fix: lined-updated properties panel with switching tabs
devartstar Aug 2, 2022
5efa081
fix: displaying circuit name from scopeList
devartstar Aug 2, 2022
d7b718c
refactor: circuit-list store only list of ids(more generalized) as na…
devartstar Aug 2, 2022
9dee575
revert: on changing tabs only circuitname changes
devartstar Aug 2, 2022
cb77ce0
fix: acessing only states instead of complete pinia store in Tabsbar
devartstar Aug 4, 2022
8cda493
fix: initially no circuit name should be visible but default set to u…
devartstar Aug 22, 2022
5ac9faf
fix: default values for array and object in props
devartstar Aug 22, 2022
0d9eba5
fix: replaces x with icon cross
devartstar Aug 22, 2022
7ed700b
fix: all tabs circuits deleting from properties panel
devartstar Aug 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add sortability of tabs
  • Loading branch information
devartstar committed Jul 26, 2022
commit 31b76145c987a744b583a46e471ebccb4fbf0d3f
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"vue": "^3.2.25",
"vue-i18n": "^9.1.10",
"vue-router": "^4.0.15",
"vuedraggable": "^4.1.0",
"vuetify": "^3.0.0-beta.0",
"webfontloader": "^1.0.0"
},
Expand Down
75 changes: 54 additions & 21 deletions src/components/TabsBar/TabsBar.vue
Original file line number Diff line number Diff line change
@@ -1,39 +1,56 @@
<template>
<div id="tabsBar" class="noSelect pointerCursor">
<div
v-for="item in tabList"
:id="item.id"
:key="item.id"
style=""
class="circuits toolbarButton current"
:class="embed ? 'embed-tabs' : ''"
draggable="true"
@click="switchCircuit(item.id)"
<draggable
v-model="tabList"
class="list-group"
tag="transition-group"
:component-data="{
tag: 'div',
type: 'transition-group',
name: !drag ? 'flip-list' : null,
}"
v-bind="dragOptions"
@start="drag = true"
@end="drag = false"
>
<span class="circuitName noSelect">
{{ truncateString(item.name, 18) }}
</span>
<span
id="scope.id"
class="tabsCloseButton"
@click="closeCircuit($event, item)"
>
x
</span>
</div>
<template #item="{ element }">
<div
:id="element.id"
:key="element.id"
style=""
class="circuits toolbarButton current"
:class="embed ? 'embed-tabs' : ''"
draggable="true"
@click="switchCircuit(element.id)"
>
<span class="circuitName noSelect">
{{ truncateString(element.name, 18) }}
</span>
<span
id="scope.id"
class="tabsCloseButton"
@click="closeCircuit($event, element)"
>
x
</span>
</div>
</template>
</draggable>
<button id="createNewCircuitScope" class="logixButton" onclick="">
&#43;
</button>
</div>
</template>

<script lang="ts" setup>
import draggable from 'vuedraggable'
import { truncateString } from '#/simulator/src/utils'
import { ref } from '@vue/reactivity'
import { onMounted } from '@vue/runtime-core'
import { computed, onMounted } from '@vue/runtime-core'
import { deleteCurrentCircuit, switchCircuit } from '#/simulator/src/circuit'
import { SimulatorStore } from '#/store/SimulatorStore/SimulatorStore'
const tabList = ref([])
const drag = ref(false)
onMounted(() => {
tabList.value = SimulatorStore().circuit_list
})
Expand All @@ -47,4 +64,20 @@ function closeCircuit(e, circuitItem) {
}
deleteCurrentCircuit(circuitItem.id)
}

function dragOptions() {
console.log('drag options')
return {
animation: 200,
group: 'description',
disabled: false,
ghostClass: 'ghost',
}
}
</script>

<style scoped>
.list-group {
display: inline;
}
</style>