adminforth 1.1.47 → 1.1.49

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.
@@ -9,7 +9,9 @@ export default {
9
9
 
10
10
  darkMode: 'class',
11
11
  plugins: [
12
- require('flowbite/plugin'),
12
+ require('flowbite/plugin')({
13
+ charts: true,
14
+ }),
13
15
  ],
14
16
  }
15
17
 
@@ -7,10 +7,10 @@ import os from 'os';
7
7
  import path from 'path';
8
8
  import { promisify } from 'util';
9
9
  import AdminForth from '../index.js';
10
- import { ADMIN_FORTH_ABSOLUTE_PATH } from './utils.js';
11
- import { getComponentNameFromPath } from './utils.js';
10
+ import { ADMIN_FORTH_ABSOLUTE_PATH, getComponentNameFromPath, transformObject, deepMerge } from './utils.js';
12
11
  import { styles } from './styles.js'
13
12
  import { AdminForthComponentDeclaration, CodeInjectorType } from '../types/AdminForthConfig.js';
13
+ import { StylesGenerator } from './styleGenerator.js';
14
14
 
15
15
 
16
16
 
@@ -290,8 +290,6 @@ class CodeInjector implements CodeInjectorType {
290
290
  });
291
291
  });
292
292
  });
293
-
294
-
295
293
  });
296
294
 
