@antelopejs/dms-database 0.2.3 → 0.3.1
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.
- package/README.md +4 -4
- package/dist/frontend-module.d.ts +2 -0
- package/dist/frontend-module.js +17 -0
- package/dist/frontend-module.js.map +1 -0
- package/dist/index.js +2 -11
- package/dist/index.js.map +1 -1
- package/dist/pages/overview.d.ts +0 -1
- package/dist/pages/overview.js +0 -14
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/schemas.js +3 -0
- package/dist/pages/schemas.js.map +1 -1
- package/frontend-vue/app/build/composables/useDatabaseHealth.ts +11 -7
- package/frontend-vue/app/build/composables/useDatabaseSchemas.ts +8 -1
- package/frontend-vue/app/build/data/cellValues.ts +50 -0
- package/frontend-vue/app/build/diagram/graph.ts +211 -47
- package/frontend-vue/app/build/diagram/packing.ts +283 -0
- package/frontend-vue/app/build/utils/fieldTypes.ts +16 -1
- package/frontend-vue/app/components/ConnectionStatus.vue +5 -1
- package/frontend-vue/app/components/DataBrowser.vue +2 -2
- package/frontend-vue/app/components/DataBrowserSidebar.vue +1 -1
- package/frontend-vue/app/components/DataGrid.vue +44 -34
- package/frontend-vue/app/components/DiagramTableNode.vue +25 -1
- package/frontend-vue/app/components/DrawerTabs.vue +57 -0
- package/frontend-vue/app/components/JsonCellPanel.vue +81 -85
- package/frontend-vue/app/components/QueryConsole.vue +6 -1
- package/frontend-vue/app/components/RowDrawer.vue +98 -124
- package/frontend-vue/app/components/SchemaDiagram.vue +134 -17
- package/frontend-vue/app/components/TableInspector.vue +122 -149
- package/frontend-vue/i18n/locales/database-en-GB.json +8 -12
- package/frontend-vue/i18n/locales/database-fr-FR.json +8 -12
- package/frontend-vue/package.json +2 -2
- package/frontend-vue/pnpm-lock.yaml +5 -5
- package/frontend-vue/tests/clientNavigation.test.ts +93 -0
- package/frontend-vue/tests/dataBrowser.test.ts +91 -1
- package/frontend-vue/tests/diagramLayout.test.ts +383 -0
- package/frontend-vue/tests/fixtures/serverRender.ts +114 -0
- package/frontend-vue/tests/locales.test.ts +48 -0
- package/frontend-vue/tests/onDemandReads.test.ts +81 -0
- package/frontend-vue/tests/serverRender.test.ts +83 -1
- package/frontend-vue/vitest.config.ts +8 -1
- package/package.json +9 -8
- package/skills/dms-database/SKILL.md +2 -1
|
@@ -1,107 +1,103 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { jsonDraftText, parseJsonDraft } from '../build/data/cellValues'
|
|
3
|
+
|
|
4
|
+
// Edits a structured cell (an object or a list) as JSON in a DMS drawer;
|
|
5
|
+
// applying stages the value like any other cell. null empties the cell.
|
|
6
|
+
// Opened through `useDrawer`, it mounts anew for each cell. The editor fills
|
|
7
|
+
// the drawer's height, whatever its size (`fill`, never fewer than
|
|
8
|
+
// MIN_LINES), the DMS footer at the drawer's end.
|
|
9
|
+
|
|
2
10
|
const props = defineProps<{
|
|
3
|
-
open: boolean
|
|
4
11
|
column: string
|
|
5
12
|
value: unknown
|
|
6
13
|
readOnly: boolean
|
|
7
14
|
}>()
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}>()
|
|
16
|
+
// Applying settles the drawer with the value, cancelling with nothing (null
|
|
17
|
+
// is a value: it empties the cell).
|
|
18
|
+
const emit = defineEmits<{ success: [result?: { value: unknown }] }>()
|
|
13
19
|
|
|
14
|
-
// Edits a structured cell (an object or a list) as JSON; applying stages the
|
|
15
|
-
// value like any other cell. null empties the cell.
|
|
16
20
|
const { t } = useI18n()
|
|
17
21
|
|
|
18
|
-
const
|
|
22
|
+
const MIN_LINES = 12
|
|
23
|
+
// The form field hands the drawer's height down to the editor.
|
|
24
|
+
const FILL = { root: 'flex flex-1 flex-col', container: 'flex flex-1 flex-col' }
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (!open) return
|
|
24
|
-
try {
|
|
25
|
-
draft.value = JSON.stringify(props.value, null, 2) ?? ''
|
|
26
|
-
} catch {
|
|
27
|
-
draft.value = ''
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
{ immediate: true },
|
|
31
|
-
)
|
|
26
|
+
const draft = ref(jsonDraftText(props.value))
|
|
27
|
+
|
|
28
|
+
const parsed = computed(() => parseJsonDraft(draft.value))
|
|
32
29
|
|
|
33
30
|
const parseError = computed(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return error instanceof Error
|
|
43
|
-
? `${t('dms_database.data.json.invalid')} — ${error.message}`
|
|
44
|
-
: t('dms_database.data.json.invalid')
|
|
45
|
-
}
|
|
31
|
+
const result = parsed.value
|
|
32
|
+
if (result.ok) return null
|
|
33
|
+
if (result.reason === 'not_structured')
|
|
34
|
+
return t('dms_database.data.json.not_structured')
|
|
35
|
+
// Localized prefix + the engine's parse detail (position, token…).
|
|
36
|
+
return result.detail
|
|
37
|
+
? `${t('dms_database.data.json.invalid')} — ${result.detail}`
|
|
38
|
+
: t('dms_database.data.json.invalid')
|
|
46
39
|
})
|
|
47
40
|
|
|
48
41
|
function save() {
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const result = parsed.value
|
|
43
|
+
if (!result.ok || props.readOnly) return
|
|
44
|
+
emit('success', { value: result.value })
|
|
51
45
|
}
|
|
52
46
|
</script>
|
|
53
47
|
|
|
54
48
|
<template>
|
|
55
|
-
<
|
|
56
|
-
:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
<div class="flex w-full min-w-0 flex-1 flex-col gap-4">
|
|
50
|
+
<!-- A DMS form of one field, stacked for the drawer: the column as its
|
|
51
|
+
label and the help above, the JSON in the DMS code input across the
|
|
52
|
+
drawer and down to the footer, the parse error under it in DMS error
|
|
53
|
+
style, the legend. -->
|
|
54
|
+
<div class="flex flex-1 flex-col gap-2">
|
|
55
|
+
<DmsFieldRow
|
|
56
|
+
layout="stack"
|
|
57
|
+
fill
|
|
58
|
+
:inset="false"
|
|
59
|
+
spacing="list"
|
|
60
|
+
:label="column"
|
|
61
|
+
label-for="dms-database-json-cell"
|
|
62
|
+
:description="t('dms_database.data.json.help')"
|
|
63
|
+
required
|
|
64
|
+
>
|
|
65
|
+
<UFormField
|
|
66
|
+
name="json"
|
|
67
|
+
:error="(!readOnly && parseError) || false"
|
|
68
|
+
:ui="FILL"
|
|
72
69
|
>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
</USlideover>
|
|
70
|
+
<DmsInputCode
|
|
71
|
+
id="dms-database-json-cell"
|
|
72
|
+
v-model="draft"
|
|
73
|
+
language="json"
|
|
74
|
+
fill
|
|
75
|
+
:min-lines="MIN_LINES"
|
|
76
|
+
:disabled="readOnly"
|
|
77
|
+
/>
|
|
78
|
+
<template #error="{ error }">
|
|
79
|
+
<DmsFormErrorText :error />
|
|
80
|
+
</template>
|
|
81
|
+
</UFormField>
|
|
82
|
+
</DmsFieldRow>
|
|
83
|
+
<DmsFormRequiredLegend v-if="!readOnly" />
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<DmsContainerFooter>
|
|
87
|
+
<UButton
|
|
88
|
+
variant="outline"
|
|
89
|
+
color="neutral"
|
|
90
|
+
size="lg"
|
|
91
|
+
:label="t('dms_database.common.cancel')"
|
|
92
|
+
@click="emit('success')"
|
|
93
|
+
/>
|
|
94
|
+
<UButton
|
|
95
|
+
v-if="!readOnly"
|
|
96
|
+
size="lg"
|
|
97
|
+
:label="t('dms_database.data.json.apply')"
|
|
98
|
+
:disabled="Boolean(parseError)"
|
|
99
|
+
@click="save"
|
|
100
|
+
/>
|
|
101
|
+
</DmsContainerFooter>
|
|
102
|
+
</div>
|
|
107
103
|
</template>
|
|
@@ -54,7 +54,7 @@ const { confirm } = useConfirm()
|
|
|
54
54
|
const toast = useToast()
|
|
55
55
|
const { user } = useDmsUserSession()
|
|
56
56
|
const store = useQueryStore()
|
|
57
|
-
const { schemas } = useDatabaseSchemas()
|
|
57
|
+
const { schemas, ready: schemasRead } = useDatabaseSchemas()
|
|
58
58
|
|
|
59
59
|
const source = ref('')
|
|
60
60
|
const executing = ref(false)
|
|
@@ -585,6 +585,11 @@ onMounted(async () => {
|
|
|
585
585
|
await store.libraryRead
|
|
586
586
|
if (!(await openFromRoute())) restoreDraft()
|
|
587
587
|
})
|
|
588
|
+
|
|
589
|
+
// The page shows once the schemas (the first run's examples) and the library
|
|
590
|
+
// are read: a client navigation waits for them, as a server render does,
|
|
591
|
+
// instead of growing the result panel and filling the sidebar after it.
|
|
592
|
+
await Promise.all([schemasRead, store.libraryRead])
|
|
588
593
|
</script>
|
|
589
594
|
|
|
590
595
|
<template>
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
instanceBadge,
|
|
6
6
|
} from '../build/composables/useDataBrowserTabs'
|
|
7
7
|
import { browseSelectionQuery } from '../build/composables/useDataBrowserGrid'
|
|
8
|
-
import { onKeyStroke } from '@vueuse/core'
|
|
9
8
|
import {
|
|
10
9
|
cellLabel,
|
|
11
10
|
cellText,
|
|
12
11
|
draftText,
|
|
13
12
|
isStructured,
|
|
13
|
+
isWideValue,
|
|
14
14
|
parseDraft,
|
|
15
15
|
} from '../build/data/cellValues'
|
|
16
16
|
import { useStagedEdits } from '../build/data/stagedEdits'
|
|
@@ -19,19 +19,12 @@ import type { BrowserTab } from '../build/composables/useDataBrowserTabs'
|
|
|
19
19
|
import type { GridColumn } from '../build/composables/useDataBrowserGrid'
|
|
20
20
|
import { tableLink } from '../build/utils/databaseLinks'
|
|
21
21
|
import { describeRuntimeType } from '../build/utils/fieldTypes'
|
|
22
|
+
import DrawerTabs from './DrawerTabs.vue'
|
|
22
23
|
|
|
23
24
|
// One row of the data browser in a drawer: its fields, editable and staged
|
|
24
25
|
// like the grid's cells, its JSON, and the rows of other tables pointing at
|
|
25
|
-
// it.
|
|
26
|
-
|
|
27
|
-
interface RowNavigation {
|
|
28
|
-
index: number
|
|
29
|
-
total: number
|
|
30
|
-
hasPrev: boolean
|
|
31
|
-
hasNext: boolean
|
|
32
|
-
prev: () => void
|
|
33
|
-
next: () => void
|
|
34
|
-
}
|
|
26
|
+
// it. The DMS row header (the drawer's `rowHeader`) names the row, its
|
|
27
|
+
// position, previous / next and J / K.
|
|
35
28
|
|
|
36
29
|
interface RowReference {
|
|
37
30
|
schema: string
|
|
@@ -49,7 +42,6 @@ const props = defineProps<{
|
|
|
49
42
|
columns: GridColumn[]
|
|
50
43
|
table?: TableSummary
|
|
51
44
|
readOnly: boolean
|
|
52
|
-
navigation?: RowNavigation
|
|
53
45
|
onStage: (rowId: string, field: string, value: unknown) => void
|
|
54
46
|
onReview: () => void
|
|
55
47
|
}>()
|
|
@@ -91,6 +83,8 @@ const fields = computed(() =>
|
|
|
91
83
|
key: column.isPrimaryKey,
|
|
92
84
|
relation,
|
|
93
85
|
structured: isStructured(value),
|
|
86
|
+
// Laid out by the value read: editing it does not move the row.
|
|
87
|
+
wide: isWideValue(props.row[column.name]),
|
|
94
88
|
type: relation
|
|
95
89
|
? relation.toTable
|
|
96
90
|
: describeRuntimeType(column.type, column.name).label,
|
|
@@ -191,23 +185,23 @@ const referenceTotal = computed(() =>
|
|
|
191
185
|
(references.value ?? []).reduce((sum, reference) => sum + reference.count, 0),
|
|
192
186
|
)
|
|
193
187
|
|
|
194
|
-
const tabs = computed(() =>
|
|
195
|
-
{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
188
|
+
const tabs = computed(() => {
|
|
189
|
+
const items: { value: DrawerTab; label: string; badge?: number }[] = [
|
|
190
|
+
{
|
|
191
|
+
value: 'fields',
|
|
192
|
+
label: t('dms_database.data.row.fields'),
|
|
193
|
+
badge: props.columns.length,
|
|
194
|
+
},
|
|
195
|
+
{ value: 'json', label: t('dms_database.data.row.json') },
|
|
196
|
+
]
|
|
197
|
+
if (!props.readOnly)
|
|
198
|
+
items.push({
|
|
199
|
+
value: 'references',
|
|
200
|
+
label: t('dms_database.data.row.references'),
|
|
201
|
+
badge: referenceTotal.value,
|
|
202
|
+
})
|
|
203
|
+
return items
|
|
204
|
+
})
|
|
211
205
|
|
|
212
206
|
const scope = computed(() => {
|
|
213
207
|
const badge = instanceBadge(
|
|
@@ -224,76 +218,36 @@ const scopedInstance = computed(() =>
|
|
|
224
218
|
? undefined
|
|
225
219
|
: props.tab.instance,
|
|
226
220
|
)
|
|
227
|
-
|
|
228
|
-
function typing(event: KeyboardEvent): boolean {
|
|
229
|
-
return Boolean(
|
|
230
|
-
(event.target as HTMLElement | null)?.closest('input, textarea, select'),
|
|
231
|
-
)
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
onKeyStroke('j', (event) => {
|
|
235
|
-
if (!typing(event) && props.navigation?.hasNext) props.navigation.next()
|
|
236
|
-
})
|
|
237
|
-
onKeyStroke('k', (event) => {
|
|
238
|
-
if (!typing(event) && props.navigation?.hasPrev) props.navigation.prev()
|
|
239
|
-
})
|
|
240
221
|
</script>
|
|
241
222
|
|
|
242
223
|
<template>
|
|
243
|
-
<!-- As wide as the side drawer, as the table inspector
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
color="neutral"
|
|
256
|
-
variant="ghost"
|
|
257
|
-
size="xs"
|
|
258
|
-
:disabled="!navigation.hasPrev"
|
|
259
|
-
:title="t('dms_database.data.row.previous')"
|
|
260
|
-
:aria-label="t('dms_database.data.row.previous')"
|
|
261
|
-
@click="navigation.prev()"
|
|
262
|
-
/>
|
|
263
|
-
<UButton
|
|
264
|
-
icon="i-ph-caret-down"
|
|
265
|
-
color="neutral"
|
|
266
|
-
variant="ghost"
|
|
267
|
-
size="xs"
|
|
268
|
-
:disabled="!navigation.hasNext"
|
|
269
|
-
:title="t('dms_database.data.row.next')"
|
|
270
|
-
:aria-label="t('dms_database.data.row.next')"
|
|
271
|
-
@click="navigation.next()"
|
|
272
|
-
/>
|
|
273
|
-
</template>
|
|
274
|
-
</div>
|
|
275
|
-
<h3 class="text-highlighted font-mono text-lg font-semibold">
|
|
276
|
-
{{ rowId ?? t('dms_database.data.row.no_id') }}
|
|
277
|
-
</h3>
|
|
278
|
-
<UTabs
|
|
279
|
-
v-model="active"
|
|
280
|
-
:items="tabs"
|
|
281
|
-
variant="link"
|
|
282
|
-
size="sm"
|
|
283
|
-
:content="false"
|
|
284
|
-
/>
|
|
224
|
+
<!-- As wide as the side drawer, as the table inspector; it fills the
|
|
225
|
+
drawer's flex body, so the DMS footer sits at its end. -->
|
|
226
|
+
<div class="flex w-full min-w-0 flex-1 flex-col gap-4">
|
|
227
|
+
<header class="grid gap-3">
|
|
228
|
+
<p
|
|
229
|
+
class="text-muted flex min-w-0 items-start gap-1.5 font-mono text-xs"
|
|
230
|
+
data-row-scope
|
|
231
|
+
>
|
|
232
|
+
<UIcon name="i-ph-table" class="mt-px size-3.5 shrink-0" />
|
|
233
|
+
<span class="min-w-0 [overflow-wrap:anywhere]">{{ scope }}</span>
|
|
234
|
+
</p>
|
|
235
|
+
<DrawerTabs v-model="active" :items="tabs" />
|
|
285
236
|
</header>
|
|
286
237
|
|
|
287
|
-
<div class="min-
|
|
238
|
+
<div class="min-w-0">
|
|
288
239
|
<!-- Each field is a DMS form row: the column's name in the label
|
|
289
240
|
column, its type and staged change as help, the error under the
|
|
290
|
-
control.
|
|
291
|
-
|
|
241
|
+
control. A wide value (JSON, a long text) takes the row's width
|
|
242
|
+
under its label; the others sit beside it once the row is wide
|
|
243
|
+
enough (the row's container query). Every control keeps the same
|
|
244
|
+
end slot, "Set to null" or nothing: the column stays even. -->
|
|
292
245
|
<div v-if="active === 'fields'" class="flex flex-col">
|
|
293
246
|
<DmsFieldRow
|
|
294
247
|
v-for="field in fields"
|
|
295
248
|
:key="field.name"
|
|
296
|
-
layout="form"
|
|
249
|
+
:layout="field.wide ? 'stack' : 'form'"
|
|
250
|
+
:data-field-row="field.name"
|
|
297
251
|
:inset="false"
|
|
298
252
|
spacing="row"
|
|
299
253
|
:label-for="field.editable ? controlId(field.name) : undefined"
|
|
@@ -338,33 +292,46 @@ onKeyStroke('k', (event) => {
|
|
|
338
292
|
· {{ t('dms_database.data.row.not_editable') }}
|
|
339
293
|
</span>
|
|
340
294
|
</p>
|
|
341
|
-
<
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
295
|
+
<UFormField
|
|
296
|
+
v-else
|
|
297
|
+
:name="field.name"
|
|
298
|
+
:error="errors[field.name] ?? false"
|
|
299
|
+
:data-field="field.name"
|
|
300
|
+
class="min-w-0"
|
|
301
|
+
>
|
|
302
|
+
<div
|
|
303
|
+
class="flex min-w-0 gap-2"
|
|
304
|
+
:class="field.wide ? 'items-start' : 'min-h-8 items-center'"
|
|
346
305
|
>
|
|
347
|
-
<
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
306
|
+
<div class="min-w-0 flex-1">
|
|
307
|
+
<DmsSwitch
|
|
308
|
+
v-if="typeof field.value === 'boolean'"
|
|
309
|
+
:id="controlId(field.name)"
|
|
310
|
+
:model-value="field.value"
|
|
311
|
+
@update:model-value="setBoolean(field.name, Boolean($event))"
|
|
312
|
+
/>
|
|
313
|
+
<!-- JSON, or a text of several lines: a text area. -->
|
|
314
|
+
<DmsTextarea
|
|
315
|
+
v-else-if="field.wide"
|
|
316
|
+
:id="controlId(field.name)"
|
|
317
|
+
:model-value="draftOf(field.name, field.value)"
|
|
318
|
+
:rows="field.structured ? 4 : 2"
|
|
319
|
+
autoresize
|
|
320
|
+
class="w-full font-mono"
|
|
321
|
+
:class="{ 'text-xs': field.structured }"
|
|
322
|
+
:color="
|
|
323
|
+
errors[field.name]
|
|
324
|
+
? 'error'
|
|
325
|
+
: field.staged
|
|
326
|
+
? 'warning'
|
|
327
|
+
: 'primary'
|
|
328
|
+
"
|
|
329
|
+
:highlight="Boolean(field.staged || errors[field.name])"
|
|
330
|
+
@update:model-value="drafts[field.name] = String($event)"
|
|
331
|
+
@blur="commit(field)"
|
|
332
|
+
/>
|
|
367
333
|
<DmsInputText
|
|
334
|
+
v-else
|
|
368
335
|
:id="controlId(field.name)"
|
|
369
336
|
:model-value="draftOf(field.name, field.value)"
|
|
370
337
|
:title="t('dms_database.data.grid.null_hint')"
|
|
@@ -373,7 +340,7 @@ onKeyStroke('k', (event) => {
|
|
|
373
340
|
? 'null'
|
|
374
341
|
: undefined
|
|
375
342
|
"
|
|
376
|
-
class="
|
|
343
|
+
class="w-full font-mono"
|
|
377
344
|
:color="
|
|
378
345
|
errors[field.name]
|
|
379
346
|
? 'error'
|
|
@@ -386,20 +353,26 @@ onKeyStroke('k', (event) => {
|
|
|
386
353
|
@blur="commit(field)"
|
|
387
354
|
@keydown.enter.prevent="commit(field)"
|
|
388
355
|
/>
|
|
356
|
+
</div>
|
|
357
|
+
<!-- The end slot, as wide with its button or without. -->
|
|
358
|
+
<div class="flex w-8 shrink-0 justify-center" data-null-slot>
|
|
389
359
|
<UButton
|
|
390
360
|
v-if="field.value !== null && field.value !== undefined"
|
|
361
|
+
icon="i-ph-circle-dashed"
|
|
391
362
|
size="sm"
|
|
392
363
|
color="neutral"
|
|
393
364
|
variant="ghost"
|
|
394
|
-
|
|
365
|
+
square
|
|
366
|
+
:title="t('dms_database.data.row.set_null')"
|
|
367
|
+
:aria-label="t('dms_database.data.row.set_null')"
|
|
395
368
|
@click="setNull(field.name)"
|
|
396
369
|
/>
|
|
397
370
|
</div>
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
</
|
|
402
|
-
</
|
|
371
|
+
</div>
|
|
372
|
+
<template v-if="errors[field.name]" #error="{ error }">
|
|
373
|
+
<DmsFormErrorText :error />
|
|
374
|
+
</template>
|
|
375
|
+
</UFormField>
|
|
403
376
|
<DmsAutoLink
|
|
404
377
|
@click="emit('success')"
|
|
405
378
|
v-if="
|
|
@@ -492,9 +465,11 @@ onKeyStroke('k', (event) => {
|
|
|
492
465
|
</div>
|
|
493
466
|
</div>
|
|
494
467
|
|
|
495
|
-
<
|
|
468
|
+
<DmsContainerFooter
|
|
496
469
|
v-if="!readOnly"
|
|
497
|
-
|
|
470
|
+
data-row-footer
|
|
471
|
+
class="min-h-14"
|
|
472
|
+
justify="between"
|
|
498
473
|
>
|
|
499
474
|
<span class="text-dimmed flex items-center gap-1.5 text-xs">
|
|
500
475
|
<span v-if="pending" class="bg-warning size-1.5 rounded-full" />
|
|
@@ -506,12 +481,11 @@ onKeyStroke('k', (event) => {
|
|
|
506
481
|
</span>
|
|
507
482
|
<UButton
|
|
508
483
|
v-if="tabPending > 0"
|
|
509
|
-
class="ml-auto"
|
|
510
484
|
size="sm"
|
|
511
485
|
icon="i-ph-check"
|
|
512
486
|
:label="t('dms_database.data.save.review', tabPending)"
|
|
513
487
|
@click="onReview"
|
|
514
488
|
/>
|
|
515
|
-
</
|
|
489
|
+
</DmsContainerFooter>
|
|
516
490
|
</div>
|
|
517
491
|
</template>
|