@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.
Files changed (76) hide show
  1. package/README.md +6 -0
  2. package/dist/component-library.css +1 -1
  3. package/dist/index.js +17133 -18175
  4. package/dist/types/components/BaseAppCard.vue.d.ts +18 -4
  5. package/dist/types/components/BaseAppCardSkeleton.vue.d.ts +2 -0
  6. package/dist/types/components/BaseDeleteDialog.vue.d.ts +20 -7
  7. package/dist/types/components/RBAC/Permissions/PermissionCard.vue.d.ts +1 -1
  8. package/dist/types/components/TasksFlow/useTaskFlow.d.ts +7 -5
  9. package/dist/types/index.d.ts +3 -1
  10. package/lib/DocumentManager/DocumentDrop.vue +2 -6
  11. package/lib/DocumentManager/DocumentManager.vue +45 -43
  12. package/lib/DocumentManager/hooks/useDms.ts +1 -3
  13. package/lib/DocumentManager/index.ts +1 -1
  14. package/lib/DocumentManager/lang/translations/de.json +36 -0
  15. package/lib/DocumentManager/lang/translations/en.json +38 -0
  16. package/lib/DocumentManager/lang/translations/nl.json +36 -0
  17. package/lib/DocumentManager/utils.ts +1 -1
  18. package/lib/ForgeViewer/ForgeViewer.vue +6 -5
  19. package/lib/ForgeViewer/lang/translations/de.json +6 -0
  20. package/lib/ForgeViewer/lang/translations/en.json +6 -0
  21. package/lib/ForgeViewer/lang/translations/nl.json +6 -0
  22. package/lib/ForgeViewer/useForgeViewer.ts +0 -1
  23. package/lib/GisViewer/GisViewer.vue +14 -8
  24. package/lib/GisViewer/useGisViewer.ts +3 -3
  25. package/package.json +4 -3
  26. package/lib/TableViewer/TableViewer.vue +0 -79
  27. package/lib/TableViewer/composables/columns.ts +0 -51
  28. package/lib/TableViewer/composables/records.ts +0 -70
  29. package/lib/TableViewer/composables/relations.ts +0 -8
  30. package/lib/TableViewer/composables/useFile.ts +0 -20
  31. package/lib/TableViewer/core/Columns/ColumnForm.vue +0 -443
  32. package/lib/TableViewer/core/Columns/ColumnItem.vue +0 -225
  33. package/lib/TableViewer/core/Columns/ColumnsList.vue +0 -142
  34. package/lib/TableViewer/core/Columns/ForeignKeyColumnItem.vue +0 -165
  35. package/lib/TableViewer/core/Columns/ForeignKeyColumnsList.vue +0 -55
  36. package/lib/TableViewer/core/Dialog/DeleteConfirmationDialog.vue +0 -63
  37. package/lib/TableViewer/core/Filters/ConditionItem.vue +0 -133
  38. package/lib/TableViewer/core/Filters/ConditionsList.vue +0 -53
  39. package/lib/TableViewer/core/Filters/FiltersEditor.vue +0 -48
  40. package/lib/TableViewer/core/Filters/QueriesList.vue +0 -63
  41. package/lib/TableViewer/core/Filters/QueryItem.vue +0 -112
  42. package/lib/TableViewer/core/Records/RecordCell.vue +0 -108
  43. package/lib/TableViewer/core/Records/RecordForm.vue +0 -146
  44. package/lib/TableViewer/core/Records/RecordHeader.vue +0 -82
  45. package/lib/TableViewer/core/Records/RecordInput.vue +0 -234
  46. package/lib/TableViewer/core/Records/RecordValue.vue +0 -170
  47. package/lib/TableViewer/core/Records/RecordsTable.vue +0 -274
  48. package/lib/TableViewer/core/Records/RecordsTableToolbar.vue +0 -210
  49. package/lib/TableViewer/core/Revisions/RevisionComparisonCell.vue +0 -50
  50. package/lib/TableViewer/core/Revisions/RevisionComparisonTable.vue +0 -98
  51. package/lib/TableViewer/core/Revisions/RevisionHistory.vue +0 -156
  52. package/lib/TableViewer/core/Revisions/RevisionSelector.vue +0 -140
  53. package/lib/TableViewer/core/Tables/TableEditor.vue +0 -136
  54. package/lib/TableViewer/core/Tables/TableItem.vue +0 -162
  55. package/lib/TableViewer/core/Tables/TableViewer.vue +0 -28
  56. package/lib/TableViewer/core/Tables/TablesList.vue +0 -116
  57. package/lib/TableViewer/index.ts +0 -4
  58. package/lib/TableViewer/services/file-handler.ts +0 -84
  59. package/lib/TableViewer/stores/client.ts +0 -18
  60. package/lib/TableViewer/stores/columnRelation.ts +0 -106
  61. package/lib/TableViewer/stores/columns.ts +0 -171
  62. package/lib/TableViewer/stores/conditions.ts +0 -86
  63. package/lib/TableViewer/stores/permissions.ts +0 -102
  64. package/lib/TableViewer/stores/queries.ts +0 -80
  65. package/lib/TableViewer/stores/records.ts +0 -325
  66. package/lib/TableViewer/stores/relations.ts +0 -89
  67. package/lib/TableViewer/stores/revisions.ts +0 -194
  68. package/lib/TableViewer/stores/roles.ts +0 -109
  69. package/lib/TableViewer/stores/table.ts +0 -130
  70. package/lib/TableViewer/stores/tables.ts +0 -65
  71. package/lib/TableViewer/types/app.d.ts +0 -5
  72. package/lib/TableViewer/types/column.d.ts +0 -28
  73. package/lib/TableViewer/types/permission.d.ts +0 -12
  74. package/lib/TableViewer/types/project.d.ts +0 -37
  75. package/lib/TableViewer/types/relations.d.ts +0 -7
  76. package/lib/TableViewer/types/tables.d.ts +0 -69
