adminforth 1.0.83 → 1.0.86
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/dist/index.js +34 -16
- package/dist/modules/codeInjector.js +19 -10
- package/dist/plugins/ForeignInlineListPlugin/index.js +3 -2
- package/dist/servers/express.js +0 -3
- package/dist/spa/spa/package-lock.json +13 -0
- package/dist/spa/spa/package.json +1 -0
- package/dist/spa/spa/src/App.vue +44 -19
- package/dist/spa/spa/src/components/AcceptModal.vue +2 -9
- package/dist/spa/spa/src/components/Toast.vue +65 -0
- package/dist/spa/spa/src/components/ValueRenderer.vue +8 -8
- package/dist/spa/spa/src/composables/useStores.ts +51 -0
- package/dist/spa/spa/src/stores/core.ts +5 -1
- package/dist/spa/spa/src/stores/modal.ts +13 -2
- package/dist/spa/spa/src/stores/toast.ts +15 -0
- package/dist/spa/spa/src/views/CreateView.vue +25 -2
- package/dist/spa/spa/src/views/EditView.vue +28 -3
- package/dist/spa/spa/src/views/ListView.vue +28 -5
- package/dist/spa/spa/src/views/ShowView.vue +33 -7
- package/dist/types/AdminForthConfig.js +54 -0
- package/dist/types/FrontendAPI.js +7 -0
- package/documentation/docs/Getting Started.md +374 -0
- package/documentation/docs/Glossary.md +37 -0
- package/documentation/docs/image.png +0 -0
- package/documentation/docusaurus.config.ts +4 -4
- package/documentation/static/CNAME +1 -0
- package/index.ts +50 -35
- package/modules/codeInjector.ts +15 -6
- package/package.json +1 -1
- package/plugins/ForeignInlineListPlugin/index.ts +3 -3
- package/servers/express.ts +4 -9
- package/spa/package-lock.json +13 -0
- package/spa/package.json +1 -0
- package/spa/src/App.vue +44 -19
- package/spa/src/components/AcceptModal.vue +2 -9
- package/spa/src/components/Toast.vue +65 -0
- package/spa/src/components/ValueRenderer.vue +8 -8
- package/spa/src/composables/useStores.ts +51 -0
- package/spa/src/stores/core.ts +5 -1
- package/spa/src/stores/modal.ts +13 -2
- package/spa/src/stores/toast.ts +15 -0
- package/spa/src/views/CreateView.vue +25 -2
- package/spa/src/views/EditView.vue +28 -3
- package/spa/src/views/ListView.vue +28 -5
- package/spa/src/views/ShowView.vue +33 -7
- package/types/AdminForthConfig.ts +469 -42
- package/types/FrontendAPI.ts +73 -0
- package/documentation/static/img/docusaurus-social-card.jpg +0 -0
- package/documentation/static/img/tail.png:Zone.Identifier +0 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="relative">
|
|
3
|
+
<component
|
|
4
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.beforeBreadcrumbs || []"
|
|
5
|
+
:is="getCustomComponent(c)"
|
|
6
|
+
:record="coreStore.record"
|
|
7
|
+
:resource="coreStore.resource"
|
|
8
|
+
:adminUser="coreStore.adminUser"
|
|
9
|
+
/>
|
|
3
10
|
<BreadcrumbsWithButtons>
|
|
4
11
|
<RouterLink v-if="coreStore?.resourceOptions?.allowedActions?.edit" :to="{ name: 'resource-edit', params: { resourceId: $route.params.resourceId, primaryKey: $route.params.primaryKey } }"
|
|
5
12
|
class="flex items-center py-1 px-3 me-2 mb-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"
|
|
@@ -16,6 +23,14 @@
|
|
|
16
23
|
</button>
|
|
17
24
|
</BreadcrumbsWithButtons>
|
|
18
25
|
|
|
26
|
+
<component
|
|
27
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.afterBreadcrumbs || []"
|
|
28
|
+
:is="getCustomComponent(c)"
|
|
29
|
+
:record="coreStore.record"
|
|
30
|
+
:resource="coreStore.resource"
|
|
31
|
+
:adminUser="coreStore.adminUser"
|
|
32
|
+
/>
|
|
33
|
+
|
|
19
34
|
<div v-if="loading" role="status" class="max-w-sm animate-pulse">
|
|
20
35
|
<div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-48 mb-4"></div>
|
|
21
36
|
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[360px] mb-2.5"></div>
|
|
@@ -48,7 +63,8 @@
|
|
|
48
63
|
v-if="showRowComponentsPerColumn[column.name]"
|
|
49
64
|
:is="showRowComponentsPerColumn[column.name]"
|
|
50
65
|
:column="column"
|
|
51
|
-
:
|
|
66
|
+
:resource="coreStore.resource"
|
|
67
|
+
:record="coreStore.record"
|
|
52
68
|
/>
|
|
53
69
|
<template v-else>
|
|
54
70
|
<td class="px-6 py-4 whitespace-nowrap">
|
|
@@ -58,18 +74,28 @@
|
|
|
58
74
|
<component
|
|
59
75
|
v-if="showComponentsPerColumn[column.name]"
|
|
60
76
|
:is="showComponentsPerColumn[column.name]"
|
|
77
|
+
:resource="coreStore.resource"
|
|
61
78
|
:column="column"
|
|
62
|
-
:
|
|
79
|
+
:record="coreStore.record"
|
|
63
80
|
/>
|
|
64
81
|
<ValueRenderer v-else
|
|
65
82
|
:column="column"
|
|
66
|
-
:
|
|
83
|
+
:record="coreStore.record"
|
|
67
84
|
/>
|
|
68
85
|
</td>
|
|
69
86
|
</template>
|
|
70
87
|
</tr>
|
|
71
88
|
</tbody>
|
|
72
89
|
</table>
|
|
90
|
+
|
|
91
|
+
<component
|
|
92
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.bottom || []"
|
|
93
|
+
:is="getCustomComponent(c)"
|
|
94
|
+
:column="column"
|
|
95
|
+
:record="coreStore.record"
|
|
96
|
+
:resource="coreStore.resource"
|
|
97
|
+
:adminUser="coreStore.adminUser"
|
|
98
|
+
/>
|
|
73
99
|
</div>
|
|
74
100
|
|
|
75
101
|
|
|
@@ -116,14 +142,14 @@ onMounted(async () => {
|
|
|
116
142
|
checkAcessByAllowedActions(coreStore.resourceOptions.allowedActions,'show');
|
|
117
143
|
|
|
118
144
|
showComponentsPerColumn = coreStore.resourceColumns.reduce((acc, column) => {
|
|
119
|
-
if (column.
|
|
120
|
-
acc[column.name] = getCustomComponent(column.
|
|
145
|
+
if (column.components?.show) {
|
|
146
|
+
acc[column.name] = getCustomComponent(column.components.show);
|
|
121
147
|
}
|
|
122
148
|
return acc;
|
|
123
149
|
}, {});
|
|
124
150
|
showRowComponentsPerColumn = coreStore.resourceColumns.reduce((acc, column) => {
|
|
125
|
-
if (column.
|
|
126
|
-
acc[column.name] = getCustomComponent(column.
|
|
151
|
+
if (column.components?.showRow) {
|
|
152
|
+
acc[column.name] = getCustomComponent(column.components.showRow);
|
|
127
153
|
}
|
|
128
154
|
return acc;
|
|
129
155
|
}, {});
|