adminforth 2.4.0-next.44 → 2.4.0-next.46

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.
@@ -3,7 +3,10 @@ import AdminForth from 'adminforth';
3
3
  import usersResource from "./resources/adminuser.js";
4
4
  import { fileURLToPath } from 'url';
5
5
  import path from 'path';
6
-
6
+ import dotenv from "dotenv";
7
+ dotenv.config({ path: '.env.local', override: true });
8
+ dotenv.config({ path: '.env', override: true });
9
+
7
10
  const ADMIN_BASE_URL = '';
8
11
 
9
12
  export const admin = new AdminForth({
@@ -5,15 +5,21 @@
5
5
  :expandDepth="expandDepth"
6
6
  copyable
7
7
  sort
8
+ :theme="currentTheme"
8
9
  />
9
10
  </template>
10
11
 
11
12
  <script setup lang="ts">
13
+ import { computed } from 'vue'
12
14
  import { JsonViewer } from 'vue3-json-viewer'
15
+ import { useCoreStore } from '@/stores/core'
13
16
 
14
17
  defineProps<{
15
18
  value: any
16
19
  expandDepth?: number
17
20
  }>()
18
21
 
22
+ const coreStore = useCoreStore()
23
+
24
+ const currentTheme = computed(() => (coreStore.theme === 'dark' ? 'dark' : 'light'))
19
25
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="overflow-x-auto rounded-default shadow-resourseFormShadow dark:shadow-darkResourseFormShadow">
2
+ <div :class="`overflow-x-auto ${isRounded ? 'rounded-default' : ''} shadow-resourseFormShadow dark:shadow-darkResourseFormShadow`">
3
3
  <div v-if="groupName && !noTitle" class="text-md font-semibold px-6 py-3 flex flex-1 items-center dark:border-gray-600 text-gray-700 bg-lightFormHeading dark:bg-gray-700 dark:text-gray-400 rounded-t-lg">
4
4
  {{ groupName }}
5
5
  </div>
@@ -60,7 +60,7 @@
60
60
  import { getCustomComponent } from '@/utils';
61
61
  import { useCoreStore } from '@/stores/core';
62
62
  import { computed } from 'vue';
63
- const props = defineProps<{
63
+ const props = withDefaults(defineProps<{
64
64
  columns: Array<{
65
65
  name: string;
66
66
  label: string;
@@ -80,8 +80,11 @@
80
80
  noTitle?: boolean;
81
81
  resource: Record<string, any>;
82
82
  record: Record<string, any>;
83
- }>();
84
-
83
+ isRounded?: boolean;
84
+ }>(), {
85
+ isRounded: true
86
+ });
87
+
85
88
  const coreStore = useCoreStore();
86
89
  const allColumnsHaveCustomComponent = computed(() => {
87
90
  return props.columns.every(column => {
@@ -92,16 +92,16 @@ export interface IExpressHttpServer extends IHttpServer {
92
92
  * Adds adminUser to request object if user is authorized. Drops request with 401 status if user is not authorized.
93
93
  * @param callable : Function which will be called if user is authorized.
94
94
  *
95
- * Example:
96
95
  *
96
+ * @example
97
97
  * ```ts
98
- * expressApp.get('/myApi', authorize((req, res) => \{
98
+ * expressApp.get('/myApi', authorize((req, res) => {
99
99
  * console.log('User is authorized', req.adminUser);
100
- * res.json(\{ message: 'Hello World' \});
101
- * \}));
100
+ * res.json({ message: 'Hello World' });
101
+ * }));
102
102
  * ```
103
103
  *
104
- */
104
+ */
105
105
  authorize(callable: Function): void;
106
106
  }
107
107
 
@@ -62,13 +62,13 @@ export interface IExpressHttpServer extends IHttpServer {
62
62
  * Adds adminUser to request object if user is authorized. Drops request with 401 status if user is not authorized.
63
63
  * @param callable : Function which will be called if user is authorized.
64
64
  *
65
- * Example:
66
65
  *
66
+ * @example
67
67
  * ```ts
68
- * expressApp.get('/myApi', authorize((req, res) => \{
68
+ * expressApp.get('/myApi', authorize((req, res) => {
69
69
  * console.log('User is authorized', req.adminUser);
70
- * res.json(\{ message: 'Hello World' \});
71
- * \}));
70
+ * res.json({ message: 'Hello World' });
71
+ * }));
72
72
  * ```
73
73
  *
74
74
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.44",
3
+ "version": "2.4.0-next.46",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",