@antcde/component-library 0.1.1 → 0.1.2
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 +6 -0
- package/dist/component-library.css +1 -1
- package/dist/index.js +17133 -18175
- package/dist/types/components/BaseAppCard.vue.d.ts +18 -4
- package/dist/types/components/BaseAppCardSkeleton.vue.d.ts +2 -0
- package/dist/types/components/BaseDeleteDialog.vue.d.ts +20 -7
- package/dist/types/components/RBAC/Permissions/PermissionCard.vue.d.ts +1 -1
- package/dist/types/components/TasksFlow/useTaskFlow.d.ts +7 -5
- package/dist/types/index.d.ts +3 -1
- package/lib/DocumentManager/DocumentDrop.vue +2 -6
- package/lib/DocumentManager/DocumentManager.vue +45 -43
- package/lib/DocumentManager/hooks/useDms.ts +1 -3
- package/lib/DocumentManager/index.ts +1 -1
- package/lib/DocumentManager/lang/translations/de.json +36 -0
- package/lib/DocumentManager/lang/translations/en.json +38 -0
- package/lib/DocumentManager/lang/translations/nl.json +36 -0
- package/lib/DocumentManager/utils.ts +1 -1
- package/lib/ForgeViewer/ForgeViewer.vue +6 -5
- package/lib/ForgeViewer/lang/translations/de.json +6 -0
- package/lib/ForgeViewer/lang/translations/en.json +6 -0
- package/lib/ForgeViewer/lang/translations/nl.json +6 -0
- package/lib/ForgeViewer/useForgeViewer.ts +0 -1
- package/lib/GisViewer/GisViewer.vue +14 -8
- package/lib/GisViewer/useGisViewer.ts +3 -3
- package/package.json +4 -3
- package/lib/TableViewer/TableViewer.vue +0 -79
- package/lib/TableViewer/composables/columns.ts +0 -51
- package/lib/TableViewer/composables/records.ts +0 -70
- package/lib/TableViewer/composables/relations.ts +0 -8
- package/lib/TableViewer/composables/useFile.ts +0 -20
- package/lib/TableViewer/core/Columns/ColumnForm.vue +0 -443
- package/lib/TableViewer/core/Columns/ColumnItem.vue +0 -225
- package/lib/TableViewer/core/Columns/ColumnsList.vue +0 -142
- package/lib/TableViewer/core/Columns/ForeignKeyColumnItem.vue +0 -165
- package/lib/TableViewer/core/Columns/ForeignKeyColumnsList.vue +0 -55
- package/lib/TableViewer/core/Dialog/DeleteConfirmationDialog.vue +0 -63
- package/lib/TableViewer/core/Filters/ConditionItem.vue +0 -133
- package/lib/TableViewer/core/Filters/ConditionsList.vue +0 -53
- package/lib/TableViewer/core/Filters/FiltersEditor.vue +0 -48
- package/lib/TableViewer/core/Filters/QueriesList.vue +0 -63
- package/lib/TableViewer/core/Filters/QueryItem.vue +0 -112
- package/lib/TableViewer/core/Records/RecordCell.vue +0 -108
- package/lib/TableViewer/core/Records/RecordForm.vue +0 -146
- package/lib/TableViewer/core/Records/RecordHeader.vue +0 -82
- package/lib/TableViewer/core/Records/RecordInput.vue +0 -234
- package/lib/TableViewer/core/Records/RecordValue.vue +0 -170
- package/lib/TableViewer/core/Records/RecordsTable.vue +0 -274
- package/lib/TableViewer/core/Records/RecordsTableToolbar.vue +0 -210
- package/lib/TableViewer/core/Revisions/RevisionComparisonCell.vue +0 -50
- package/lib/TableViewer/core/Revisions/RevisionComparisonTable.vue +0 -98
- package/lib/TableViewer/core/Revisions/RevisionHistory.vue +0 -156
- package/lib/TableViewer/core/Revisions/RevisionSelector.vue +0 -140
- package/lib/TableViewer/core/Tables/TableEditor.vue +0 -136
- package/lib/TableViewer/core/Tables/TableItem.vue +0 -162
- package/lib/TableViewer/core/Tables/TableViewer.vue +0 -28
- package/lib/TableViewer/core/Tables/TablesList.vue +0 -116
- package/lib/TableViewer/index.ts +0 -4
- package/lib/TableViewer/services/file-handler.ts +0 -84
- package/lib/TableViewer/stores/client.ts +0 -18
- package/lib/TableViewer/stores/columnRelation.ts +0 -106
- package/lib/TableViewer/stores/columns.ts +0 -171
- package/lib/TableViewer/stores/conditions.ts +0 -86
- package/lib/TableViewer/stores/permissions.ts +0 -102
- package/lib/TableViewer/stores/queries.ts +0 -80
- package/lib/TableViewer/stores/records.ts +0 -325
- package/lib/TableViewer/stores/relations.ts +0 -89
- package/lib/TableViewer/stores/revisions.ts +0 -194
- package/lib/TableViewer/stores/roles.ts +0 -109
- package/lib/TableViewer/stores/table.ts +0 -130
- package/lib/TableViewer/stores/tables.ts +0 -65
- package/lib/TableViewer/types/app.d.ts +0 -5
- package/lib/TableViewer/types/column.d.ts +0 -28
- package/lib/TableViewer/types/permission.d.ts +0 -12
- package/lib/TableViewer/types/project.d.ts +0 -37
- package/lib/TableViewer/types/relations.d.ts +0 -7
- package/lib/TableViewer/types/tables.d.ts +0 -69
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Column } from '@antcde/connect-ts/services/ColumnService'
|
|
3
|
-
import { useI18n } from 'vue-i18n'
|
|
4
|
-
import ColumnItem from './ColumnItem.vue'
|
|
5
|
-
|
|
6
|
-
defineProps<{
|
|
7
|
-
columns: Partial<Column>[]
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
const emit = defineEmits<{
|
|
11
|
-
(e: 'columns:add'): void
|
|
12
|
-
(e: 'columns:remove', index: number): void
|
|
13
|
-
(e: 'columns:update', index: number, data: Partial<Column>): void
|
|
14
|
-
}>()
|
|
15
|
-
|
|
16
|
-
const { t } = useI18n()
|
|
17
|
-
|
|
18
|
-
const columnHeaders = [
|
|
19
|
-
{
|
|
20
|
-
title: t('project.tableConfig.columns.dialog.name'),
|
|
21
|
-
key: 'name',
|
|
22
|
-
width: 200,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
title: t('project.tableConfig.columns.dialog.type'),
|
|
26
|
-
key: 'type',
|
|
27
|
-
width: 200,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: t('project.tableConfig.columns.dialog.values'),
|
|
31
|
-
key: 'options_value',
|
|
32
|
-
width: 200,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
title: t('project.tableConfig.columns.dialog.default_value'),
|
|
36
|
-
key: 'default_value',
|
|
37
|
-
width: 200,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
title: t('project.tableConfig.columns.dialog.unique'),
|
|
41
|
-
key: 'is_unique',
|
|
42
|
-
width: 100,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
title: t('project.tableConfig.columns.dialog.required'),
|
|
46
|
-
key: 'required',
|
|
47
|
-
width: 100,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
title: '',
|
|
51
|
-
key: 'actions',
|
|
52
|
-
},
|
|
53
|
-
]
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<template>
|
|
57
|
-
<v-table>
|
|
58
|
-
<thead>
|
|
59
|
-
<tr>
|
|
60
|
-
<th v-for="header in columnHeaders" :key="header.key" :width="header.width">
|
|
61
|
-
{{ header.title }}
|
|
62
|
-
</th>
|
|
63
|
-
</tr>
|
|
64
|
-
</thead>
|
|
65
|
-
<tbody>
|
|
66
|
-
<!-- ID Column -->
|
|
67
|
-
<tr>
|
|
68
|
-
<td class="pr-2 pl-0">
|
|
69
|
-
<v-text-field
|
|
70
|
-
model-value="ID"
|
|
71
|
-
disabled
|
|
72
|
-
variant="outlined"
|
|
73
|
-
hide-details
|
|
74
|
-
density="compact"
|
|
75
|
-
class="w-full"
|
|
76
|
-
/>
|
|
77
|
-
</td>
|
|
78
|
-
<td class="pr-2 pl-0">
|
|
79
|
-
<v-select
|
|
80
|
-
model-value="UUID"
|
|
81
|
-
:items="['UUID']"
|
|
82
|
-
variant="outlined"
|
|
83
|
-
color="primary"
|
|
84
|
-
hide-details
|
|
85
|
-
density="compact"
|
|
86
|
-
:menu-props="{ maxHeight: '400', width: '400' }"
|
|
87
|
-
disabled
|
|
88
|
-
/>
|
|
89
|
-
</td>
|
|
90
|
-
<td />
|
|
91
|
-
<td />
|
|
92
|
-
<td>
|
|
93
|
-
<v-checkbox
|
|
94
|
-
disabled
|
|
95
|
-
:model-value="true"
|
|
96
|
-
color="primary"
|
|
97
|
-
hide-details
|
|
98
|
-
density="compact"
|
|
99
|
-
variant="outlined"
|
|
100
|
-
type="switch"
|
|
101
|
-
/>
|
|
102
|
-
</td>
|
|
103
|
-
<td>
|
|
104
|
-
<v-checkbox
|
|
105
|
-
disabled
|
|
106
|
-
:model-value="true"
|
|
107
|
-
color="primary"
|
|
108
|
-
hide-details
|
|
109
|
-
density="compact"
|
|
110
|
-
variant="outlined"
|
|
111
|
-
type="switch"
|
|
112
|
-
/>
|
|
113
|
-
</td>
|
|
114
|
-
<td />
|
|
115
|
-
</tr>
|
|
116
|
-
<column-item
|
|
117
|
-
v-for="(column, index) in columns"
|
|
118
|
-
:key="column.id"
|
|
119
|
-
:column="column"
|
|
120
|
-
@column:save="(data) => emit('columns:update', index, data)"
|
|
121
|
-
@column:remove="emit('columns:remove', index)"
|
|
122
|
-
/>
|
|
123
|
-
</tbody>
|
|
124
|
-
<tfoot>
|
|
125
|
-
<tr>
|
|
126
|
-
<td colspan="7" class="text-center">
|
|
127
|
-
<v-btn
|
|
128
|
-
size="small"
|
|
129
|
-
variant="text"
|
|
130
|
-
color="primary"
|
|
131
|
-
prepend-icon="mdi-plus"
|
|
132
|
-
@click="emit('columns:add')"
|
|
133
|
-
>
|
|
134
|
-
Add new column
|
|
135
|
-
</v-btn>
|
|
136
|
-
</td>
|
|
137
|
-
</tr>
|
|
138
|
-
</tfoot>
|
|
139
|
-
</v-table>
|
|
140
|
-
</template>
|
|
141
|
-
|
|
142
|
-
<style scoped></style>
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Column } from '@antcde/connect-ts'
|
|
3
|
-
import type { RelatedEntity } from '@antcde/connect-ts/services/Table/ColumnRelationService'
|
|
4
|
-
import { storeToRefs } from 'pinia'
|
|
5
|
-
import { computed, ref, watch } from 'vue'
|
|
6
|
-
import { useColumnRelationStore } from '../../stores/columnRelation'
|
|
7
|
-
import { useColumnStore } from '../../stores/columns'
|
|
8
|
-
import { useTablesStore } from '../../stores/tables'
|
|
9
|
-
import { relationTypes } from '../../composables/relations'
|
|
10
|
-
|
|
11
|
-
const props = defineProps<{
|
|
12
|
-
column: Partial<Column>
|
|
13
|
-
}>()
|
|
14
|
-
const columnStore = useColumnStore()
|
|
15
|
-
const columnRelationStore = useColumnRelationStore()
|
|
16
|
-
|
|
17
|
-
const tablesStore = useTablesStore()
|
|
18
|
-
const { tables } = storeToRefs(tablesStore)
|
|
19
|
-
|
|
20
|
-
const displayLabelItems = ref<string[]>([])
|
|
21
|
-
|
|
22
|
-
watch(
|
|
23
|
-
() => props.column,
|
|
24
|
-
async (c) => {
|
|
25
|
-
if (c.column_relation?.related_entity === 'table_record') {
|
|
26
|
-
const columns = await columnStore.fetchTableColumns(c.column_relation.related_table_id ?? '')
|
|
27
|
-
displayLabelItems.value = columns.filter(column => ['text', 'text-field', 'email', 'link'].includes(column.type)).map(column => column.name)
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
{ immediate: true },
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
function getColumnRelationLabel(column: Partial<Column>) {
|
|
34
|
-
const columnRelation = column.column_relation
|
|
35
|
-
const table = tables.value.find(table => table.id === columnRelation?.related_table_id)
|
|
36
|
-
return table ? table.name : columnRelation?.related_entity
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async function createColumnRelation(columnId: string, entity: RelatedEntity, tableId?: string) {
|
|
40
|
-
if (entity === 'table_record' && !tableId) {
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
columnRelationStore.addColumnRelation(columnId, {
|
|
45
|
-
related_entity: entity,
|
|
46
|
-
related_table_id: tableId ?? null,
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async function updateColumnRelation(
|
|
51
|
-
columnId: string,
|
|
52
|
-
columnRelationId: string,
|
|
53
|
-
displayLabel: string,
|
|
54
|
-
) {
|
|
55
|
-
columnRelationStore.updateColumnRelation(columnId, columnRelationId, {
|
|
56
|
-
display_label: displayLabel,
|
|
57
|
-
})
|
|
58
|
-
}
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<template>
|
|
62
|
-
<tr>
|
|
63
|
-
<td>
|
|
64
|
-
{{ column.name }}
|
|
65
|
-
</td>
|
|
66
|
-
<td>
|
|
67
|
-
<v-menu>
|
|
68
|
-
<template #activator="{ props: activatorProps }">
|
|
69
|
-
<v-text-field
|
|
70
|
-
v-bind="activatorProps"
|
|
71
|
-
:model-value="getColumnRelationLabel(column) ?? 'Select'"
|
|
72
|
-
variant="outlined"
|
|
73
|
-
hide-details
|
|
74
|
-
density="compact"
|
|
75
|
-
class="w-full"
|
|
76
|
-
color="primary"
|
|
77
|
-
append-inner-icon="mdi-chevron-down"
|
|
78
|
-
readonly
|
|
79
|
-
:disabled="column.column_relation?.id !== undefined"
|
|
80
|
-
/>
|
|
81
|
-
</template>
|
|
82
|
-
<v-card>
|
|
83
|
-
<v-list color="primary" max-height="400" class="overflow-auto">
|
|
84
|
-
<v-list-subheader> System </v-list-subheader>
|
|
85
|
-
|
|
86
|
-
<v-list-item
|
|
87
|
-
v-for="relationType in relationTypes"
|
|
88
|
-
:key="relationType.value"
|
|
89
|
-
:title="relationType.title"
|
|
90
|
-
:value="relationType.value"
|
|
91
|
-
:active="column.column_relation?.related_entity === relationType.value"
|
|
92
|
-
@click="createColumnRelation(column.id ?? '', relationType.value)"
|
|
93
|
-
/>
|
|
94
|
-
|
|
95
|
-
<v-divider />
|
|
96
|
-
<v-list-subheader> Table Records </v-list-subheader>
|
|
97
|
-
|
|
98
|
-
<v-list-item
|
|
99
|
-
v-for="table in tables"
|
|
100
|
-
:key="table.id"
|
|
101
|
-
:title="table.name"
|
|
102
|
-
:value="table.id"
|
|
103
|
-
:active="column.column_relation?.related_table_id === table.id"
|
|
104
|
-
density="compact"
|
|
105
|
-
@click="createColumnRelation(column.id ?? '', 'table_record', table.id)"
|
|
106
|
-
/>
|
|
107
|
-
</v-list>
|
|
108
|
-
</v-card>
|
|
109
|
-
</v-menu>
|
|
110
|
-
</td>
|
|
111
|
-
|
|
112
|
-
<td>
|
|
113
|
-
<v-menu
|
|
114
|
-
v-if="column.column_relation"
|
|
115
|
-
:disabled="column.column_relation?.related_entity !== 'table_record'"
|
|
116
|
-
>
|
|
117
|
-
<template #activator="{ props: activatorProps }">
|
|
118
|
-
<v-text-field
|
|
119
|
-
v-bind="activatorProps"
|
|
120
|
-
:model-value="column.column_relation.display_label"
|
|
121
|
-
variant="outlined"
|
|
122
|
-
hide-details
|
|
123
|
-
density="compact"
|
|
124
|
-
class="w-full"
|
|
125
|
-
color="primary"
|
|
126
|
-
append-inner-icon="mdi-chevron-down"
|
|
127
|
-
:disabled="column.column_relation?.related_entity !== 'table_record'"
|
|
128
|
-
readonly
|
|
129
|
-
/>
|
|
130
|
-
</template>
|
|
131
|
-
<v-card>
|
|
132
|
-
<v-list color="primary" max-height="400" class="overflow-auto">
|
|
133
|
-
<v-list-item
|
|
134
|
-
v-for="tableColumn in displayLabelItems"
|
|
135
|
-
:key="tableColumn"
|
|
136
|
-
density="compact"
|
|
137
|
-
:title="tableColumn"
|
|
138
|
-
:active="column.column_relation?.display_label === tableColumn"
|
|
139
|
-
:disabled="displayLabelItems.length === 0"
|
|
140
|
-
@click="updateColumnRelation(column.id ?? '', column.column_relation.id, tableColumn)"
|
|
141
|
-
/>
|
|
142
|
-
</v-list>
|
|
143
|
-
</v-card>
|
|
144
|
-
</v-menu>
|
|
145
|
-
</td>
|
|
146
|
-
|
|
147
|
-
<td>
|
|
148
|
-
<v-btn
|
|
149
|
-
v-if="column.column_relation"
|
|
150
|
-
size="small"
|
|
151
|
-
density="compact"
|
|
152
|
-
variant="text"
|
|
153
|
-
icon
|
|
154
|
-
color="red-lighten-1"
|
|
155
|
-
@click="
|
|
156
|
-
columnRelationStore.deleteColumnRelation(column.id ?? '', column.column_relation?.id ?? '')
|
|
157
|
-
"
|
|
158
|
-
>
|
|
159
|
-
<v-icon>mdi-delete</v-icon>
|
|
160
|
-
</v-btn>
|
|
161
|
-
</td>
|
|
162
|
-
</tr>
|
|
163
|
-
</template>
|
|
164
|
-
|
|
165
|
-
<style scoped></style>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Column } from '@antcde/connect-ts'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import ForeignKeyColumnsItem from './ForeignKeyColumnItem.vue'
|
|
5
|
-
|
|
6
|
-
const props = defineProps<{
|
|
7
|
-
columns: Partial<Column>[]
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const uuidColumns = computed(() => props.columns.filter(column => column.type === 'uuid'))
|
|
12
|
-
|
|
13
|
-
const relationHeaders: ReadonlyArray<{
|
|
14
|
-
title?: string
|
|
15
|
-
key: string
|
|
16
|
-
}> = [
|
|
17
|
-
{
|
|
18
|
-
title: 'Column',
|
|
19
|
-
key: 'name',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: 'Related Table',
|
|
23
|
-
key: 'related_entity',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
title: 'Display Label',
|
|
27
|
-
key: 'display_label',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
key: 'actions',
|
|
31
|
-
},
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<template>
|
|
37
|
-
<v-table>
|
|
38
|
-
<thead>
|
|
39
|
-
<tr>
|
|
40
|
-
<th v-for="header in relationHeaders" :key="header.key" :width="header">
|
|
41
|
-
{{ header.title }}
|
|
42
|
-
</th>
|
|
43
|
-
</tr>
|
|
44
|
-
</thead>
|
|
45
|
-
<tbody>
|
|
46
|
-
<foreign-key-columns-item
|
|
47
|
-
v-for="column in uuidColumns"
|
|
48
|
-
:key="column.id"
|
|
49
|
-
:column="column"
|
|
50
|
-
/>
|
|
51
|
-
</tbody>
|
|
52
|
-
</v-table>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<style scoped></style>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { ref, watch, defineProps, defineEmits } from 'vue'
|
|
3
|
-
|
|
4
|
-
// Define props
|
|
5
|
-
const props = defineProps<{
|
|
6
|
-
modelValue: boolean
|
|
7
|
-
message?: string
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
// Define emits
|
|
11
|
-
const emit = defineEmits<{
|
|
12
|
-
(e: 'update:modelValue', value: boolean): void
|
|
13
|
-
(e: 'confirm'): void
|
|
14
|
-
}>()
|
|
15
|
-
|
|
16
|
-
// Local state for dialog visibility
|
|
17
|
-
const dialog = ref(props.modelValue)
|
|
18
|
-
|
|
19
|
-
// Watch for changes in the modelValue prop and sync with local state
|
|
20
|
-
watch(
|
|
21
|
-
() => props.modelValue,
|
|
22
|
-
(newValue) => {
|
|
23
|
-
dialog.value = newValue
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
// Watch for changes in the local dialog state and emit updates
|
|
28
|
-
watch(dialog, (newValue) => {
|
|
29
|
-
emit('update:modelValue', newValue)
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
// Methods
|
|
33
|
-
const confirmDelete = () => {
|
|
34
|
-
emit('confirm')
|
|
35
|
-
dialog.value = false
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const closeDialog = () => {
|
|
39
|
-
dialog.value = false
|
|
40
|
-
}
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<template>
|
|
44
|
-
<v-dialog v-model="dialog" max-width="500">
|
|
45
|
-
<v-card>
|
|
46
|
-
<v-card-title class="headline">Confirm Deletion</v-card-title>
|
|
47
|
-
<v-divider />
|
|
48
|
-
<v-card-text>
|
|
49
|
-
{{ message ?? 'Are you sure you want to delete this item? This action cannot be undone.' }}
|
|
50
|
-
</v-card-text>
|
|
51
|
-
<v-divider />
|
|
52
|
-
<v-card-actions>
|
|
53
|
-
<v-spacer />
|
|
54
|
-
<v-btn color="red" text @click="confirmDelete">Delete</v-btn>
|
|
55
|
-
<v-btn color="grey" text @click="closeDialog">Cancel</v-btn>
|
|
56
|
-
</v-card-actions>
|
|
57
|
-
</v-card>
|
|
58
|
-
</v-dialog>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<style scoped>
|
|
62
|
-
/* Add any custom styles here */
|
|
63
|
-
</style>
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { useConditionStore, type Condition } from '../../stores/conditions'
|
|
3
|
-
import { useColumnStore } from '../../stores/columns'
|
|
4
|
-
import { storeToRefs } from 'pinia'
|
|
5
|
-
import { computed } from 'vue'
|
|
6
|
-
import RecordInput from '../Records/RecordInput.vue'
|
|
7
|
-
|
|
8
|
-
const props = defineProps<{
|
|
9
|
-
condition: Condition
|
|
10
|
-
}>()
|
|
11
|
-
|
|
12
|
-
const columnStore = useColumnStore()
|
|
13
|
-
const conditionStore = useConditionStore()
|
|
14
|
-
|
|
15
|
-
const { columns } = storeToRefs(columnStore)
|
|
16
|
-
|
|
17
|
-
const selectedColumn = computed(() =>
|
|
18
|
-
columns.value.find((column) => column.id === props.condition.column)
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
const operators = computed(() => {
|
|
22
|
-
if (!selectedColumn.value) return []
|
|
23
|
-
|
|
24
|
-
if (['text', 'text-field', 'email', 'link'].includes(selectedColumn.value.type)) {
|
|
25
|
-
return ['=', '<>', 'like']
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (['integer', 'float', 'date'].includes(selectedColumn.value.type)) {
|
|
29
|
-
return ['=', '<>', '>', '<', '>=', '<=']
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (['boolean', 'dropdown', 'uuid'].includes(selectedColumn.value.type)) {
|
|
33
|
-
return ['=', '<>']
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return []
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
const operatorWithLabels = computed(() => {
|
|
40
|
-
return operators.value.map((operator) => {
|
|
41
|
-
switch (operator) {
|
|
42
|
-
case '=':
|
|
43
|
-
return { value: operator, label: 'Equals' }
|
|
44
|
-
case '<>':
|
|
45
|
-
return { value: operator, label: 'Not Equals' }
|
|
46
|
-
case '>':
|
|
47
|
-
return { value: operator, label: 'Greater Than' }
|
|
48
|
-
case '<':
|
|
49
|
-
return { value: operator, label: 'Less Than' }
|
|
50
|
-
case '>=':
|
|
51
|
-
return { value: operator, label: 'Greater Than or Equal To' }
|
|
52
|
-
case '<=':
|
|
53
|
-
return { value: operator, label: 'Less Than or Equal To' }
|
|
54
|
-
default:
|
|
55
|
-
return { value: operator, label: operator }
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
// const showFilterIcon = computed(() => ['text', 'integer', 'float', 'email', 'boolean'].includes(column.value.type))
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<template>
|
|
64
|
-
<v-card variant="outlined" color="grey-lighten-2" class="p-4">
|
|
65
|
-
<v-sheet class="d-flex flex-column gap-4">
|
|
66
|
-
<v-sheet class="d-flex flex-row gap-4 w-full items-center">
|
|
67
|
-
<v-sheet class="d-flex flex-column w-full">
|
|
68
|
-
<v-label class="mr-2 font-semibold"> Column </v-label>
|
|
69
|
-
<v-select
|
|
70
|
-
variant="outlined"
|
|
71
|
-
color="primary"
|
|
72
|
-
hide-details
|
|
73
|
-
density="compact"
|
|
74
|
-
:items="columns"
|
|
75
|
-
item-title="name"
|
|
76
|
-
item-value="id"
|
|
77
|
-
:model-value="condition.column ?? ''"
|
|
78
|
-
@update:model-value="
|
|
79
|
-
(column) => conditionStore.updateCondition(condition.id, { column })
|
|
80
|
-
"
|
|
81
|
-
class="flex-grow-1"
|
|
82
|
-
/>
|
|
83
|
-
</v-sheet>
|
|
84
|
-
<v-sheet class="d-flex flex-column w-full">
|
|
85
|
-
<v-label class="mr-2 font-semibold"> Operator </v-label>
|
|
86
|
-
<v-select
|
|
87
|
-
variant="outlined"
|
|
88
|
-
color="primary"
|
|
89
|
-
hide-details
|
|
90
|
-
:disabled="!selectedColumn"
|
|
91
|
-
density="compact"
|
|
92
|
-
:items="operatorWithLabels"
|
|
93
|
-
item-value="value"
|
|
94
|
-
item-title="label"
|
|
95
|
-
:model-value="condition.operator"
|
|
96
|
-
@update:model-value="
|
|
97
|
-
(operator) => conditionStore.updateCondition(condition.id, { operator })
|
|
98
|
-
"
|
|
99
|
-
class="flex-grow-1"
|
|
100
|
-
/>
|
|
101
|
-
</v-sheet>
|
|
102
|
-
<v-btn
|
|
103
|
-
variant="text"
|
|
104
|
-
color="red-lighten-1"
|
|
105
|
-
@click="conditionStore.removeCondition(condition.id)"
|
|
106
|
-
class="ml-4 mt-6"
|
|
107
|
-
icon="mdi-delete"
|
|
108
|
-
/>
|
|
109
|
-
</v-sheet>
|
|
110
|
-
|
|
111
|
-
<v-sheet class="d-flex flex-column">
|
|
112
|
-
<v-label class="mr-2 font-semibold"> Value </v-label>
|
|
113
|
-
<v-text-field
|
|
114
|
-
v-if="!selectedColumn"
|
|
115
|
-
disabled
|
|
116
|
-
variant="outlined"
|
|
117
|
-
color="primary"
|
|
118
|
-
hide-details
|
|
119
|
-
density="compact"
|
|
120
|
-
class="flex-grow-1"
|
|
121
|
-
/>
|
|
122
|
-
<record-input
|
|
123
|
-
v-if="selectedColumn"
|
|
124
|
-
:model-value="condition.value"
|
|
125
|
-
@update:model-value="(value) => conditionStore.updateCondition(condition.id, { value })"
|
|
126
|
-
:column="selectedColumn"
|
|
127
|
-
hide-label
|
|
128
|
-
class="flex-grow-1"
|
|
129
|
-
/>
|
|
130
|
-
</v-sheet>
|
|
131
|
-
</v-sheet>
|
|
132
|
-
</v-card>
|
|
133
|
-
</template>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useConditionStore } from '../../stores/conditions'
|
|
3
|
-
import { watch } from 'vue'
|
|
4
|
-
import { storeToRefs } from 'pinia'
|
|
5
|
-
import ConditionItem from './ConditionItem.vue'
|
|
6
|
-
|
|
7
|
-
const emit = defineEmits<{
|
|
8
|
-
(e: 'close'): void
|
|
9
|
-
}>()
|
|
10
|
-
|
|
11
|
-
const conditionStore = useConditionStore()
|
|
12
|
-
const { conditions } = storeToRefs(conditionStore)
|
|
13
|
-
|
|
14
|
-
const isExpanded = defineModel<boolean>('isExpanded')
|
|
15
|
-
|
|
16
|
-
function applyFilters() {
|
|
17
|
-
conditionStore.applyConditions()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function clearFilters() {
|
|
21
|
-
conditionStore.clearConditions()
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
watch(
|
|
25
|
-
() => conditions.value,
|
|
26
|
-
(newConditions) => {
|
|
27
|
-
if (newConditions.length === 0) {
|
|
28
|
-
conditionStore.addCondition()
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
{ immediate: true }
|
|
32
|
-
)
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<template>
|
|
36
|
-
<v-sheet class="d-flex h-full flex-col overflow-hidden">
|
|
37
|
-
<v-sheet class="h-full overflow-auto ">
|
|
38
|
-
<div class="d-flex gap-4 flex flex-column py-4 px-4">
|
|
39
|
-
<condition-item :condition="condition" v-for="condition in conditions" :key="condition.id"> </condition-item>
|
|
40
|
-
</div>
|
|
41
|
-
</v-sheet>
|
|
42
|
-
|
|
43
|
-
<v-divider />
|
|
44
|
-
<v-sheet class="d-flex justify-end gap-4 pa-4">
|
|
45
|
-
<v-btn color="primary" variant="tonal" @click="conditionStore.addCondition"> Add </v-btn>
|
|
46
|
-
<v-spacer />
|
|
47
|
-
<v-btn color="primary" variant="tonal" @click="clearFilters"> Clear </v-btn>
|
|
48
|
-
<v-btn color="primary" variant="outlined" @click="applyFilters"> Apply </v-btn>
|
|
49
|
-
</v-sheet>
|
|
50
|
-
</v-sheet>
|
|
51
|
-
</template>
|
|
52
|
-
|
|
53
|
-
<style scoped></style>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import QueriesList from './QueriesList.vue'
|
|
4
|
-
import ConditionsList from './ConditionsList.vue'
|
|
5
|
-
|
|
6
|
-
const emit = defineEmits<{
|
|
7
|
-
(e: 'close'): void
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
const activeTab = ref<'queries' | 'conditions'>('conditions')
|
|
11
|
-
|
|
12
|
-
const isExpanded = defineModel<boolean>('isExpanded')
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<template>
|
|
16
|
-
<v-navigation-drawer
|
|
17
|
-
v-model="isExpanded"
|
|
18
|
-
:width="600"
|
|
19
|
-
:elevation="1"
|
|
20
|
-
location="right"
|
|
21
|
-
:border="0"
|
|
22
|
-
temporary
|
|
23
|
-
scrim
|
|
24
|
-
@update:model-value="emit('close')"
|
|
25
|
-
>
|
|
26
|
-
<v-card class="h-full overflow-hidden d-flex flex-col">
|
|
27
|
-
<v-tabs v-model="activeTab" align-tabs="center" grow hide-slider color="primary">
|
|
28
|
-
<v-tab value="conditions" prepend-icon="mdi-database-search" variant="tonal">
|
|
29
|
-
Conditions
|
|
30
|
-
</v-tab>
|
|
31
|
-
<v-tab value="queries" prepend-icon="mdi-table-filter" variant="tonal"> Queries </v-tab>
|
|
32
|
-
</v-tabs>
|
|
33
|
-
|
|
34
|
-
<v-divider />
|
|
35
|
-
|
|
36
|
-
<v-tabs-window v-model="activeTab" class="h-full overflow-auto">
|
|
37
|
-
<v-tabs-window-item value="queries" class="h-full overflow-auto">
|
|
38
|
-
<queries-list />
|
|
39
|
-
</v-tabs-window-item>
|
|
40
|
-
<v-tabs-window-item value="conditions" class="h-full overflow-auto">
|
|
41
|
-
<conditions-list />
|
|
42
|
-
</v-tabs-window-item>
|
|
43
|
-
</v-tabs-window>
|
|
44
|
-
</v-card>
|
|
45
|
-
</v-navigation-drawer>
|
|
46
|
-
</template>
|
|
47
|
-
|
|
48
|
-
<style scoped></style>
|