297
295
  customResourceComponents.forEach((filePath) => {
@@ -340,20 +338,14 @@ class CodeInjector implements CodeInjectorType {
340
338
  }
341
339
  await fs.promises.writeFile(appVuePath, appVueContent);
342
340
 
343
- // generate tailwind extend styles
344
- if(this.adminforth.config?.styles){
345
- const tailwindStyles = this.adminforth.config?.styles
346
- const stylesText = JSON.stringify(tailwindStyles, null, 2).slice(1, -1);
347
- let tailwindConfigPath = path.join(CodeInjector.SPA_TMP_PATH, 'tailwind.config.js');
348
- let tailwindConfigContent = await fs.promises.readFile(tailwindConfigPath, 'utf-8');
349
- tailwindConfigContent = tailwindConfigContent.replace('/* IMPORTANT:ADMINFORTH TAILWIND STYLES */', stylesText);
350
- await fs.promises.writeFile(tailwindConfigPath, tailwindConfigContent);
351
- } else {
352
- let tailwindConfigPath = path.join(CodeInjector.SPA_TMP_PATH, 'tailwind.config.js');
353
- let tailwindConfigContent = await fs.promises.readFile(tailwindConfigPath, 'utf-8');
354
- tailwindConfigContent = tailwindConfigContent.replace('/* IMPORTANT:ADMINFORTH TAILWIND STYLES */',styles());
355
- await fs.promises.writeFile(tailwindConfigPath, tailwindConfigContent);
356
- }
341
+ // generate tailwind extend styles
342
+ const stylesGenerator = new StylesGenerator(this.adminforth.config.customization?.styles);
343
+ const stylesText = JSON.stringify(stylesGenerator.mergeStyles(), null, 2).slice(1, -1);
344
+ let tailwindConfigPath = path.join(CodeInjector.SPA_TMP_PATH, 'tailwind.config.js');
345
+ let tailwindConfigContent = await fs.promises.readFile(tailwindConfigPath, 'utf-8');
346
+ tailwindConfigContent = tailwindConfigContent.replace('/* IMPORTANT:ADMINFORTH TAILWIND STYLES */', stylesText);
347
+ await fs.promises.writeFile(tailwindConfigPath, tailwindConfigContent);
348
+
357
349
 
358
350
  const routerVuePath = path.join(CodeInjector.SPA_TMP_PATH, 'src', 'router', 'index.ts');
359
351
 
@@ -0,0 +1,45 @@
1
+ import { transformObject,deepMerge } from "./utils.js";
2
+ import { styles } from "./styles.js";
3
+
4
+ const aliasObject ={ lightSidebarText:'lightSidebarIcons',darkSidebarText:'darkSidebarIcons',lightSidebarTextHover:'lightSidebarIconsHover',darkSidebarTextHover:'darkSidebarIconsHover'}
5
+
6
+ export class StylesGenerator {
7
+ styleConfig: any;
8
+ defaultStyles: any;
9
+
10
+ constructor(styleConfig: any) {
11
+ if (!styleConfig) {
12
+ console.log("No styles provided using default styles.");
13
+ }
14
+ this.styleConfig = styleConfig;
15
+ this.defaultStyles = styles();
16
+ }
17
+
18
+ private generatePlainStyles(styleObj:any) {
19
+ let plainCustomStyles = {}
20
+ if (styleObj) {
21
+ Object.keys(styleObj).forEach((k)=>{
22
+ plainCustomStyles[k] = transformObject(styleObj[k])
23
+ })
24
+ }
25
+ return plainCustomStyles;
26
+ }
27
+ private changeAliases(plateStyles: any) {
28
+ if (!plateStyles || !plateStyles.colors) {
29
+ return plateStyles;
30
+ }
31
+ let colors = plateStyles.colors;
32
+ Object.keys(aliasObject).forEach((aliasName) => {
33
+ if (colors[aliasObject[aliasName]]) return;
34
+ if (!colors[aliasName]) return;
35
+ colors[aliasObject[aliasName]] = colors[aliasName];
36
+ })
37
+ return plateStyles;
38
+ }
39
+
40
+ mergeStyles() {
41
+ let mergedStyles = deepMerge(this.defaultStyles, this.changeAliases(this.generatePlainStyles(this.styleConfig)));
42
+ return mergedStyles;
43
+ }
44
+
45
+ }
package/modules/styles.ts CHANGED
@@ -1,53 +1,100 @@
1
- export const styles = () => `
2
-
3
- "colors": {
4
- "html-bg": "#FFFFFF", // Changed to white
5
- "header-bg": "#FFFFFF", // Light grey
6
- "header-bg-hover": "#D3D3D3", // Light grey hover
7
- "header-text": "#333333", // Dark grey text
8
- "header-text-hover": "#333333", // Dark grey text hover
9
- "header-icons": "#333333", // Dark grey icons
10
- "header-icons-hover": "#333333", // Dark grey icons hover
11
- "header-logo-color": "#333333", // Dark grey logo
12
- "header-border-color": "rgb(229 231 235)", // Light grey border
13
-
14
- "nav-menu-bg": "#ffffff", // Very light grey
15
- "nav-menu-border": "rgb(229 231 235)",
16
- "nav-menu-bg-hover": "rgb(243 244 246)", // Light grey hover
17
- "nav-menu-bg-active": "rgb(233, 234, 236)", // Light grey active
18
- "nav-menu-hover": "#rgb(209 213 219)", // Light grey hover
19
- "nav-menu-active": "#CCCCCC", // Light grey active
20
- "nav-menu-active-text": "#333333", // Dark grey active text
21
- "nav-menu-text": "#333333", // Dark grey text
22
- "nav-menu-text-hover": "#333333", // Dark grey text hover
23
- "nav-menu-text-active": "#333333", // Dark grey text active
24
- "nav-menu-devider": "#E0E0E0", // Light grey divider
25
- "nav-menu-icons": "#333333", // Dark grey icons
26
- "nav-menu-heading": "#333333", // Dark grey heading
27
-
28
- "list-view-bg": "#FFFFFF", // White background
29
- "list-view-table-bg": "#FFFFFF", // White table background
30
- "list-view-table-heading": "rgb(249 250 251)", // Very light grey heading
31
- "list-view-table-heading-text": "#333333", // Dark grey heading text
32
- "list-view-table-text": "#333333", // Dark grey text
33
- "list-view-table-row-hover": "rgb(249 250 251)", // Very light grey row hover
34
- "list-view-bread-crumbs-text": "#666666", // Medium grey bread crumbs
35
- "list-view-border-color": "#DDDDDD", // Light grey border
36
-
37
- "form-view-bg": "#FFFFFF", // White form background
38
- "form-view-border-color": "#F5F5F5", // Very light grey border
39
- "form-view-heading": "#EDEDED" // Dark grey heading
1
+
2
+
3
+ export const styles = () => ({
4
+ colors: {
5
+ lightHtml: "#FFFFFF", // main background
6
+
7
+ lightNavbar: "#FFFFFF", // navbar background
8
+ lightNavbarHover: "#D3D3D3", // in development
9
+ lightNavbarText: "#333333", // in development
10
+ lightNavbarTextHover: "#333333", // in development
11
+ lightNavbarIcons: "#333333", // in development
12
+ lightNavbarIconsHover: "#333333", // in development
13
+ lightNavbarLogo: "#333333", // in development
14
+ lightNavbarBorder: "rgb(229 231 235)", // border
15
+
16
+ lightSidebar: "#ffffff", // sidebar background
17
+ lightSidebarBorder: "rgb(229 231 235)", // sidebar right border
18
+ lightSidebarHover: "rgb(243 244 246)", // in development
19
+ lightSidebarActive: "rgb(233, 234, 236)", // in development
20
+ lightSidebarItemHover: "rgb(243 244 246)", // sidebar list item hover
21
+ lightSidebarItemActive: "rgb(233, 234, 236)", // sidebar list item active
22
+ lightSidebarText: "#4b5563", // sidebar list item text
23
+ lightSidebarTextHover: "#333333", // sidebar list item text hover
24
+ lightSidebarTextActive: "#333333", // sidebar list item text active
25
+ lightSidebarDevider: "#E0E0E0", // sidebar devider
26
+ lightSidebarIcons: "#6b7280", // sidebar list item icons
27
+ lightSidebarIconsHover: "#333333", // sidebar list item icons hover
28
+ lightSidebarHeading: "#333333", // sidebar heading
29
+
30
+ lightList: "#FFFFFF", // list view background
31
+ lightListTable: "#FFFFFF", // list view table background
32
+ lightListTableHeading: "rgb(249 250 251)", // list view table heading
33
+ lightListTableHeadingText: "#333333", // list view table heading text
34
+ lightListTableText: "#333333", // list view table text
35
+ lightListTableRowHover: "rgb(249 250 251)", // list view row hover
36
+ lightListBreadcrumbsText: "#666666", // list view breadcrumbs text
37
+ lightListBorder: "#DDDDDD", // list view rows border
38
+
39
+ lightForm: "#FFFFFF", // show view background
40
+ lightFormBorder: "#F5F5F5", // show view rows border
41
+ lightFormHeading: "#EDEDED", // show view heading
42
+
43
+
44
+ // colors for dark theme
45
+ darkHtml: "#111827",
46
+
47
+ darkNavbar: "#111827",
48
+ darkNavbarHover: "#444444",
49
+ darkNavbarText: "#FFFFFF",
50
+ darkNavbarTextHover: "#FFFFFF",
51
+ darkNavbarIcons: "#FFFFFF",
52
+ darkNavbarIconsHover: "#FFFFFF",
53
+ darkNavbarLogo: "#FFFFFF",
54
+ darkNavbarBorder: "#e5e7eb",
55
+
56
+ darkSidebar: "#1f2937",
57
+ darkSidebarBorder: "#374151",
58
+ darkSidebarHover: "#374151",
59
+ darkSidebarActive: "#444444",
60
+ darkSidebarItemHover: "#374151",
61
+ darkSidebarItemActive: "#52525b",
62
+ darkSidebarItemActiveText: "#FFFFFF",
63
+ darkSidebarText: "#9ca3af",
64
+ darkSidebarTextHover: "#FFFFFF",
65
+ darkSidebarTextActive: "#FFFFFF",
66
+ darkSidebarDevider: "#374151",
67
+ darkSidebarIcons: "#9ca3af",
68
+ darkSidebarIconsHover: "#FFFFFF",
69
+ darkSidebarHeading: "#FFFFFF",
70
+
71
+ darkList: "#111111",
72
+ darkListTable: "#1f2937",
73
+ darkListTableHeading: "#334155",
74
+ darkListTableHeadingText: "#9ca3af",
75
+ darkListTableText: "#9ca3af",
76
+ darkListTableRowHover: "#4b5563",
77
+ darkListBreadcrumbsText: "#BBBBBB",
78
+ darkListBorder: "#444444",
79
+
80
+ darkForm: "#111111",
81
+ darkFormBorder: "#222222",
82
+ darkFormHeading: "#333333"
83
+
40
84
  },
41
- "boxShadow": {
42
- "custom-light": "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
43
- "header-shadow": "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
44
- "list-table-shadow": "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
45
- "resourse-form-shadow": "0 4px 8px rgba(0, 0, 0, 0.1)" // Lighter shadow
85
+ boxShadow: {
86
+ customLight: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
87
+ headerShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
88
+ listTableShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
89
+ resourseFormShadow: "0 4px 8px rgba(0, 0, 0, 0.1)" // Lighter shadow
46
90
  },
47
- "fontSize": {
48
- "header-text-size": "1rem"
91
+ fontSize: {
92
+ "headerText-size": "1rem"
49
93
  },
50
- "borderRadius": {
94
+ borderRadius: {
51
95
  "default": "2px"
52
96
  }
53
- `;
97
+ });
98
+
99
+
100
+
package/modules/utils.ts CHANGED
@@ -36,4 +36,52 @@ export function getComponentNameFromPath(filePath) {
36
36
 
37
37
  export function listify(param?: Array<Function>) {
38
38
  return param || [];
39
+ }
40
+
41
+ export function deepMerge(target, source) {
42
+ if (typeof target !== 'object' || target === null) {
43
+ return source;
44
+ }
45
+
46
+ for (let key in source) {
47
+ if (source.hasOwnProperty(key)) {
48
+ if (typeof source[key] === 'object' && source[key] !== null) {
49
+ if (!target[key]) {
50
+ target[key] = {};
51
+ }
52
+ deepMerge(target[key], source[key]);
53
+ } else {
54
+ target[key] = source[key];
55
+ }
56
+ }
57
+ }
58
+
59
+ return target;
60
+ }
61
+
62
+ function toCamelCase(str) {
63
+ return str.replace(/[-_](.)/g, (_, char) => char.toUpperCase());
64
+ }
65
+
66
+ export function transformObject(obj, parentKey = '', result = {}) {
67
+ for (const key in obj) {
68
+ if (obj.hasOwnProperty(key)) {
69
+ const camelCaseKey = toCamelCase(parentKey ? `${parentKey}_${key}` : key);
70
+ if (typeof obj[key] === 'object' && !Array.isArray(obj[key])) {
71
+ transformObject(obj[key], camelCaseKey, result);
72
+ } else {
73
+ result[camelCaseKey] = obj[key];
74
+ }
75
+ }
76
+ }
77
+ //remove 'Default' from keys
78
+ for (const key in result) {
79
+ if (key.includes('Main')) {
80
+ const newKey = key.replace('Main', '');
81
+ result[newKey] = result[key];
82
+ delete result[key];
83
+ }
84
+ }
85
+
86
+ return result;
39
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.1.47",
3
+ "version": "1.1.49",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/spa/index.html CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  </head>
19
19
  <body class=" ">
20
- <div id="app" class="min-h-screen bg-html-bg dark:bg-gray-800"></div>
20
+ <div id="app" class="min-h-screen bg-lightHtml dark:bg-darkHtml"></div>
21
21
  <script type="module" src="/src/main.ts"></script>
22
22
  </body>
23
23
  </html>
package/spa/src/App.vue CHANGED
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <nav
3
3
  v-if="loggedIn && routerIsReady && loginRedirectCheckIsReady"
4
- class="fixed h-14 top-0 z-20 w-full border-b shadow-sm bg-header-bg shadow-header-shadow dark:bg-header-bg-hover dark:border-nav-menu-devider">
4
+ class="fixed h-14 top-0 z-20 w-full border-b shadow-sm bg-lightNavbar shadow-headerShadow dark:bg-darkNavbar dark:border-darkSidebarDevider">
5
5
  <div class="px-3 py-3 lg:px-5 lg:pl-3">
6
6
  <div class="flex items-center justify-between">
7
7
  <div class="flex items-center justify-start rtl:justify-end">
8
8
  <button @click="sideBarOpen = !sideBarOpen"
9
- type="button" class="inline-flex items-center p-2 text-sm rounded-lg sm:hidden hover:bg-nav-menu-bg-hover focus:outline-none focus:ring-2 focus:ring-nav-menu-devider dark:text-nav-menu-icons dark:hover:bg-nav-menu-bg-hover dark:focus:ring-nav-menu-devider">
9
+ type="button" class="inline-flex items-center p-2 text-sm rounded-lg sm:hidden hover:bg-lightSidebarItemHover focus:outline-none focus:ring-2 focus:ring-lightSidebarDevider dark:text-darkSidebarIcons dark:hover:bg-darkSidebarHover dark:focus:ring-lightSidebarDevider">
10
10
  <span class="sr-only">Open sidebar</span>
11
11
  <svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
12
12
  <path clip-rule="evenodd" fill-rule="evenodd" d="M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"></path>
@@ -17,25 +17,25 @@
17
17
  <div class="flex items-center">
18
18
  <div class="flex items-center ms-3 ">
19
19
  <div>
20
- <button type="button" class="flex text-sm bg-header-bg-hover rounded-full focus:ring-4 focus:ring-nav-menu-devider dark:focus:ring-nav-menu-devider dark:bg-header-bg-hover" aria-expanded="false" data-dropdown-toggle="dropdown-user">
20
+ <button type="button" class="flex text-sm bg- rounded-full focus:ring-4 focus:ring-lightSidebarDevider dark:focus:ring-darkSidebarDevider dark:bg-" aria-expanded="false" data-dropdown-toggle="dropdown-user">
21
21
  <span class="sr-only">Open user menu</span>
22
- <svg class="w-8 h-8 text-nav-menu-icons dark:text-header-icons" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
22
+ <svg class="w-8 h-8 text-lightSidebarIcons dark:text-darkSidebarIcons" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
23
23
  <path fill-rule="evenodd" d="M12 20a7.966 7.966 0 0 1-5.002-1.756l.002.001v-.683c0-1.794 1.492-3.25 3.333-3.25h3.334c1.84 0 3.333 1.456 3.333 3.25v.683A7.966 7.966 0 0 1 12 20ZM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.5-4.44 9.963-9.932 10h-.138C6.438 21.962 2 17.5 2 12Zm10-5c-1.84 0-3.333 1.455-3.333 3.25S10.159 13.5 12 13.5c1.84 0 3.333-1.455 3.333-3.25S13.841 7 12 7Z" clip-rule="evenodd"/>
24
24
  </svg>
25
25
  </button>
26
26
  </div>
27
- <div class="z-50 hidden my-4 text-base list-none bg-white divide-y divide-gray-100 rounded shadow dark:shadow-black dark:bg-nav-menu-bg dark:divide-nav-menu-devider dark:shadow-black" id="dropdown-user">
27
+ <div class="z-50 hidden my-4 text-base list-none bg-white divide-y divide-gray-100 rounded shadow dark:shadow-black dark:bg-darkSidebar dark:divide-darkSidebarDevider dark:shadow-black" id="dropdown-user">
28
28
  <div class="px-4 py-3" role="none">
29
- <p class="text-sm text-gray-900 dark:text-header-text" role="none" v-if="coreStore.userFullname">
29
+ <p class="text-sm text-gray-900 dark:text-darkNavbarText" role="none" v-if="coreStore.userFullname">
30
30
  {{ coreStore.userFullname }}
31
31
  </p>
32
- <p class="text-sm font-medium text-gray-900 truncate dark:text-nav-menu-text" role="none">
32
+ <p class="text-sm font-medium text-gray-900 truncate dark:text-darkSidebarText" role="none">
33
33
  {{ coreStore.username }}
34
34
  </p>
35
35
  </div>
36
36
  <ul class="py-1" role="none">
37
37
  <li>
38
- <span @click="toggleTheme" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-html-bg dark:text-nav-menu-text-hover dark:hover:bg-nav-menu-hover dark:hover:text-nav-menu-text-active" role="menuitem">
38
+ <span @click="toggleTheme" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-lightHtml dark:text-darkSidebarTextHover dark:hover:bg-darkHtml dark:hover:text-darkSidebarTextActive" role="menuitem">
39
39
  {{ theme === 'dark' ? 'Light' : 'Dark' }}
40
40
  <IconMoonSolid class="w-5 h-5 text-blue-300" v-if="theme !== 'dark'" />
41
41
  <IconSunSolid class="w-5 h-5 text-yellow-300" v-else />
@@ -43,7 +43,7 @@
43
43
  </span>
44
44
  </li>
45
45
  <li>
46
- <button @click="logout" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-html-bg dark:text-nav-menu-text-hover dark:hover:bg-nav-menu-hover dark:hover:text-nav-menu-text-active w-full" role="menuitem">Sign out</button>
46
+ <button @click="logout" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-html dark:text-darkSidebarTextHover dark:hover:bg-darkSidebarItemHover dark:hover:text-darkSidebarTextActive w-full" role="menuitem">Sign out</button>
47
47
  </li>
48
48
  </ul>
49
49
  </div>
@@ -59,30 +59,30 @@
59
59
 
60
60
  v-if="loggedIn && routerIsReady && loginRedirectCheckIsReady"
61
61
 
62
- id="logo-sidebar" class="fixed border-none top-0 left-0 z-20 w-64 h-screen transition-transform bg-nav-menu-bg border-r border-nav-menu-border sm:translate-x-0 dark:bg-gray-800 dark:border-gray-700"
62
+ id="logo-lightSidebar" class="fixed bg-lightSidebar border-none top-0 left-0 z-20 w-64 h-screen transition-transform bg-lightSidebar dark:bg-darkSidebar border-r border-lightSidebarBorder sm:translate-x-0 dark:bg-darkSidebar dark:border-darkSidebarBorder"
63
63
  :class="{ '-translate-x-full': !sideBarOpen, 'transform-none': sideBarOpen }"
64
64
  aria-label="Sidebar"
65
65
  >
66
- <div class="h-full px-3 pb-4 overflow-y-auto bg-nav-menu-bg dark:bg-gray-800 border-r">
66
+ <div class="h-full px-3 pb-4 overflow-y-auto bg-lightSidebar dark:bg-darkSidebar border-r dark:border-darkSidebarBorder">
67
67
  <div class="flex ms-2 md:me-24 m-4 ">
68
68
  <img :src="loadFile(coreStore.config?.brandLogo || '@/assets/logo.svg')" :alt="`${ coreStore.config?.brandName } Logo`" class="h-8 me-3" />
69
- <span class="self-center text-header-text-size font-semibold sm:text-header-text-size whitespace-nowrap dark:text-header-text text-header-logo-color">
69
+ <span class="self-center text-lightNavbarText-size font-semibold sm:text-lightNavbarText-size whitespace-nowrap dark:text-darkNavbarText text-lightNavbarLogo">
70
70
  {{ coreStore.config?.brandName }}
71
71
  </span>
72
72
  </div>
73
73
 
74
74
  <ul class="space-y-2 font-medium">
75
75
  <template v-for="(item, i) in coreStore.menu" :key="`menu-${i}`">
76
- <div v-if="item.type === 'divider'" class="border-t border-nav-menu-devider dark:border-gray-700"></div>
76
+ <div v-if="item.type === 'divider'" class="border-t border-lightSidebarDevider dark:border-darkSidebarDevider"></div>
77
77
  <div v-else-if="item.type === 'gap'" class="flex items-center justify-center h-8"></div>
78
78
  <div v-else-if="item.type === 'heading'" class="flex items-center justify-left pl-2 h-8 text-gray-400 dark:text-gray-400
79
79
  ">{{ item.label }}</div>
80
- <li v-else-if="item.children">
81
- <button @click="clickOnMenuItem(i)" type="button" class="flex items-center w-full p-2 text-base text-nav-menu-text rounded-default transition duration-75 group hover:bg-nav-menu-bg-hover dark:text-white dark:hover:bg-gray-700"
80
+ <li v-else-if="item.children" class=" ">
81
+ <button @click="clickOnMenuItem(i)" type="button" class="flex items-center w-full p-2 text-base text-lightSidebarText rounded-default transition duration-75 group hover:bg-lightSidebarItemHover hover:text-lightSidebarTextHover dark:text-darkSidebarText dark:hover:bg-darkSidebarHover dark:hover:text-darkSidebarTextHover"
82
82
  :aria-controls="`dropdown-example${i}`"
83
83
  :data-collapse-toggle="`dropdown-example${i}`"
84
84
  >
85
- <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 dark:group-hover:text-white" ></component>
85
+ <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons group-hover:text-lightSidebarIconsHover transition duration-75 dark:group-hover:text-darkSidebarIconsHover dark:text-darkSidebarIcons" ></component>
86
86
 
87
87
  <span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">{{ item.label }}</span>
88
88
  <svg :class="{'rotate-180': opened.includes(i) }" class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
@@ -1,16 +1,16 @@
1
1
  <template>
2
2
  <RouterLink
3
3
  :to="{name: item.resourceId ? 'resource-list' : item.path, params: item.resourceId ? { resourceId: item.resourceId }: {}}"
4
- class="flex items-center py-2 text-nav-menu-text rounded-default hover:bg-nav-menu-bg-hover active:bg-nav-menu-bg-active" role="menuitem"
4
+ class="flex group items-center py-2 text-lightSidebarText dark:text-darkSidebarText rounded-default hover:bg-lightSidebarItemHover hover:text-lightSidebarTextHover dark:hover:bg-darkSidebarHover dark:hover:text-darkSidebarTextHover active:bg-lightSidebarActive dark:active:bg-darkSidebarHover" role="menuitem"
5
5
  :class="{
6
6
  'px-4': isChild,
7
7
  'px-2': !isChild,
8
- 'bg-nav-menu-bg-active dark:bg-gray-700': item.resourceId ?
8
+ 'bg-sidebarActive dark:bg-gray-700': item.resourceId ?
9
9
  ($route.params.resourceId === item.resourceId && $route.name === 'resource-list') :
10
10
  ($route.name === item.path)
11
11
  }"
12
12
  >
13
- <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" ></component>
13
+ <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons dark:text-darkSidebarIcons transition duration-75 group-hover:text-lightSidebarIconsHover dark:group-hover:text-darkSidebarIconsHover" ></component>
14
14
  <span class="ms-3">{{ item.label }}</span>
15
15
  </RouterLink>
16
16
  </template>
@@ -2,11 +2,11 @@
2
2
  <div class="rounded-default">
3
3
 
4
4
  <div
5
- class="relative shadow-resourse-form-shadow sm:rounded-lg dark:shadow-2xl dark:shadow-black rounded-default"
5
+ class="relative shadow-resourseFormShadow sm:rounded-lg dark:shadow-2xl dark:shadow-black rounded-default"
6
6
  >
7
7
  <form autocomplete="off" @submit.prevent>
8
8
  <table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 ">
9
- <thead class="text-xs text-gray-700 uppercase bg-form-view-heading dark:bg-gray-700 dark:text-gray-400">
9
+ <thead class="text-xs text-gray-700 uppercase bg-lightormHeading dark:bg-gray-700 dark:text-gray-400">
10
10
  <tr>
11
11
  <th scope="col" class="px-6 py-3">
12
12
  Field
@@ -18,7 +18,7 @@
18
18
  </thead>
19
19
  <tbody>
20
20
  <tr v-for="column, i in editableColumns" :key="column.name"
21
- class="bg-form-view-bg dark:bg-gray-800 border-b dark:border-gray-700"
21
+ class="bg-ligftForm dark:bg-gray-800 border-b dark:border-gray-700"
22
22
  >
23
23
  <!-- if column is in customComponentsPerColumn, use this component. If not, use this code -->
24
24
  <template v-if="column?.components?.[props.source].file">
@@ -1,30 +1,15 @@
1
1
  <template>
2
2
  <!-- table -->
3
- <div class="relative overflow-x-auto shadow-list-table-shadow dark:shadow-black overflow-y-hidden rounded-default">
3
+ <div class="relative overflow-x-auto shadow-listTableShadow dark:shadow-black overflow-y-hidden rounded-default">
4
4
 
5
5
  <!-- skelet loader -->
6
6
  <div role="status" v-if="!resource || !resource.columns"
7
7
  class="max-w p-4 space-y-4 divide-y divide-gray-200 rounded shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700">
8
- <div class="flex items-center justify-between h-16">
9
- <div>
10
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
11
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
12
- </div>
13
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
14
- </div>
15
-
16
- <div class="flex items-center justify-between h-16 pt-4" v-for="i in new Array(10)">
17
- <div>
18
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
19
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
20
- </div>
21
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
22
- </div>
23
- <span class="sr-only">Loading...</span>
8
+
24
9
  </div>
25
10
 
26
11
  <table v-else class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 rounded-default">
27
- <thead class="text-xs text-view-table-heading-text bg-list-view-table-heading dark:bg-gray-700 dark:text-gray-400">
12
+ <thead class="text-xs text-view-table-heading-text bg-lightListTableHeading dark:bg-darkListTableHeading dark:text-gray-400">
28
13
  <tr>
29
14
  <th scope="col" class="p-4">
30
15
  <div v-if="rows && rows.length" class="flex items-center">
@@ -69,51 +54,8 @@
69
54
  </tr>
70
55
  </thead>
71
56
  <tbody>
72
- <tr v-if="!rows" class="bg-list-view-table-bg border-b dark:bg-gray-800 dark:border-gray-700">
73
- <td :colspan="resource?.columns.length + 2">
74
-
75
- <div role="status"
76
- class="max-w p-4 space-y-4 divide-y divide-gray-200 rounded animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700">
77
- <div class="flex items-center justify-between">
78
- <div>
79
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
80
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
81
- </div>
82
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
83
- </div>
84
- <div class="flex items-center justify-between pt-4">
85
- <div>
86
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
87
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
88
- </div>
89
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
90
- </div>
91
- <div class="flex items-center justify-between pt-4">
92
- <div>
93
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
94
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
95
- </div>
96
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
97
- </div>
98
- <div class="flex items-center justify-between pt-4">
99
- <div>
100
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
101
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
102
- </div>
103
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
104
- </div>
105
- <div class="flex items-center justify-between pt-4">
106
- <div>
107
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
108
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
109
- </div>
110
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
111
- </div>
112
- <span class="sr-only">Loading...</span>
113
- </div>
114
- </td>
115
- </tr>
116
- <tr v-else-if="rows.length === 0" class="bg-list-view-table-bg border-b dark:bg-gray-800 dark:border-gray-700">
57
+ <SkeleteLoader v-if="!rows?.length" :columns="10" :rows="10"/>
58
+ <tr v-else-if="rows.length === 0" class="bg-lightListTable border-b dark:bg-darkListTable dark:border-darkListTableBorder">
117
59
  <td :colspan="resource?.columns.length + 2">
118
60
 
119
61
  <div id="toast-simple"
@@ -127,7 +69,7 @@
127
69
  </tr>
128
70
 
129
71
  <tr @click="onClick($event,row)" v-else v-for="(row, rowI) in rows" :key="row.id"
130
- class="bg-list-view-table-bg border-b dark:bg-gray-800 border-list-view-border-color dark:border-gray-700 hover:bg-list-view-table-row-hover dark:hover:bg-gray-600 cursor-pointer">
72
+ class="bg-lightListTable border-b dark:bg-darkListTable border-lightListBorder dark:border-gray-700 hover:bg-lightListTableRowHover dark:hover:bg-darkListTableRowHover cursor-pointer">
131
73
  <td class="w-4 p-4 cursor-default" @click="(e)=>{e.stopPropagation()}">
132
74
  <div class="flex items center ">
133
75
  <input
@@ -287,6 +229,7 @@ import ValueRenderer from '@/components/ValueRenderer.vue';
287
229
  import { getCustomComponent } from '@/utils';
288
230
  import { useCoreStore } from '@/stores/core';
289
231
  import { showSuccesTost } from '@/composables/useFrontendApi';
232
+ import SkeleteLoader from '@/components/SkeleteLoader.vue';
290
233
 
291
234
  import {
292
235
  IconInboxOutline,
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <tr v-for="c in new Array(props.columns)" class="bg-lightListTable border-b dark:bg-darkListTable dark:border-darkListBorder">
3
+ <td v-for="r in new Array(props.rows)" class="items-center px-6 py-20 cursor-default" >
4
+ <div role="status" class="max-w-sm animate-pulse">
5
+ <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[360px]"></div>
6
+ </div>
7
+ </td>
8
+ </tr>
9
+ </template>
10
+
11
+ <script setup>
12
+
13
+ const props = defineProps({
14
+ columns:Number,
15
+ rows:Number
16
+ });
17
+
18
+
19
+ </script>
20
+
21
+ <style lang="scss" scoped>
22
+
23
+ </style>
@@ -22,7 +22,7 @@
22
22
  v-if="checkboxes.length"
23
23
  data-tooltip-target="tooltip-remove-all"
24
24
  data-tooltip-placement="bottom"
25
- class="flex gap-1 items-center py-1 px-3 me-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 rounded-default"
25
+ class="flex gap-1 items-center py-1 px-3 me-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-darkListTable dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 rounded-default"
26
26
  >
27
27
  <IconBanOutline class="w-5 h-5 "/>
28
28