@antelopejs/dms-database 0.5.5-next.179.gc498e0e → 0.5.5-next.180.g58d677c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
defineProps<{
|
|
3
3
|
zoomPercent: string
|
|
4
|
-
|
|
4
|
+
noteDisabled: boolean
|
|
5
5
|
}>()
|
|
6
6
|
|
|
7
7
|
const panMode = defineModel<boolean>('panMode', { required: true })
|
|
@@ -93,7 +93,7 @@ const { t } = useI18n()
|
|
|
93
93
|
variant="ghost"
|
|
94
94
|
icon="i-ph-note-pencil"
|
|
95
95
|
:label="t('dms_database.diagram.toolbar.note')"
|
|
96
|
-
:disabled="
|
|
96
|
+
:disabled="noteDisabled"
|
|
97
97
|
@click="emit('addNote')"
|
|
98
98
|
/>
|
|
99
99
|
</UTooltip>
|
|
@@ -390,7 +390,7 @@ const movedCount = computed(() => {
|
|
|
390
390
|
})
|
|
391
391
|
|
|
392
392
|
function startAutoLayout() {
|
|
393
|
-
if (!fullLayout.value || preview.value) return
|
|
393
|
+
if (!editable.value || !fullLayout.value || preview.value) return
|
|
394
394
|
preview.value = {
|
|
395
395
|
from: clonePositions(state.positions),
|
|
396
396
|
basis: layoutBasis.value,
|
|
@@ -513,7 +513,7 @@ function always(run: () => unknown): () => boolean {
|
|
|
513
513
|
|
|
514
514
|
const COMMANDS: Record<DiagramCommand, () => boolean> = {
|
|
515
515
|
search: always(() => searchBar.value?.focus()),
|
|
516
|
-
note: always(() =>
|
|
516
|
+
note: always(() => editable.value && addNote()),
|
|
517
517
|
select: always(() => (panMode.value = false)),
|
|
518
518
|
pan: always(() => (panMode.value = true)),
|
|
519
519
|
fit: always(fitAll),
|
|
@@ -544,6 +544,7 @@ const edgeTypes = markRaw({ [RELATION_EDGE_TYPE]: DiagramRelationEdge })
|
|
|
544
544
|
const isEmpty = computed(
|
|
545
545
|
() => loaded.value && (schema.value?.tables.length ?? 0) === 0,
|
|
546
546
|
)
|
|
547
|
+
const editable = computed(() => loaded.value && !isEmpty.value)
|
|
547
548
|
const isLarge = computed(
|
|
548
549
|
() =>
|
|
549
550
|
!focusId.value && (schema.value?.tables.length ?? 0) > LARGE_SCHEMA_TABLES,
|
|
@@ -609,7 +610,7 @@ const isLarge = computed(
|
|
|
609
610
|
:saved-label="savedLabel"
|
|
610
611
|
:can-undo="canUndo"
|
|
611
612
|
:can-redo="canRedo"
|
|
612
|
-
:auto-layout-disabled="Boolean(preview)
|
|
613
|
+
:auto-layout-disabled="!editable || Boolean(preview)"
|
|
613
614
|
@save-now="saveNow"
|
|
614
615
|
@undo="undo"
|
|
615
616
|
@redo="redo"
|
|
@@ -640,7 +641,7 @@ const isLarge = computed(
|
|
|
640
641
|
<DiagramViewBar
|
|
641
642
|
v-model:pan-mode="panMode"
|
|
642
643
|
:zoom-percent="zoomPercent"
|
|
643
|
-
:
|
|
644
|
+
:note-disabled="!editable"
|
|
644
645
|
@zoom-out="canvas?.zoomOut()"
|
|
645
646
|
@reset-zoom="canvas?.zoomTo(RESET_ZOOM)"
|
|
646
647
|
@zoom-in="canvas?.zoomIn()"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms-database",
|
|
3
|
-
"version": "0.5.5-next.
|
|
3
|
+
"version": "0.5.5-next.180.g58d677c",
|
|
4
4
|
"description": "Database console for the AntelopeJS DMS: schemas, relation diagrams, a data browser and an AQL query console.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
]
|
|
90
90
|
},
|
|
91
91
|
"dmsFrontend": "dist/frontend-module.js",
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "58d677c3be06e9a6869fbc94cb64080a40958a9d",
|
|
93
93
|
"scripts": {
|
|
94
94
|
"build": "rimraf dist && tsc",
|
|
95
95
|
"dev:frontend": "pnpm frontend:dev",
|