@@ -1,63 +0,0 @@
1
- <script setup lang="ts">
2
- import type { TableQueryColumn } from '@antcde/connect-ts/services/TableQueryService'
3
- import { storeToRefs } from 'pinia'
4
- import { ref } from 'vue'
5
- import { useI18n } from 'vue-i18n'
6
- import { useQueryStore } from '../../stores/queries'
7
- import { useRecordStore } from '../../stores/records'
8
- import { useConditionStore } from '../../stores/conditions'
9
- import QueryItem from './QueryItem.vue'
10
-
11
- const { t } = useI18n()
12
-
13
- const queryStore = useQueryStore()
14
- const { queries, isCreating } = storeToRefs(queryStore)
15
-
16
- const recordStore = useRecordStore()
17
- const { queryPayload } = storeToRefs(recordStore)
18
-
19
- const conditionStore = useConditionStore()
20
- const { appliedAndValidConditions } = storeToRefs(conditionStore)
21
-
22
- const queryName = ref('')
23
-
24
- function createQuery() {
25
- if (!queryName.value || appliedAndValidConditions.value.length === 0) {
26
- return
27
- }
28
-
29
- queryStore.createQuery(
30
- queryName.value,
31
- (queryPayload.value?.tables[0]?.columns as TableQueryColumn[]) ?? []
32
- )
33
- queryName.value = ''
34
- }
35
- </script>
36
-
37
- <template>
38
- <v-sheet class="d-flex h-full flex-col overflow-hidden">
39
- <v-sheet class="p-4">
40
- <v-label class="mr-2 font-semibold"> Query Name </v-label>
41
- <v-text-field
42
- v-model="queryName"
43
- color="primary"
44
- @keydown.enter="createQuery"
45
- :hint="
46
- appliedAndValidConditions.length > 0
47
- ? 'Press Enter to create a new query'
48
- : 'No conditions applied'
49
- "
50
- persistent-hint
51
- variant="outlined"
52
- density="compact"
53
- :disabled="isCreating || appliedAndValidConditions.length === 0"
54
- />
55
- </v-sheet>
56
- <v-divider />
57
- <v-expansion-panels :elevation="1" class="p-4" variant="accordion">
58
- <query-item v-for="query in queries" :key="query.id" :query="query" />
59
- </v-expansion-panels>
60
- </v-sheet>
61
- </template>
62
-
63
- <style scoped></style>
@@ -1,112 +0,0 @@
1
- <script setup lang="ts">
2
- import type { TableQuery } from '@antcde/connect-ts/services/TableQueryService'
3
- import { useConditionStore } from '../../stores/conditions'
4
- import { useQueryStore } from '../../stores/queries'
5
- import { useRecordStore } from '../../stores/records'
6
- import { computed } from 'vue'
7
- import { useI18n } from 'vue-i18n'
8
-
9
- const { t } = useI18n()
10
-
11
- const props = defineProps<{
12
- query: TableQuery
13
- }>()
14
-
15
- const conditionStore = useConditionStore()
16
- const queryStore = useQueryStore()
17
- const recordStore = useRecordStore()
18
-
19
- const conditions = computed(() => {
20
- try {
21
- const content = JSON.parse(props.query.content)
22
- return content.flatMap((column: any) => column.conditions.map((condition: any) => ({
23
- ...condition,
24
- applied: true,
25
- column_name: column.name,
26
- })))
27
- }
28
- catch {
29
- return []
30
- }
31
- })
32
-
33
- async function applyQuery() {
34
- conditionStore.conditions = conditions.value
35
- recordStore.fetchRecords()
36
- }
37
- </script>
38
-
39
- <template>
40
- <v-expansion-panel>
41
- <v-expansion-panel-title hide-actions>
42
- <template #default="{ expanded }">
43
- <v-row no-gutters>
44
- {{ query.name }}
45
- </v-row>
46
-
47
- <template v-if="expanded">
48
- <v-btn
49
- variant="text"
50
- size="small"
51
- icon="mdi-play"
52
- color="grey-darken-1"
53
- :disabled="conditions.length === 0"
54
- @click.prevent.stop="applyQuery"
55
- />
56
- <v-btn
57
- variant="text"
58
- size="small"
59
- icon="mdi-delete"
60
- color="grey-darken-1"
61
- @click.prevent.stop="() => queryStore.deleteQuery(query)"
62
- />
63
- </template>
64
-
65
- <template v-else>
66
- <v-btn
67
- variant="text"
68
- size="small"
69
- icon="mdi-chevron-down"
70
- />
71
- </template>
72
- </template>
73
- </v-expansion-panel-title>
74
-
75
- <v-sheet class="px-0">
76
- <v-table v-if="conditions.length" density="compact">
77
- <thead>
78
- <tr>
79
- <th class="text-left">
80
- {{ t('project.tableConfig.conditions.column') }}
81
- </th>
82
- <th class="text-left">
83
- {{ t('project.tableConfig.conditions.operator') }}
84
- </th>
85
- <th>
86
- {{ t('project.tableConfig.conditions.value') }}
87
- </th>
88
- </tr>
89
- </thead>
90
- <tbody>
91
- <tr
92
- v-for="condition in conditions"
93
- :key="condition.id"
94
- >
95
- <td>{{ condition.column_name }}</td>
96
- <td>{{ condition.operator }}</td>
97
- <td>{{ condition.value }}</td>
98
- </tr>
99
- </tbody>
100
- </v-table>
101
- <v-empty-state
102
- v-else
103
- icon="mdi-database-search"
104
- :text="t('project.tableConfig.queries.failedToParse')"
105
- />
106
- </v-sheet>
107
- </v-expansion-panel>
108
- </template>
109
-
110
- <style scoped>
111
-
112
- </style>
@@ -1,108 +0,0 @@
1
- <script lang="ts" setup>
2
- import type { Column } from '@antcde/connect-ts/services/ColumnService'
3
- import { storeToRefs } from 'pinia'
4
- import { computed, ref, watch } from 'vue'
5
- import { parseRecordBody } from '../../composables/records'
6
- import { useRecordStore } from '../../stores/records'
7
- import { useTableStore } from '../../stores/table'
8
- import RecordInput from '../Records/RecordInput.vue'
9
- import RecordValue from '../Records/RecordValue.vue'
10
-
11
- const props = defineProps<{
12
- recordId: string
13
- value: any
14
- column: Column
15
- }>()
16
-
17
- const isUpdating = ref(false)
18
- const currentCellValue = ref(props.value)
19
-
20
- const recordStore = useRecordStore()
21
- const { table } = storeToRefs(useTableStore())
22
- const { update: canUpdate } = table.value?.permissions ?? {}
23
-
24
- const isSelected = computed(() => recordStore.isCellSelected(props.recordId, props.column.id))
25
-
26
- const updateOnChange = computed(
27
- () => !['text', 'integer', 'link', 'float', 'email', 'text-field'].includes(props.column.type)
28
- )
29
-
30
- async function updateRecord() {
31
- if (!canUpdate || (props.column.required && !currentCellValue.value) || isUpdating.value) return
32
-
33
- try {
34
- isUpdating.value = true
35
-
36
- const body = await parseRecordBody([props.column], {
37
- [props.column.name]: currentCellValue.value
38
- })
39
-
40
- await recordStore.updateRecord(props.recordId, body)
41
-
42
- recordStore.selectNextCell()
43
- } finally {
44
- isUpdating.value = false
45
- }
46
- }
47
-
48
- function handleChange() {
49
- if (updateOnChange.value) {
50
- updateRecord()
51
- }
52
- }
53
-
54
- function handleEnter() {
55
- if (!updateOnChange.value) {
56
- updateRecord()
57
- }
58
- }
59
-
60
- function resetCell() {
61
- currentCellValue.value = props.value
62
- }
63
-
64
- watch(
65
- () => props.value,
66
- (value) => {
67
- currentCellValue.value = value
68
- }
69
- )
70
-
71
- watch(
72
- () => isSelected.value,
73
- (isSelected, wasSelected) => {
74
- if (wasSelected && !isSelected) {
75
- resetCell()
76
- }
77
- }
78
- )
79
- </script>
80
-
81
- <template>
82
- <div class="px-2">
83
- <record-input
84
- v-if="isSelected && canUpdate && false"
85
- v-model="currentCellValue"
86
- hide-label
87
- :column="column"
88
- :is-loading="isUpdating"
89
- :input-props="{
90
- hideDetails: true,
91
- variant: 'solo-filled',
92
- label: null,
93
- placeholder: null,
94
- singleLine: true,
95
- disabled: isUpdating,
96
- rows: 1,
97
- noResize: true
98
- }"
99
- @keydown.esc="resetCell"
100
- @keydown.enter="handleEnter"
101
- @update:model-value="handleChange"
102
- />
103
-
104
- <record-value v-else :value="value" :column="column" :record-id="recordId" />
105
- </div>
106
- </template>
107
-
108
- <style lang="scss" scoped></style>
@@ -1,146 +0,0 @@
1
- <script lang="ts" setup>
2
- import type { Column } from '@antcde/connect-ts/services/ColumnService'
3
- import type { TableRecord } from '@antcde/connect-ts/services/TableService'
4
- import { storeToRefs } from 'pinia'
5
- import { computed, ref, watch } from 'vue'
6
- import { useI18n } from 'vue-i18n'
7
- import { parseRecordBody, validateEmail } from '../../composables/records'
8
-
9
- import { useColumnStore } from '../../stores/columns'
10
- import { useRecordStore } from '../../stores/records'
11
- import RecordInput from '../Records/RecordInput.vue'
12
-
13
- const props = defineProps<{
14
- isDisplayed: boolean
15
- record?: TableRecord | null
16
- }>()
17
-
18
- const emit = defineEmits(['close'])
19
-
20
- const { t } = useI18n()
21
-
22
- const recordStore = useRecordStore()
23
- const columnStore = useColumnStore()
24
-
25
- const { isUpdating, isCreating } = storeToRefs(recordStore)
26
-
27
- const { columns } = storeToRefs(columnStore)
28
-
29
- const recordItem = ref<TableRecord>({
30
- id: ''
31
- })
32
-
33
- const isLoading = computed(() => isUpdating.value || isCreating.value)
34
- const isValid = computed(() =>
35
- columns.value.every((column) => validateColumnValue(column, recordItem.value[column.name]))
36
- )
37
-
38
- function validateColumnValue(column: Column, value: any) {
39
- if (column.required && !value) {
40
- return false
41
- }
42
- if (column.type === 'email') {
43
- return value ? validateEmail(value) : true
44
- }
45
- return true
46
- }
47
-
48
- async function saveRecord() {
49
- const body = await parseRecordBody(columns.value, recordItem.value)
50
- try {
51
- if (recordItem.value.id) {
52
- await recordStore.updateRecord(recordItem.value.id, body)
53
- } else {
54
- await recordStore.createRecord(body)
55
- }
56
- close()
57
- } catch (e) {
58
- console.error(e)
59
- }
60
- }
61
-
62
- function close() {
63
- emit('close')
64
- }
65
-
66
- function handleInputChange(column: Column, value: any) {
67
- recordItem.value[column.name] = value
68
- }
69
-
70
- watch(
71
- () => props.record,
72
- (record) => (recordItem.value = record ? { ...record } : { id: '' }),
73
- { immediate: true, deep: true }
74
- )
75
-
76
- const test = ref('')
77
- </script>
78
-
79
- <template>
80
- <v-navigation-drawer
81
- :model-value="isDisplayed"
82
- :width="800"
83
- :elevation="1"
84
- location="right"
85
- :border="0"
86
- temporary
87
- persistent
88
- scrim
89
- @update:model-value="close"
90
- >
91
- <v-sheet class="d-flex flex-col h-full">
92
- <v-toolbar
93
- class="d-flex flex-row justify-between align-center pe-4"
94
- color="grey-lighten-3"
95
- variant="tonal"
96
- density="compact"
97
- >
98
- <v-toolbar-title class="text-h6 font-semibold">
99
- {{
100
- t(
101
- recordItem.id
102
- ? 'project.records.dialog.updateTitle'
103
- : 'project.records.dialog.createTitle'
104
- )
105
- }}
106
- </v-toolbar-title>
107
- <v-spacer />
108
- <v-btn icon @click="emit('close')">
109
- <v-icon>mdi-close</v-icon>
110
- </v-btn>
111
- </v-toolbar>
112
- <v-divider />
113
-
114
- <v-card elevation="0" flat class="d-flex flex-col gap-1 h-full" v-if="isDisplayed">
115
- <v-card-text class="d-flex flex-col gap-4 overflow-auto">
116
- <record-input
117
- v-for="column in columns"
118
- :key="column.name"
119
- v-model="recordItem[column.name]"
120
- :column="column"
121
- :hide-label="false"
122
- />
123
- </v-card-text>
124
- </v-card>
125
-
126
- <v-divider />
127
-
128
- <v-sheet class="d-flex flex-row gap-4 justify-end align-center px-8 py-2">
129
- <v-btn :disabled="isLoading" variant="text" color="primary" @click="emit('close')">
130
- {{ t('system.buttons.cancel') }}
131
- </v-btn>
132
- <v-btn
133
- :disabled="isLoading || !isValid"
134
- :loading="isLoading"
135
- color="primary"
136
- variant="flat"
137
- @click="saveRecord"
138
- >
139
- {{ t('system.buttons.save') }}
140
- </v-btn>
141
- </v-sheet>
142
- </v-sheet>
143
- </v-navigation-drawer>
144
- </template>
145
-
146
- <style lang="scss" scoped></style>
@@ -1,82 +0,0 @@
1
- <script lang="ts" setup>
2
- import type { Column } from '@antcde/connect-ts'
3
- import { computed, ref, watch } from 'vue'
4
- import { useColumnStore } from '../../stores/columns'
5
- import { useTableStore } from '../../stores/table'
6
- import DeleteConfirmationDialog from '../Dialog/DeleteConfirmationDialog.vue'
7
- import { storeToRefs } from 'pinia'
8
-
9
- const props = defineProps<{
10
- column: Column
11
- }>()
12
-
13
- const emit = defineEmits<{
14
- (e: 'edit', column: Column): void
15
- }>()
16
-
17
- const columnStore = useColumnStore()
18
- const tableStore = useTableStore()
19
-
20
- const { permissions } = storeToRefs(tableStore)
21
-
22
- const columnData = ref<Partial<Column>>({})
23
-
24
- const canConfigure = computed(() => !!props.column && permissions)
25
-
26
- watch(
27
- () => props.column,
28
- (c) => (columnData.value = c ? { ...c } : {}),
29
- { immediate: true }
30
- )
31
-
32
- const showDeleteConfirmation = ref(false)
33
- </script>
34
-
35
- <template>
36
- <delete-confirmation-dialog
37
- v-if="column"
38
- v-model="showDeleteConfirmation"
39
- :message="`Are you sure you want to delete the column ${column.name}? This action cannot be undone.`"
40
- @confirm="columnStore.deleteColumn(column.id)"
41
- />
42
-
43
- <v-menu :disabled="!canConfigure" offset-y transition="slide-y-transition">
44
- <template #activator="{ props: activatorProps }">
45
- <v-card
46
- flat
47
- variant="plain"
48
- v-bind="activatorProps"
49
- color=""
50
- class="d-flex items-center h-full px-2 font-semibold font-italic"
51
- >
52
- {{ column.name }}
53
- <v-chip label class="ms-2 px-1" size="small" density="compact" variant="flat">
54
- {{ column.type }}
55
- </v-chip>
56
- </v-card>
57
- </template>
58
- <v-card>
59
- <v-list>
60
- <template v-if="canConfigure && column">
61
- <v-list-item
62
- prepend-icon="mdi-pen"
63
- title="Edit Column"
64
- density="compact"
65
- @click="emit('edit', { ...column })"
66
- />
67
- <v-divider />
68
- </template>
69
- <template v-if="canConfigure">
70
- <v-divider />
71
- <v-list-item
72
- base-color="red-darken-1"
73
- density="compact"
74
- prepend-icon="mdi-delete"
75
- title="Delete Column"
76
- @click="() => (showDeleteConfirmation = true)"
77
- />
78
- </template>
79
- </v-list>
80
- </v-card>
81
- </v-menu>
82
- </template>