@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
|
@@ -4,15 +4,21 @@ import GisViewerAppBar from './GisViewerAppBar.vue'
|
|
|
4
4
|
import { type ApplicationProps, useGisViewer } from './useGisViewer'
|
|
5
5
|
|
|
6
6
|
const { client, widgets, drawings, toolbar = true } = defineProps<ApplicationProps & { toolbar?: boolean }>()
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const {
|
|
8
|
+
clearSketch,
|
|
9
|
+
drawDrawings,
|
|
10
|
+
getSketch,
|
|
11
|
+
loadSketchGraphics,
|
|
12
|
+
setSketchColor,
|
|
13
|
+
toggleWidget,
|
|
14
|
+
} = useGisViewer({ client, widgets }, 'gisViewer')
|
|
9
15
|
|
|
10
16
|
defineExpose({
|
|
11
|
-
getSketch
|
|
12
|
-
clearSketch
|
|
13
|
-
setSketchColor
|
|
14
|
-
toggleWidget
|
|
15
|
-
loadSketchGraphics
|
|
17
|
+
getSketch,
|
|
18
|
+
clearSketch,
|
|
19
|
+
setSketchColor,
|
|
20
|
+
toggleWidget,
|
|
21
|
+
loadSketchGraphics,
|
|
16
22
|
})
|
|
17
23
|
|
|
18
24
|
watch(() => drawings, (newDrawings) => {
|
|
@@ -21,7 +27,7 @@ watch(() => drawings, (newDrawings) => {
|
|
|
21
27
|
Object.entries(newDrawings).forEach(([sbscode, drawingsArray]) => {
|
|
22
28
|
if (Array.isArray(drawingsArray)) {
|
|
23
29
|
// Call drawDrawings for each sbscode and its corresponding array of drawings
|
|
24
|
-
|
|
30
|
+
drawDrawings(sbscode, drawingsArray)
|
|
25
31
|
}
|
|
26
32
|
})
|
|
27
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { TableRecords } from '@antcde/connect-ts'
|
|
1
2
|
import type { UseCommsClient } from '@antcde/vue-utils'
|
|
2
|
-
import type { TableRecords } from '@antcde/connect-ts/services/TableService'
|
|
3
3
|
import Graphic from '@arcgis/core/Graphic'
|
|
4
4
|
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer'
|
|
5
5
|
import Map from '@arcgis/core/Map'
|
|
@@ -46,8 +46,8 @@ export const GIS_VIEWER_WIDGETS = {
|
|
|
46
46
|
|
|
47
47
|
type WidgetType = typeof GIS_VIEWER_WIDGETS[keyof typeof GIS_VIEWER_WIDGETS]
|
|
48
48
|
|
|
49
|
-
export function useGisViewer({ client, widgets = {} }: ApplicationProps) {
|
|
50
|
-
const container = ref
|
|
49
|
+
export function useGisViewer({ client, widgets = {} }: ApplicationProps, containerValue: string) {
|
|
50
|
+
const container = ref(containerValue)
|
|
51
51
|
const gisViewer = shallowRef<GisComposable>({
|
|
52
52
|
map: null,
|
|
53
53
|
view: null,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antcde/component-library",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"description": "Helper to use ant components in Vue 3",
|
|
6
6
|
"author": "CollaborAll",
|
|
7
7
|
"repository": {
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"vue-i18n": "^10.0.1",
|
|
68
68
|
"vue-router": "^4.4.4",
|
|
69
69
|
"vuetify": "^3.7.4",
|
|
70
|
-
"@antcde/
|
|
71
|
-
"@antcde/
|
|
70
|
+
"@antcde/vue-utils": "0.2.0",
|
|
71
|
+
"@antcde/connect-ts": "0.4.1"
|
|
72
72
|
},
|
|
73
73
|
"bundleDependencies": [
|
|
74
74
|
"vue",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
],
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@arcgis/core": "^4.30.9",
|
|
79
|
+
"@intlify/unplugin-vue-i18n": "^6.0.1",
|
|
79
80
|
"@mdi/font": "^7.2.96",
|
|
80
81
|
"@tsconfig/node20": "^20.1.4",
|
|
81
82
|
"@types/node": "^22.9.3",
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { ApplicationProps } from './types/app'
|
|
3
|
-
import { storeToRefs } from 'pinia'
|
|
4
|
-
import { ref, watch } from 'vue'
|
|
5
|
-
import TableEditor from './core/Tables/TableEditor.vue'
|
|
6
|
-
import TablesList from './core/Tables/TablesList.vue'
|
|
7
|
-
import TableViewer from './core/Tables/TableViewer.vue'
|
|
8
|
-
import { useClientStore } from './stores/client'
|
|
9
|
-
import { useColumnStore } from './stores/columns'
|
|
10
|
-
|
|
11
|
-
import { useTableStore } from './stores/table'
|
|
12
|
-
import { useTablesStore } from './stores/tables'
|
|
13
|
-
|
|
14
|
-
const { client } = defineProps<ApplicationProps>()
|
|
15
|
-
const clientStore = useClientStore()
|
|
16
|
-
clientStore.setClient(client)
|
|
17
|
-
|
|
18
|
-
const columnStore = useColumnStore()
|
|
19
|
-
const tablesStore = useTablesStore()
|
|
20
|
-
const tableStore = useTableStore()
|
|
21
|
-
|
|
22
|
-
const { tableType } = storeToRefs(tablesStore)
|
|
23
|
-
const { table: selectedTable } = storeToRefs(tableStore)
|
|
24
|
-
|
|
25
|
-
const { columns } = storeToRefs(columnStore)
|
|
26
|
-
|
|
27
|
-
const isTableEditorShown = ref(false)
|
|
28
|
-
|
|
29
|
-
watch(
|
|
30
|
-
() => client.context.value.project,
|
|
31
|
-
async project => project && tablesStore.fetchTables(),
|
|
32
|
-
{ immediate: true },
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<template>
|
|
38
|
-
<v-app>
|
|
39
|
-
<v-layout class="w-screen overflow-hidden">
|
|
40
|
-
<v-navigation-drawer :width="400" permanent persistent>
|
|
41
|
-
<v-card
|
|
42
|
-
class="h-full overflow-hidden d-flex flex-col w-[400px]"
|
|
43
|
-
>
|
|
44
|
-
<v-tabs v-model="tableType" align-tabs="center" grow hide-slider color="primary">
|
|
45
|
-
<v-tab value="data" prepend-icon="mdi-table-multiple" variant="tonal">
|
|
46
|
-
Data Tables
|
|
47
|
-
</v-tab>
|
|
48
|
-
|
|
49
|
-
<v-tab value="config" prepend-icon="mdi-table-cog" variant="tonal">
|
|
50
|
-
Config Tables
|
|
51
|
-
</v-tab>
|
|
52
|
-
</v-tabs>
|
|
53
|
-
|
|
54
|
-
<v-divider />
|
|
55
|
-
|
|
56
|
-
<v-tabs-window v-model="tableType" class="h-full overflow-auto px-2">
|
|
57
|
-
<v-tabs-window-item value="data">
|
|
58
|
-
<tables-list :tables="tablesStore.dataTables" can-create @table:edit="isTableEditorShown = true" />
|
|
59
|
-
</v-tabs-window-item>
|
|
60
|
-
<v-tabs-window-item value="config">
|
|
61
|
-
<tables-list :tables="tablesStore.configTables" :can-create="false" @table:edit="isTableEditorShown = true" />
|
|
62
|
-
</v-tabs-window-item>
|
|
63
|
-
</v-tabs-window>
|
|
64
|
-
</v-card>
|
|
65
|
-
</v-navigation-drawer>
|
|
66
|
-
|
|
67
|
-
<v-main class="w-screen">
|
|
68
|
-
<v-sheet class="h-full w-full" flat :elevated="0">
|
|
69
|
-
<table-viewer v-if="selectedTable" :key="selectedTable?.id" :client="client" />
|
|
70
|
-
<table-editor
|
|
71
|
-
v-model:is-expanded="isTableEditorShown"
|
|
72
|
-
:table="selectedTable"
|
|
73
|
-
:columns="columns"
|
|
74
|
-
/>
|
|
75
|
-
</v-sheet>
|
|
76
|
-
</v-main>
|
|
77
|
-
</v-layout>
|
|
78
|
-
</v-app>
|
|
79
|
-
</template>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export type ColumnGroup = 'text' | 'number' | 'boolean' | 'date' | 'enum' | 'uuid' | 'file'
|
|
2
|
-
|
|
3
|
-
export type ColumnType =
|
|
4
|
-
| 'uuid'
|
|
5
|
-
| 'text'
|
|
6
|
-
| 'email'
|
|
7
|
-
| 'text-field'
|
|
8
|
-
| 'link'
|
|
9
|
-
| 'dropdown'
|
|
10
|
-
| 'boolean'
|
|
11
|
-
| 'integer'
|
|
12
|
-
| 'float'
|
|
13
|
-
| 'document'
|
|
14
|
-
| 'date'
|
|
15
|
-
|
|
16
|
-
export interface ColumnTypeGroup {
|
|
17
|
-
key: ColumnType
|
|
18
|
-
group: ColumnGroup
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const columnsTypes: ColumnTypeGroup[] = [
|
|
22
|
-
{ key: 'boolean', group: 'boolean' },
|
|
23
|
-
|
|
24
|
-
{ key: 'date', group: 'date' },
|
|
25
|
-
{ key: 'dropdown', group: 'enum' },
|
|
26
|
-
{ key: 'document', group: 'file' },
|
|
27
|
-
|
|
28
|
-
{ key: 'text', group: 'text' },
|
|
29
|
-
{ key: 'text-field', group: 'text' },
|
|
30
|
-
{ key: 'email', group: 'text' },
|
|
31
|
-
{ key: 'link', group: 'text' },
|
|
32
|
-
|
|
33
|
-
{ key: 'integer', group: 'number' },
|
|
34
|
-
{ key: 'float', group: 'number' },
|
|
35
|
-
|
|
36
|
-
{ key: 'uuid', group: 'uuid' }
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
export function convertToTitleCase(str: string) {
|
|
40
|
-
return str
|
|
41
|
-
.split('_')
|
|
42
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
43
|
-
.join(' ')
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function getColumnTypesOptions() {
|
|
47
|
-
return columnsTypes.map((column) => ({
|
|
48
|
-
label: convertToTitleCase(column.key),
|
|
49
|
-
value: column.key?.toLowerCase(),
|
|
50
|
-
}))
|
|
51
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { Column } from '@antcde/connect-ts/services/ColumnService'
|
|
2
|
-
import FileHandler from '../services/file-handler'
|
|
3
|
-
|
|
4
|
-
export const ANT_DELIMITER = `$%ANT%$`
|
|
5
|
-
|
|
6
|
-
export function validateEmail(value: any) {
|
|
7
|
-
const pattern = /^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/
|
|
8
|
-
return pattern.test(value)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export async function parseRecordBody(columns: Column[], data: any) {
|
|
12
|
-
const body: any = {
|
|
13
|
-
record: {},
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (data.session) {
|
|
17
|
-
body.session = {
|
|
18
|
-
id: data.session,
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
for (const column of columns) {
|
|
23
|
-
if (column.type === 'document') {
|
|
24
|
-
if (data[column.name] instanceof File) {
|
|
25
|
-
body.record[column.name] = await FileHandler.handleFile(data[column.name])
|
|
26
|
-
}
|
|
27
|
-
continue
|
|
28
|
-
}
|
|
29
|
-
if (column.type === 'uuid' && data[column.name]) {
|
|
30
|
-
body.record[column.name] = data[column.name]?.id ?? data[column.name];
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
body.record[column.name] = parseData(column.type, data[column.name])
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return body
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function parseData(type: string, value: any) {
|
|
41
|
-
if (!value)
|
|
42
|
-
return null
|
|
43
|
-
switch (type) {
|
|
44
|
-
case 'integer':
|
|
45
|
-
return Number.parseInt(value)
|
|
46
|
-
case 'float':
|
|
47
|
-
return Number.parseFloat(value)
|
|
48
|
-
case 'boolean':
|
|
49
|
-
return !!value
|
|
50
|
-
case 'sbscode':
|
|
51
|
-
return value?.code ?? value ?? null
|
|
52
|
-
default:
|
|
53
|
-
return value
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Helper function to convert file to a Base64 string
|
|
58
|
-
export async function convertFileToBase64(file: File): Promise<string> {
|
|
59
|
-
return new Promise((resolve, reject) => {
|
|
60
|
-
const reader = new FileReader()
|
|
61
|
-
reader.onload = () => {
|
|
62
|
-
const result = reader.result?.toString() ?? ''
|
|
63
|
-
// Split at ";base64," to ensure we only get the actual base64 data
|
|
64
|
-
const base64String = result.split(';base64,')[1]
|
|
65
|
-
resolve(base64String || '') // Resolve empty string if splitting fails
|
|
66
|
-
}
|
|
67
|
-
reader.onerror = error => reject(error)
|
|
68
|
-
reader.readAsDataURL(file) // Read file as Base64
|
|
69
|
-
})
|
|
70
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Base64Container } from '@antcde/connect-ts/services/RecordService'
|
|
2
|
-
|
|
3
|
-
import FileHandler from '../services/file-handler'
|
|
4
|
-
|
|
5
|
-
export async function useDownloadDocument(doc: Base64Container) {
|
|
6
|
-
const byteArray = await FileHandler.b64toUint8Array(doc.file)
|
|
7
|
-
await FileHandler.downloadFile(byteArray, doc.name, doc.extension)
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function useFormatFilename(filename?: string, ext?: string, maxLength: number = 10) {
|
|
11
|
-
if (!filename || !ext)
|
|
12
|
-
return ''
|
|
13
|
-
if (filename.length > maxLength) {
|
|
14
|
-
const name = filename.slice(0, maxLength - 3)
|
|
15
|
-
return `${name}...${ext}`
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return `${filename}.${ext}`
|
|
19
|
-
}
|
|
20
|
-
}
|