adminforth 2.26.1 → 2.27.0-next.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/commands/createApp/templates/package.json.hbs +1 -1
- package/dist/modules/restApi.d.ts +1 -0
- package/dist/modules/restApi.d.ts.map +1 -1
- package/dist/modules/restApi.js +25 -1
- package/dist/modules/restApi.js.map +1 -1
- package/dist/modules/styles.js +2 -2
- package/dist/modules/styles.js.map +1 -1
- package/dist/servers/express.d.ts.map +1 -1
- package/dist/servers/express.js +7 -1
- package/dist/servers/express.js.map +1 -1
- package/dist/spa/package-lock.json +44 -7
- package/dist/spa/package.json +1 -1
- package/dist/spa/pnpm-lock.yaml +301 -299
- package/dist/spa/src/App.vue +1 -1
- package/dist/spa/src/adminforth.ts +17 -29
- package/dist/spa/src/afcl/Input.vue +1 -1
- package/dist/spa/src/afcl/Modal.vue +12 -1
- package/dist/spa/src/afcl/Select.vue +4 -2
- package/dist/spa/src/afcl/Table.vue +27 -13
- package/dist/spa/src/components/AcceptModal.vue +2 -0
- package/dist/spa/src/components/ColumnValueInputWrapper.vue +11 -3
- package/dist/spa/src/components/CustomRangePicker.vue +16 -67
- package/dist/spa/src/components/ListActionsThreeDots.vue +9 -8
- package/dist/spa/src/components/RangePicker.vue +236 -0
- package/dist/spa/src/components/ResourceListTable.vue +24 -27
- package/dist/spa/src/components/Sidebar.vue +1 -1
- package/dist/spa/src/components/ThreeDotsMenu.vue +9 -8
- package/dist/spa/src/i18n.ts +1 -1
- package/dist/spa/src/stores/core.ts +4 -2
- package/dist/spa/src/types/Back.ts +7 -3
- package/dist/spa/src/types/Common.ts +25 -5
- package/dist/spa/src/types/FrontendAPI.ts +6 -1
- package/dist/spa/src/utils/listUtils.ts +8 -2
- package/dist/spa/src/utils/utils.ts +29 -10
- package/dist/spa/src/views/CreateView.vue +10 -10
- package/dist/spa/src/views/EditView.vue +10 -9
- package/dist/spa/src/views/ListView.vue +58 -16
- package/dist/spa/src/views/LoginView.vue +13 -13
- package/dist/spa/src/views/ShowView.vue +16 -16
- package/dist/spa/tsconfig.app.json +1 -1
- package/dist/types/Back.d.ts +4 -4
- package/dist/types/Back.d.ts.map +1 -1
- package/dist/types/Back.js.map +1 -1
- package/dist/types/Common.d.ts +20 -5
- package/dist/types/Common.d.ts.map +1 -1
- package/dist/types/Common.js.map +1 -1
- package/dist/types/FrontendAPI.d.ts +13 -1
- package/dist/types/FrontendAPI.d.ts.map +1 -1
- package/dist/types/FrontendAPI.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nextTick, onMounted, ref, resolveComponent } from 'vue';
|
|
2
2
|
import type { CoreConfig } from '../spa_types/core';
|
|
3
|
-
import type { ValidationObject } from '../types/Common.js';
|
|
3
|
+
import type { AdminForthComponentDeclaration, AdminForthComponentDeclarationFull, ValidationObject } from '../types/Common.js';
|
|
4
4
|
import router from "../router";
|
|
5
5
|
import { useCoreStore } from '../stores/core';
|
|
6
6
|
import { useUserStore } from '../stores/user';
|
|
@@ -19,11 +19,12 @@ const LS_LANG_KEY = `afLanguage`;
|
|
|
19
19
|
const MAX_CONSECUTIVE_EMPTY_RESULTS = 2;
|
|
20
20
|
const ITEMS_PER_PAGE_LIMIT = 100;
|
|
21
21
|
|
|
22
|
-
export async function callApi({path, method, body, headers, silentError = false}: {
|
|
22
|
+
export async function callApi({path, method, body, headers, silentError = false, abortSignal}: {
|
|
23
23
|
path: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
|
|
24
24
|
body?: any
|
|
25
25
|
headers?: Record<string, string>
|
|
26
26
|
silentError?: boolean
|
|
27
|
+
abortSignal?: AbortSignal
|
|
27
28
|
}): Promise<any> {
|
|
28
29
|
const t = i18nInstance?.global.t || ((s: string) => s)
|
|
29
30
|
const options = {
|
|
@@ -34,6 +35,7 @@ export async function callApi({path, method, body, headers, silentError = false}
|
|
|
34
35
|
...headers
|
|
35
36
|
},
|
|
36
37
|
body: JSON.stringify(body),
|
|
38
|
+
signal: abortSignal
|
|
37
39
|
};
|
|
38
40
|
const fullPath = `${import.meta.env.VITE_ADMINFORTH_PUBLIC_PATH || ''}${path}`;
|
|
39
41
|
try {
|
|
@@ -68,28 +70,45 @@ export async function callApi({path, method, body, headers, silentError = false}
|
|
|
68
70
|
return null;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
if (!silentError) {
|
|
73
|
+
if (!silentError && !(e instanceof DOMException && e.name === 'AbortError')) {
|
|
72
74
|
adminforth.alert({variant:'danger', message: t('Something went wrong, please try again later'),})
|
|
73
75
|
}
|
|
74
76
|
console.error(`error in callApi ${path}`, e);
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
export async function callAdminForthApi(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
export async function callAdminForthApi(
|
|
81
|
+
{
|
|
82
|
+
path,
|
|
83
|
+
method,
|
|
84
|
+
body=undefined,
|
|
85
|
+
headers=undefined,
|
|
86
|
+
silentError = false,
|
|
87
|
+
abortSignal = undefined
|
|
88
|
+
}: {
|
|
89
|
+
path: string,
|
|
90
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH',
|
|
91
|
+
body?: any,
|
|
92
|
+
headers?: Record<string, string>,
|
|
93
|
+
silentError?: boolean,
|
|
94
|
+
abortSignal?: AbortSignal
|
|
84
95
|
}): Promise<any> {
|
|
85
96
|
try {
|
|
86
|
-
return callApi({path: `/adminapi/v1${path}`, method, body, headers, silentError} );
|
|
97
|
+
return callApi({path: `/adminapi/v1${path}`, method, body, headers, silentError, abortSignal} );
|
|
87
98
|
} catch (e) {
|
|
88
99
|
console.error('error', e);
|
|
89
100
|
return { error: `Unexpected error: ${e}` };
|
|
90
101
|
}
|
|
91
102
|
}
|
|
92
103
|
|
|
104
|
+
export function formatComponent(component: AdminForthComponentDeclaration): AdminForthComponentDeclarationFull {
|
|
105
|
+
if (typeof component === 'string') {
|
|
106
|
+
return { file: component, meta: {} };
|
|
107
|
+
} else {
|
|
108
|
+
return { file: component.file, meta: component.meta };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
93
112
|
export function getCustomComponent({ file, meta }: { file: string, meta?: any }) {
|
|
94
113
|
const name = file.replace(/@/g, '').replace(/\./g, '').replace(/\//g, '');
|
|
95
114
|
return resolveComponent(name);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div class="relative w-full">
|
|
3
3
|
|
|
4
4
|
<component
|
|
5
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.create?.beforeBreadcrumbs || []"
|
|
6
|
-
:is="getCustomComponent(c)"
|
|
5
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.create?.beforeBreadcrumbs as AdminForthComponentDeclaration[] || []"
|
|
6
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
7
7
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
8
8
|
:record="coreStore.record"
|
|
9
9
|
:resource="coreStore.resource"
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
<BreadcrumbsWithButtons>
|
|
14
14
|
<!-- save and cancle -->
|
|
15
15
|
<button @click="() => {cancelButtonClicked = true; $router.back()}"
|
|
16
|
-
class="af-cancel-button flex items-center py-1 px-3 me-2 text-sm font-medium rounded-default text-lightCreateViewButtonText focus:outline-none bg-lightCreateViewButtonBackground rounded border border-lightCreateViewButtonBorder hover:bg-lightCreateViewButtonBackgroundHover hover:text-lightCreateViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightCreateViewButtonFocusRing dark:focus:ring-darkCreateViewButtonFocusRing dark:bg-darkCreateViewButtonBackground dark:text-darkCreateViewButtonText dark:border-darkCreateViewButtonBorder dark:hover:text-darkCreateViewButtonTextHover dark:hover:bg-darkCreateViewButtonBackgroundHover"
|
|
16
|
+
class="af-cancel-button h-[34px] af-button-shadow flex items-center py-1 px-3 me-2 text-sm font-medium rounded-default text-lightCreateViewButtonText focus:outline-none bg-lightCreateViewButtonBackground rounded border border-lightCreateViewButtonBorder hover:bg-lightCreateViewButtonBackgroundHover hover:text-lightCreateViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightCreateViewButtonFocusRing dark:focus:ring-darkCreateViewButtonFocusRing dark:bg-darkCreateViewButtonBackground dark:text-darkCreateViewButtonText dark:border-darkCreateViewButtonBorder dark:hover:text-darkCreateViewButtonTextHover dark:hover:bg-darkCreateViewButtonBackgroundHover"
|
|
17
17
|
>
|
|
18
18
|
{{ $t('Cancel') }}
|
|
19
19
|
</button>
|
|
20
20
|
<button
|
|
21
21
|
@click="() => saveRecord()"
|
|
22
|
-
class="af-save-button flex items-center py-1 px-3 text-sm font-medium rounded-default text-lightCreateViewSaveButtonText focus:outline-none bg-lightCreateViewButtonBackground rounded border border-lightCreateViewButtonBorder hover:bg-lightCreateViewButtonBackgroundHover hover:text-lightCreateViewSaveButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightCreateViewButtonFocusRing dark:focus:ring-darkCreateViewButtonFocusRing dark:bg-darkCreateViewButtonBackground dark:text-darkCreateViewSaveButtonText dark:border-darkCreateViewButtonBorder dark:hover:text-darkCreateViewSaveButtonTextHover dark:hover:bg-darkCreateViewButtonBackgroundHover disabled:opacity-50 gap-1"
|
|
22
|
+
class="af-save-button h-[34px] af-button-shadow flex items-center py-1 px-3 text-sm font-medium rounded-default text-lightCreateViewSaveButtonText focus:outline-none bg-lightCreateViewButtonBackground rounded border border-lightCreateViewButtonBorder hover:bg-lightCreateViewButtonBackgroundHover hover:text-lightCreateViewSaveButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightCreateViewButtonFocusRing dark:focus:ring-darkCreateViewButtonFocusRing dark:bg-darkCreateViewButtonBackground dark:text-darkCreateViewSaveButtonText dark:border-darkCreateViewButtonBorder dark:hover:text-darkCreateViewSaveButtonTextHover dark:hover:bg-darkCreateViewButtonBackgroundHover disabled:opacity-50 gap-1"
|
|
23
23
|
:disabled="saving || (validating && !isValid)"
|
|
24
24
|
>
|
|
25
25
|
<svg v-if="saving"
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
</BreadcrumbsWithButtons>
|
|
37
37
|
|
|
38
38
|
<component
|
|
39
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.create?.afterBreadcrumbs || []"
|
|
40
|
-
:is="getCustomComponent(c)"
|
|
39
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.create?.afterBreadcrumbs as AdminForthComponentDeclaration[] || []"
|
|
40
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
41
41
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
42
42
|
:record="coreStore.record"
|
|
43
43
|
:resource="coreStore.resource"
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
</ResourceForm>
|
|
62
62
|
|
|
63
63
|
<component
|
|
64
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.create?.bottom || []"
|
|
65
|
-
:is="getCustomComponent(c)"
|
|
64
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.create?.bottom as AdminForthComponentDeclaration[] || []"
|
|
65
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
66
66
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
67
67
|
:record="coreStore.record"
|
|
68
68
|
:resource="coreStore.resource"
|
|
@@ -79,7 +79,7 @@ import BreadcrumbsWithButtons from '@/components/BreadcrumbsWithButtons.vue';
|
|
|
79
79
|
import ResourceForm from '@/components/ResourceForm.vue';
|
|
80
80
|
import SingleSkeletLoader from '@/components/SingleSkeletLoader.vue';
|
|
81
81
|
import { useCoreStore } from '@/stores/core';
|
|
82
|
-
import { callAdminForthApi, getCustomComponent,checkAcessByAllowedActions, initThreeDotsDropdown, checkShowIf, compareOldAndNewRecord, onBeforeRouteLeaveCreateEditViewGuard, leaveGuardActiveClass,
|
|
82
|
+
import { callAdminForthApi, getCustomComponent,checkAcessByAllowedActions, initThreeDotsDropdown, checkShowIf, compareOldAndNewRecord, onBeforeRouteLeaveCreateEditViewGuard, leaveGuardActiveClass, formatComponent } from '@/utils';
|
|
83
83
|
import { IconFloppyDiskSolid } from '@iconify-prerendered/vue-flowbite';
|
|
84
84
|
import { onMounted, onBeforeMount, onBeforeUnmount, ref, watch, nextTick } from 'vue';
|
|
85
85
|
import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router';
|
|
@@ -88,7 +88,7 @@ import { showErrorTost } from '@/composables/useFrontendApi';
|
|
|
88
88
|
import ThreeDotsMenu from '@/components/ThreeDotsMenu.vue';
|
|
89
89
|
import { useAdminforth } from '@/adminforth';
|
|
90
90
|
import { useI18n } from 'vue-i18n';
|
|
91
|
-
import { type AdminForthComponentDeclarationFull } from '@/types/Common.js';
|
|
91
|
+
import { type AdminForthComponentDeclaration, type AdminForthComponentDeclarationFull } from '@/types/Common.js';
|
|
92
92
|
import type { AdminForthResourceColumn } from '@/types/Back';
|
|
93
93
|
|
|
94
94
|
const isValid = ref(false);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="relative w-full">
|
|
3
3
|
<component
|
|
4
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.beforeBreadcrumbs || []"
|
|
5
|
-
:is="getCustomComponent(c)"
|
|
4
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.beforeBreadcrumbs as AdminForthComponentDeclaration[] || []"
|
|
5
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
6
6
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
7
7
|
:record="editableRecord"
|
|
8
8
|
:resource="coreStore.resource"
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
<BreadcrumbsWithButtons>
|
|
13
13
|
<!-- save and cancle -->
|
|
14
14
|
<button @click="() => {cancelButtonClicked = true; $router.back()}"
|
|
15
|
-
class="flex items-center py-1 px-3 me-2 text-sm font-medium text-lightEditViewButtonText rounded-default focus:outline-none bg-lightEditViewButtonBackground rounded border border-lightEditViewButtonBorder hover:bg-lightEditViewButtonBackgroundHover hover:text-lightEditViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightEditViewButtonFocusRing dark:focus:ring-darkEditViewButtonFocusRing dark:bg-darkEditViewButtonBackground dark:text-darkEditViewButtonText dark:border-darkEditViewButtonBorder dark:hover:text-darkEditViewButtonTextHover dark:hover:bg-darkEditViewButtonBackgroundHover"
|
|
15
|
+
class="flex items-center h-[34px] af-button-shadow py-1 px-3 me-2 text-sm font-medium text-lightEditViewButtonText rounded-default focus:outline-none bg-lightEditViewButtonBackground rounded border border-lightEditViewButtonBorder hover:bg-lightEditViewButtonBackgroundHover hover:text-lightEditViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightEditViewButtonFocusRing dark:focus:ring-darkEditViewButtonFocusRing dark:bg-darkEditViewButtonBackground dark:text-darkEditViewButtonText dark:border-darkEditViewButtonBorder dark:hover:text-darkEditViewButtonTextHover dark:hover:bg-darkEditViewButtonBackgroundHover"
|
|
16
16
|
>
|
|
17
17
|
{{ $t('Cancel') }}
|
|
18
18
|
</button>
|
|
19
19
|
<button
|
|
20
20
|
@click="() => saveRecord()"
|
|
21
|
-
class="flex items-center py-1 px-3 text-sm font-medium rounded-default text-lightEditViewSaveButtonText focus:outline-none bg-lightEditViewButtonBackground rounded border border-lightEditViewButtonBorder hover:bg-lightEditViewButtonBackgroundHover hover:text-lightEditViewSaveButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightEditViewButtonFocusRing dark:focus:ring-darkEditViewButtonFocusRing dark:bg-darkEditViewButtonBackground dark:text-darkEditViewSaveButtonText dark:border-darkEditViewButtonBorder dark:hover:text-darkEditViewSaveButtonTextHover dark:hover:bg-darkEditViewButtonBackgroundHover disabled:opacity-50 gap-1"
|
|
21
|
+
class="flex items-center h-[34px] af-button-shadow py-1 px-3 text-sm font-medium rounded-default text-lightEditViewSaveButtonText focus:outline-none bg-lightEditViewButtonBackground rounded border border-lightEditViewButtonBorder hover:bg-lightEditViewButtonBackgroundHover hover:text-lightEditViewSaveButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightEditViewButtonFocusRing dark:focus:ring-darkEditViewButtonFocusRing dark:bg-darkEditViewButtonBackground dark:text-darkEditViewSaveButtonText dark:border-darkEditViewButtonBorder dark:hover:text-darkEditViewSaveButtonTextHover dark:hover:bg-darkEditViewButtonBackgroundHover disabled:opacity-50 gap-1"
|
|
22
22
|
:disabled="saving || (validating && !isValid)"
|
|
23
23
|
>
|
|
24
24
|
<IconFloppyDiskSolid class="w-4 h-4" />
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
</BreadcrumbsWithButtons>
|
|
33
33
|
|
|
34
34
|
<component
|
|
35
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.afterBreadcrumbs || []"
|
|
36
|
-
:is="getCustomComponent(c)"
|
|
35
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.afterBreadcrumbs as AdminForthComponentDeclaration[] || []"
|
|
36
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
37
37
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
38
38
|
:record="coreStore.record"
|
|
39
39
|
:resource="coreStore.resource"
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
</ResourceForm>
|
|
57
57
|
|
|
58
58
|
<component
|
|
59
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.bottom || []"
|
|
60
|
-
:is="getCustomComponent(c)"
|
|
59
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.edit?.bottom as AdminForthComponentDeclaration[] || []"
|
|
60
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
61
61
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
62
62
|
:record="coreStore.record"
|
|
63
63
|
:resource="coreStore.resource"
|
|
@@ -82,7 +82,8 @@ import { showErrorTost } from '@/composables/useFrontendApi';
|
|
|
82
82
|
import ThreeDotsMenu from '@/components/ThreeDotsMenu.vue';
|
|
83
83
|
import { useAdminforth } from '@/adminforth';
|
|
84
84
|
import { useI18n } from 'vue-i18n';
|
|
85
|
-
import {
|
|
85
|
+
import { formatComponent } from '@/utils';
|
|
86
|
+
import { type AdminForthComponentDeclaration, type AdminForthComponentDeclarationFull } from '@/types/Common.js';
|
|
86
87
|
import type { AdminForthResourceColumn } from '@/types/Back';
|
|
87
88
|
|
|
88
89
|
const { t } = useI18n();
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
<component
|
|
13
13
|
v-if="!coreStore.isResourceFetching && !initInProcess"
|
|
14
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.beforeBreadcrumbs || []"
|
|
15
|
-
:is="getCustomComponent(c)"
|
|
14
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.beforeBreadcrumbs as AdminForthComponentDeclaration[] || []"
|
|
15
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
16
16
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
17
17
|
:resource="coreStore.resource"
|
|
18
18
|
:adminUser="coreStore.adminUser"
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
<BreadcrumbsWithButtons>
|
|
22
22
|
<component
|
|
23
23
|
v-if="!coreStore.isResourceFetching && !initInProcess"
|
|
24
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.beforeActionButtons || []"
|
|
25
|
-
:is="getCustomComponent(c)"
|
|
24
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.beforeActionButtons as AdminForthComponentDeclaration[] || []"
|
|
25
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
26
26
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
27
27
|
:resource="coreStore.resource"
|
|
28
28
|
:adminUser="coreStore.adminUser"
|
|
@@ -33,7 +33,12 @@
|
|
|
33
33
|
@click="()=>{checkboxes = []}"
|
|
34
34
|
v-if="checkboxes.length"
|
|
35
35
|
data-tooltip-target="tooltip-remove-all"
|
|
36
|
-
class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-lightListViewButtonText
|
|
36
|
+
class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-lightListViewButtonText af-button-shadow
|
|
37
|
+
focus:outline-none bg-lightListViewButtonBackground rounded border border-lightListViewButtonBorder h-[34px]
|
|
38
|
+
hover:bg-lightListViewButtonBackgroundHover hover:text-lightListViewButtonTextHover focus:z-10 focus:ring-4
|
|
39
|
+
focus:ring-lightListViewButtonFocusRing dark:focus:ring-darkListViewButtonFocusRing
|
|
40
|
+
dark:bg-darkListViewButtonBackground dark:text-darkListViewButtonText dark:border-darkListViewButtonBorder
|
|
41
|
+
dark:hover:text-darkListViewButtonTextHover dark:hover:bg-darkListViewButtonBackgroundHover rounded-default"
|
|
37
42
|
>
|
|
38
43
|
<Tooltip>
|
|
39
44
|
<IconBanOutline class="w-5 h-5 "/>
|
|
@@ -51,7 +56,13 @@
|
|
|
51
56
|
v-if="!action.showInThreeDotsDropdown"
|
|
52
57
|
:key="action.id"
|
|
53
58
|
@click="startBulkActionInner(action.id!)"
|
|
54
|
-
class="flex gap-1 items-center py-1 px-3 text-sm font-medium text-lightListViewButtonText
|
|
59
|
+
class="flex gap-1 items-center py-1 px-3 text-sm font-medium text-lightListViewButtonText
|
|
60
|
+
focus:outline-none bg-lightListViewButtonBackground rounded-default border h-[34px]
|
|
61
|
+
border-lightListViewButtonBorder hover:bg-lightListViewButtonBackgroundHover
|
|
62
|
+
hover:text-lightListViewButtonTextHover focus:z-10 focus:ring-4 af-button-shadow
|
|
63
|
+
focus:ring-lightListViewButtonFocusRing dark:focus:ring-darkListViewButtonFocusRing
|
|
64
|
+
dark:bg-darkListViewButtonBackground dark:text-darkListViewButtonText dark:border-darkListViewButtonBorder
|
|
65
|
+
dark:hover:text-darkListViewButtonTextHover dark:hover:bg-darkListViewButtonBackgroundHover"
|
|
55
66
|
:class="action.buttonCustomCssClass || ''"
|
|
56
67
|
>
|
|
57
68
|
<component
|
|
@@ -72,7 +83,9 @@
|
|
|
72
83
|
<span class="sr-only">Loading...</span>
|
|
73
84
|
</div>
|
|
74
85
|
{{ `${action.label} (${checkboxes.length})` }}
|
|
75
|
-
<div v-if="action.badge" class="text-white bg-gradient-to-r from-purple-500
|
|
86
|
+
<div v-if="action.badge" class="text-white bg-gradient-to-r from-purple-500
|
|
87
|
+
via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none
|
|
88
|
+
focus:ring-purple-300 dark:focus:ring-purple-800
|
|
76
89
|
font-medium rounded-sm text-xs px-1 ml-1 text-center ">
|
|
77
90
|
{{ action.badge }}
|
|
78
91
|
</div>
|
|
@@ -81,14 +94,24 @@
|
|
|
81
94
|
|
|
82
95
|
<RouterLink v-if="coreStore.resource?.options?.allowedActions?.create"
|
|
83
96
|
:to="{ name: 'resource-create', params: { resourceId: $route.params.resourceId } }"
|
|
84
|
-
class="af-create-button flex items-center py-1 px-3 text-sm
|
|
97
|
+
class="af-create-button flex items-center py-1 h-[34px] px-3 text-sm af-button-shadow
|
|
98
|
+
font-medium text-lightPrimaryContrast transition-all focus:outline-none
|
|
99
|
+
bg-lightPrimary hover:bg-lightPrimary/80 dark:bg-darkPrimary dark:hover:bg-darkPrimary/80
|
|
100
|
+
rounded border border-lightPrimary/90 focus:z-10 focus:ring-4 focus:ring-lightListViewButtonFocusRing
|
|
101
|
+
dark:focus:ring-darkListViewButtonFocusRing dark:text-darkPrimaryContrast dark:border-darkPrimary/80
|
|
102
|
+
dark:hover:text-darkListViewButtonTextHover dark:hover:bg-darkListViewButtonBackgroundHover rounded-default gap-1"
|
|
85
103
|
>
|
|
86
104
|
<IconPlusOutline class="w-4 h-4"/>
|
|
87
105
|
{{ $t('Create') }}
|
|
88
106
|
</RouterLink>
|
|
89
107
|
|
|
90
108
|
<button
|
|
91
|
-
class="af-filter-button flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium
|
|
109
|
+
class="af-filter-button flex gap-1 items-center py-1 h-[34px] px-3 me-2 af-button-shadow text-sm font-medium
|
|
110
|
+
text-lightListViewButtonText transition-all focus:outline-none bg-lightListViewButtonBackground rounded border
|
|
111
|
+
border-lightListViewButtonBorder hover:bg-lightListViewButtonBackgroundHover hover:text-lightListViewButtonTextHover
|
|
112
|
+
focus:z-10 focus:ring-4 focus:ring-lightListViewButtonFocusRing dark:focus:ring-darkListViewButtonFocusRing
|
|
113
|
+
dark:bg-darkListViewButtonBackground dark:text-darkListViewButtonText dark:border-darkListViewButtonBorder
|
|
114
|
+
dark:hover:text-darkListViewButtonTextHover dark:hover:bg-darkListViewButtonBackgroundHover rounded-default"
|
|
92
115
|
@click="()=>{filtersShow = !filtersShow}"
|
|
93
116
|
v-if="coreStore.resource?.options?.allowedActions?.filter"
|
|
94
117
|
>
|
|
@@ -114,8 +137,8 @@
|
|
|
114
137
|
|
|
115
138
|
<component
|
|
116
139
|
v-if="!coreStore.isResourceFetching && !initInProcess"
|
|
117
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.afterBreadcrumbs || []"
|
|
118
|
-
:is="getCustomComponent(c)"
|
|
140
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.afterBreadcrumbs as AdminForthComponentDeclaration[] || []"
|
|
141
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
119
142
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
120
143
|
:resource="coreStore.resource"
|
|
121
144
|
:adminUser="coreStore.adminUser"
|
|
@@ -161,8 +184,8 @@
|
|
|
161
184
|
/>
|
|
162
185
|
|
|
163
186
|
<component
|
|
164
|
-
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.bottom || []"
|
|
165
|
-
:is="getCustomComponent(c)"
|
|
187
|
+
v-for="c in coreStore?.resourceOptions?.pageInjections?.list?.bottom as AdminForthComponentDeclaration[] || []"
|
|
188
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
166
189
|
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
167
190
|
:resource="coreStore.resource"
|
|
168
191
|
:adminUser="coreStore.adminUser"
|
|
@@ -176,13 +199,13 @@ import BreadcrumbsWithButtons from '@/components/BreadcrumbsWithButtons.vue';
|
|
|
176
199
|
import ResourceListTable from '@/components/ResourceListTable.vue';
|
|
177
200
|
import { useCoreStore } from '@/stores/core';
|
|
178
201
|
import { useFiltersStore } from '@/stores/filters';
|
|
179
|
-
import { callAdminForthApi, currentQuery, getIcon, setQuery } from '@/utils';
|
|
202
|
+
import { callAdminForthApi, currentQuery, getIcon, setQuery, formatComponent } from '@/utils';
|
|
180
203
|
import { computed, onMounted, onUnmounted, ref, watch, type Ref } from 'vue';
|
|
181
204
|
import { useRoute } from 'vue-router';
|
|
182
205
|
import { getCustomComponent, initThreeDotsDropdown, getList, startBulkAction } from '@/utils';
|
|
183
206
|
import ThreeDotsMenu from '@/components/ThreeDotsMenu.vue';
|
|
184
207
|
import { Tooltip } from '@/afcl'
|
|
185
|
-
import type { AdminForthComponentDeclarationFull } from '@/types/Common';
|
|
208
|
+
import type { AdminForthComponentDeclaration, AdminForthComponentDeclarationFull } from '@/types/Common';
|
|
186
209
|
|
|
187
210
|
|
|
188
211
|
import {
|
|
@@ -445,4 +468,23 @@ watch([sort], async () => {
|
|
|
445
468
|
setQuery({ sort: SortQuerySerializer.serialize(sort.value) });
|
|
446
469
|
});
|
|
447
470
|
|
|
448
|
-
</script>
|
|
471
|
+
</script>
|
|
472
|
+
|
|
473
|
+
<style lang="scss">
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
.af-button-shadow {
|
|
477
|
+
position: relative;
|
|
478
|
+
&::after {
|
|
479
|
+
content: '';
|
|
480
|
+
position: absolute;
|
|
481
|
+
left: 0;
|
|
482
|
+
right: 0;
|
|
483
|
+
height: 100%;
|
|
484
|
+
box-shadow: -0px 6px 6px rgb(0, 0, 0, 0.1);
|
|
485
|
+
border-radius: inherit;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
</style>
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
<!-- Modal header -->
|
|
32
32
|
<div class="af-login-modal-header flex items-center justify-between flex-col p-4 md:p-5 border-b rounded-t dark:border-gray-600">
|
|
33
33
|
|
|
34
|
-
<template v-if="coreStore?.config?.loginPageInjections?.panelHeader.length > 0">
|
|
34
|
+
<template v-if="coreStore?.config?.loginPageInjections?.panelHeader.length && coreStore?.config?.loginPageInjections?.panelHeader.length > 0">
|
|
35
35
|
<component
|
|
36
36
|
v-for="(c, index) in coreStore?.config?.loginPageInjections?.panelHeader || []"
|
|
37
37
|
:key="index"
|
|
38
|
-
:is="getCustomComponent(c)"
|
|
39
|
-
:meta="c.meta"
|
|
38
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
39
|
+
:meta="formatComponent(c).meta"
|
|
40
40
|
/>
|
|
41
41
|
</template>
|
|
42
42
|
<h3 v-else class="text-xl font-semibold text-lightLoginViewText dark:text-darkLoginViewTextColor">
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
name="username"
|
|
56
56
|
id="username"
|
|
57
57
|
ref="usernameInput"
|
|
58
|
-
@keydown.enter="passwordInput
|
|
58
|
+
@keydown.enter="passwordInput?.focus()"
|
|
59
59
|
class="w-full"
|
|
60
60
|
placeholder="name@company.com" required />
|
|
61
61
|
</div>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
</Input>
|
|
77
77
|
</div>
|
|
78
78
|
|
|
79
|
-
<div v-if="coreStore
|
|
79
|
+
<div v-if="coreStore?.config?.rememberMeDuration"
|
|
80
80
|
class="flex items-start mb-5"
|
|
81
81
|
:title="$t(`Stay logged in for {days}`, {days: coreStore.config.rememberMeDuration})"
|
|
82
82
|
>
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
|
|
89
89
|
<component
|
|
90
90
|
v-for="c in coreStore?.config?.loginPageInjections?.underInputs || []"
|
|
91
|
-
:is="getCustomComponent(c)"
|
|
92
|
-
:meta="c.meta"
|
|
91
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
92
|
+
:meta="formatComponent(c).meta"
|
|
93
93
|
@update:disableLoginButton="setDisableLoginButton($event)"
|
|
94
94
|
/>
|
|
95
95
|
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
</Button>
|
|
108
108
|
<component
|
|
109
109
|
v-for="c in coreStore?.config?.loginPageInjections?.underLoginButton || []"
|
|
110
|
-
:is="getCustomComponent(c)"
|
|
111
|
-
:meta="c.meta"
|
|
110
|
+
:is="getCustomComponent(formatComponent(c))"
|
|
111
|
+
:meta="formatComponent(c).meta"
|
|
112
112
|
@update:disableLoginButton="setDisableLoginButton($event)"
|
|
113
113
|
/>
|
|
114
114
|
</form>
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
|
|
125
125
|
<script setup lang="ts">
|
|
126
126
|
|
|
127
|
-
import { getCustomComponent } from '@/utils';
|
|
127
|
+
import { getCustomComponent, formatComponent } from '@/utils';
|
|
128
128
|
import { onBeforeMount, onMounted, ref, computed } from 'vue';
|
|
129
129
|
import { useCoreStore } from '@/stores/core';
|
|
130
130
|
import { useUserStore } from '@/stores/user';
|
|
@@ -137,8 +137,8 @@ import ErrorMessage from '@/components/ErrorMessage.vue';
|
|
|
137
137
|
|
|
138
138
|
const { t } = useI18n();
|
|
139
139
|
|
|
140
|
-
const passwordInput = ref(null);
|
|
141
|
-
const usernameInput = ref(null);
|
|
140
|
+
const passwordInput = ref<InstanceType<typeof Input> | null>(null);
|
|
141
|
+
const usernameInput = ref<InstanceType<typeof Input> | null>(null);
|
|
142
142
|
const rememberMeValue= ref(false);
|
|
143
143
|
const username = ref('');
|
|
144
144
|
const password = ref('');
|
|
@@ -179,7 +179,7 @@ onMounted(async () => {
|
|
|
179
179
|
username.value = demoUsername;
|
|
180
180
|
password.value = demoPassword;
|
|
181
181
|
}
|
|
182
|
-
usernameInput.value
|
|
182
|
+
usernameInput.value?.focus();
|
|
183
183
|
});
|
|
184
184
|
|
|
185
185
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<component
|
|
4
4
|
v-if="!loading"
|
|
5
5
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.beforeBreadcrumbs || []"
|
|
6
|
-
:is="getCustomComponent(c)"
|
|
7
|
-
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
6
|
+
:is="getCustomComponent(formatComponent(c as AdminForthComponentDeclarationFull))"
|
|
7
|
+
:meta="formatComponent(c as AdminForthComponentDeclarationFull).meta"
|
|
8
8
|
:record="coreStore.record"
|
|
9
9
|
:resource="coreStore.resource"
|
|
10
10
|
:adminUser="coreStore.adminUser"
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
<template v-for="action in coreStore.resource.options.actions.filter(a => a.showIn?.showButton)" :key="action.id">
|
|
16
16
|
<component
|
|
17
|
-
:is="action?.customComponent ? getCustomComponent(action.customComponent) : CallActionWrapper"
|
|
18
|
-
:meta="action.customComponent
|
|
19
|
-
@callAction="(payload
|
|
17
|
+
:is="action?.customComponent ? getCustomComponent(formatComponent(action.customComponent)) : CallActionWrapper"
|
|
18
|
+
:meta="action.customComponent ? formatComponent(action.customComponent).meta : undefined"
|
|
19
|
+
@callAction="(payload?: any) => startCustomAction(action.id, payload)"
|
|
20
20
|
:disabled="actionLoadingStates[action.id]"
|
|
21
21
|
>
|
|
22
22
|
<button
|
|
23
23
|
:key="action.id"
|
|
24
24
|
:disabled="actionLoadingStates[action.id!]"
|
|
25
|
-
class="flex items-center py-1 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-default border border-gray-300 hover:bg-gray-100 hover:text-lightPrimary 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"
|
|
25
|
+
class="flex items-center af-button-shadow h-[34px] py-1 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-default border border-gray-300 hover:bg-gray-100 hover:text-lightPrimary 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"
|
|
26
26
|
>
|
|
27
27
|
<component
|
|
28
28
|
v-if="action.icon"
|
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
</template>
|
|
37
37
|
<RouterLink v-if="coreStore.resource?.options?.allowedActions?.create"
|
|
38
38
|
:to="{ name: 'resource-create', params: { resourceId: $route.params.resourceId } }"
|
|
39
|
-
class="af-add-new-button flex items-center py-1 px-3 text-sm font-medium text-lightShowViewButtonText focus:outline-none bg-lightShowViewButtonBackground rounded border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-lightShowViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-darkShowViewButtonText dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover rounded-default gap-1"
|
|
39
|
+
class="af-add-new-button af-button-shadow h-[34px] flex items-center py-1 px-3 text-sm font-medium text-lightShowViewButtonText focus:outline-none bg-lightShowViewButtonBackground rounded border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-lightShowViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-darkShowViewButtonText dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover rounded-default gap-1"
|
|
40
40
|
>
|
|
41
41
|
<IconPlusOutline class="w-4 h-4"/>
|
|
42
42
|
{{ $t('Add new') }}
|
|
43
43
|
</RouterLink>
|
|
44
44
|
|
|
45
45
|
<RouterLink v-if="coreStore?.resourceOptions?.allowedActions?.edit" :to="{ name: 'resource-edit', params: { resourceId: $route.params.resourceId, primaryKey: $route.params.primaryKey } }"
|
|
46
|
-
class="flex items-center af-edit-button py-1 px-3 text-sm font-medium text-lightShowViewButtonText focus:outline-none bg-lightShowViewButtonBackground rounded-default border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-lightShowViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-darkShowViewButtonText dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover gap-1"
|
|
46
|
+
class="flex items-center h-[34px] af-button-shadow af-edit-button py-1 px-3 text-sm font-medium text-lightShowViewButtonText focus:outline-none bg-lightShowViewButtonBackground rounded-default border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-lightShowViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-darkShowViewButtonText dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover gap-1"
|
|
47
47
|
>
|
|
48
48
|
<IconPenSolid class="w-4 h-4" />
|
|
49
49
|
{{ $t('Edit') }}
|
|
50
50
|
</RouterLink>
|
|
51
51
|
|
|
52
52
|
<button v-if="coreStore?.resourceOptions?.allowedActions?.delete" @click="deleteRecord"
|
|
53
|
-
class="flex items-center af-delete-button py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-lightShowViewButtonBackground border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-red-500 dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover gap-1"
|
|
53
|
+
class="flex items-center h-[34px] af-button-shadow af-delete-button py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-lightShowViewButtonBackground border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-red-500 dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover gap-1"
|
|
54
54
|
>
|
|
55
55
|
<IconTrashBinSolid class="w-4 h-4" />
|
|
56
56
|
{{ $t('Delete') }}
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
<component
|
|
66
66
|
v-if="!loading"
|
|
67
67
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.afterBreadcrumbs || []"
|
|
68
|
-
:is="getCustomComponent(c)"
|
|
69
|
-
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
68
|
+
:is="getCustomComponent(formatComponent(c as AdminForthComponentDeclarationFull))"
|
|
69
|
+
:meta="formatComponent(c as AdminForthComponentDeclarationFull).meta"
|
|
70
70
|
:record="coreStore.record"
|
|
71
71
|
:resource="coreStore.resource"
|
|
72
72
|
:adminUser="coreStore.adminUser"
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
<template v-else>
|
|
96
96
|
<template v-for="group in groups" :key="group.groupName">
|
|
97
97
|
<ShowTable
|
|
98
|
-
:columns="group.columns"
|
|
98
|
+
:columns="group.columns as any"
|
|
99
99
|
:groupName="group.groupName"
|
|
100
100
|
:noTitle="group.noTitle"
|
|
101
101
|
:resource="coreStore.resource"
|
|
@@ -120,8 +120,8 @@
|
|
|
120
120
|
<component
|
|
121
121
|
v-if="!loading"
|
|
122
122
|
v-for="c in coreStore?.resourceOptions?.pageInjections?.show?.bottom || []"
|
|
123
|
-
:is="getCustomComponent(c)"
|
|
124
|
-
:meta="(c as AdminForthComponentDeclarationFull).meta"
|
|
123
|
+
:is="getCustomComponent(formatComponent(c as AdminForthComponentDeclarationFull))"
|
|
124
|
+
:meta="formatComponent(c as AdminForthComponentDeclarationFull).meta"
|
|
125
125
|
:record="coreStore.record"
|
|
126
126
|
:resource="coreStore.resource"
|
|
127
127
|
:adminUser="coreStore.adminUser"
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
import BreadcrumbsWithButtons from '@/components/BreadcrumbsWithButtons.vue';
|
|
138
138
|
|
|
139
139
|
import { useCoreStore } from '@/stores/core';
|
|
140
|
-
import { getCustomComponent, checkAcessByAllowedActions, initThreeDotsDropdown } from '@/utils';
|
|
140
|
+
import { getCustomComponent, checkAcessByAllowedActions, initThreeDotsDropdown, formatComponent } from '@/utils';
|
|
141
141
|
import { IconPenSolid, IconTrashBinSolid, IconPlusOutline } from '@iconify-prerendered/vue-flowbite';
|
|
142
142
|
import { onMounted, ref, computed } from 'vue';
|
|
143
143
|
import { useRoute,useRouter } from 'vue-router';
|
|
@@ -245,7 +245,7 @@ async function deleteRecord() {
|
|
|
245
245
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
async function startCustomAction(actionId: string, extra
|
|
248
|
+
async function startCustomAction(actionId: string, extra?: any) {
|
|
249
249
|
actionLoadingStates.value[actionId] = true;
|
|
250
250
|
|
|
251
251
|
const data = await callAdminForthApi({
|
package/dist/types/Back.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Express, Request } from 'express';
|
|
1
|
+
import type { Express, Request, Response } from 'express';
|
|
2
2
|
import type { Writable } from 'stream';
|
|
3
3
|
import { ActionCheckSource, AdminForthFilterOperators, AdminForthSortDirections, AllowedActionsEnum, AdminForthResourcePages, type AdminForthComponentDeclaration, type AdminUser, type AllowedActionsResolved, type AdminForthBulkActionCommon, type AdminForthForeignResourceCommon, type AdminForthResourceColumnCommon, type AdminForthResourceInputCommon, type AdminForthComponentDeclarationFull, type AdminForthConfigMenuItem, type AnnouncementBadgeResponse, type AdminForthResourceColumnInputCommon } from './Common.js';
|
|
4
4
|
export interface ICodeInjector {
|
|
@@ -44,7 +44,7 @@ export interface IHttpServer {
|
|
|
44
44
|
[key: string]: string;
|
|
45
45
|
}, cookies: {
|
|
46
46
|
[key: string]: string;
|
|
47
|
-
}, response: IAdminForthHttpResponse) => void;
|
|
47
|
+
}, response: IAdminForthHttpResponse, requestUrl: string, abortSignal: AbortSignal, _raw_express_req: Request, _raw_express_res: Response) => void;
|
|
48
48
|
}): void;
|
|
49
49
|
}
|
|
50
50
|
export interface IExpressHttpServer extends IHttpServer {
|
|
@@ -1494,7 +1494,7 @@ export interface AdminForthConfigCustomization extends Omit<AdminForthInputConfi
|
|
|
1494
1494
|
customPages: Array<AdminForthPageDeclaration>;
|
|
1495
1495
|
loginPageInjections: {
|
|
1496
1496
|
underInputs: Array<AdminForthComponentDeclarationFull>;
|
|
1497
|
-
underLoginButton
|
|
1497
|
+
underLoginButton: Array<AdminForthComponentDeclarationFull>;
|
|
1498
1498
|
panelHeader: Array<AdminForthComponentDeclarationFull>;
|
|
1499
1499
|
};
|
|
1500
1500
|
globalInjections: {
|
|
@@ -1590,7 +1590,7 @@ export type AllowedActions = {
|
|
|
1590
1590
|
/**
|
|
1591
1591
|
* General options for resource.
|
|
1592
1592
|
*/
|
|
1593
|
-
export interface ResourceOptionsInput extends Omit<NonNullable<AdminForthResourceInputCommon['options']>, 'allowedActions' | 'bulkActions'> {
|
|
1593
|
+
export interface ResourceOptionsInput extends Omit<NonNullable<AdminForthResourceInputCommon['options']>, 'allowedActions' | 'bulkActions' | 'actions'> {
|
|
1594
1594
|
/**
|
|
1595
1595
|
* Custom bulk actions list. Bulk actions available in list view when user selects multiple records by
|
|
1596
1596
|
* using checkboxes.
|